diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..40c14d1c --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,55 @@ +# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter +name-template: v$RESOLVED_VERSION +tag-template: v$RESOLVED_VERSION + +template: | + $CHANGES + + ## OpenAPI spec + + + +categories: + - title: 🚀 New features and improvements + labels: + - enhancement + - title: 🐛 Bug fixes + labels: + - bug + - title: 📝 Documentation updates + labels: + - documentation + - title: 👻 Maintenance + labels: + - chore + - maintenance + - title: 🚦 Tests + labels: + - test + - title: ✍ Other changes + - title: 📦 Dependency updates + labels: + - dependencies + collapse-after: 5 + - title: 🔐 Security + labels: + - "🔐 security" + - type: version-resolver + semver-increment: major + when: + label: major + - type: version-resolver + semver-increment: minor + when: + label: minor + - type: version-resolver + semver-increment: patch + +exclude-labels: + - skip-changelog + - invalid + +autolabeler: + - label: "documentation" + files: + - "*.md" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d420a391..9bc339ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: lint: - runs-on: ubuntu-latest + runs-on: blacksmith-2vcpu-ubuntu-2404 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -21,7 +21,7 @@ jobs: run: pip install uv - name: Install dependencies - run: uv pip install --system "ruff>=0.15.0" + run: uv pip install --system "ruff==0.16.3" - name: Ruff check run: ruff check . @@ -30,10 +30,10 @@ jobs: run: ruff format --check . test: - runs-on: ubuntu-latest + runs-on: blacksmith-2vcpu-ubuntu-2404 strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af6265b9..63fd1bda 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: jobs: build-and-publish: - runs-on: ubuntu-latest + runs-on: blacksmith-2vcpu-ubuntu-2404 steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -39,4 +39,4 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - twine upload dist/* \ No newline at end of file + twine upload dist/* diff --git a/CHANGELOG.md b/CHANGELOG.md index cc25935d..c5719583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.0] - 2026-08-14 + +### Added +- Alert retrigger rule endpoints and models +- Status page announcement, component, and component group endpoints and models +- Verified domain endpoints and models +- Freshservice retrospective PDF workflow task support + +### Changed +- Regenerated the client from the latest OpenAPI specification +- **BREAKING**: Replaced `AutoAssignRoleRootlyTaskParams` with target-specific variants for escalation policies, + services, users, groups, and schedules + +### Fixed +- Applied the nullable enum fix to generated model files + ## [1.4.0] - 2026-07-20 ### Added @@ -176,4 +192,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Previous Releases -Changes before this version were not systematically tracked in a changelog. \ No newline at end of file +Changes before this version were not systematically tracked in a changelog. diff --git a/Makefile b/Makefile index 94d22b41..b35a8635 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ NEW_PATCH := $(MAJOR).$(MINOR).$(shell echo $$(($(PATCH) + 1))) # Today's date TODAY := $(shell date +%Y-%m-%d) +RUFF_VERSION := 0.16.3 bump-major: @echo "Bumping version: $(CURRENT_VERSION) -> $(NEW_MAJOR)" @@ -42,9 +43,9 @@ regenerate: @echo "Applying nullable enum fix..." @python tools/fix_nullable_enums.py @echo "Fixing lint errors..." - @ruff check --fix rootly_sdk/ + @uvx --from ruff==$(RUFF_VERSION) ruff check --fix . @echo "Formatting patched files..." - @ruff format rootly_sdk/ + @uvx --from ruff==$(RUFF_VERSION) ruff format . test: python -c "import rootly_sdk; print('SDK imports successfully')" diff --git a/README.md b/README.md index 9edfad5c..b038ee0b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ By default, when you're calling an HTTPS API it will attempt to verify that SSL ```python client = AuthenticatedClient( - base_url="https://internal_api.example.com", + base_url="https://internal_api.example.com", token="SuperSecretToken", verify_ssl="/path/to/certificate_bundle.pem", ) @@ -56,11 +56,7 @@ client = AuthenticatedClient( You can also disable certificate validation altogether, but beware that **this is a security risk**. ```python -client = AuthenticatedClient( - base_url="https://internal_api.example.com", - token="SuperSecretToken", - verify_ssl=False -) +client = AuthenticatedClient(base_url="https://internal_api.example.com", token="SuperSecretToken", verify_ssl=False) ``` Things to know: @@ -81,13 +77,16 @@ There are more settings on the generated `Client` class which let you control mo ```python from rootly_sdk import Client + def log_request(request): print(f"Request event hook: {request.method} {request.url} - Waiting for response") + def log_response(response): request = response.request print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + client = Client( base_url="https://api.example.com", httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, diff --git a/pyproject.toml b/pyproject.toml index 0c87f93c..31d1083c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "rootly" -version = "1.4.0" +version = "2.0.0" description = "A client library for accessing Rootly API v1" authors = [] readme = "README.md" diff --git a/rootly_sdk/api/ai_chat/create_ai_chat.py b/rootly_sdk/api/ai_chat/create_ai_chat.py index a1b78093..77ab6bae 100644 --- a/rootly_sdk/api/ai_chat/create_ai_chat.py +++ b/rootly_sdk/api/ai_chat/create_ai_chat.py @@ -13,26 +13,25 @@ def _get_kwargs( *, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["message"] = message - json_session_id: str | Unset = UNSET + json_session_id: Unset | str = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: str | Unset = UNSET + json_incident_id: Unset | str = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: str | Unset = UNSET + json_alert_id: Unset | str = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -83,9 +82,9 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> Response[AiChatResponse | Any]: """Send AI chat message @@ -95,16 +94,16 @@ def sync_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): 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[AiChatResponse | Any] + Response[Union[AiChatResponse, Any]] """ kwargs = _get_kwargs( @@ -125,9 +124,9 @@ def sync( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> AiChatResponse | Any | None: """Send AI chat message @@ -137,16 +136,16 @@ def sync( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): 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: - AiChatResponse | Any + Union[AiChatResponse, Any] """ return sync_detailed( @@ -162,9 +161,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> Response[AiChatResponse | Any]: """Send AI chat message @@ -174,16 +173,16 @@ async def asyncio_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): 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[AiChatResponse | Any] + Response[Union[AiChatResponse, Any]] """ kwargs = _get_kwargs( @@ -202,9 +201,9 @@ async def asyncio( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> AiChatResponse | Any | None: """Send AI chat message @@ -214,16 +213,16 @@ async def asyncio( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): 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: - AiChatResponse | Any + Union[AiChatResponse, Any] """ return ( diff --git a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py index 810d9b1e..2a6cfc00 100644 --- a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py +++ b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/ai/chat/sessions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/ai/chat/sessions/{id}", } return _kwargs diff --git a/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py b/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py index 8f13b2d4..22f548c3 100644 --- a/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py +++ b/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote from uuid import UUID import httpx @@ -14,10 +13,9 @@ def _get_kwargs( session_id: UUID, *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -28,9 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/ai/chat/sessions/{session_id}/messages".format( - session_id=quote(str(session_id), safe=""), - ), + "url": f"/v1/ai/chat/sessions/{session_id}/messages", "params": params, } @@ -70,8 +66,8 @@ def sync_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[AiChatSessionMessageList | Any]: """List AI chat session messages @@ -80,15 +76,15 @@ def sync_detailed( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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[AiChatSessionMessageList | Any] + Response[Union[AiChatSessionMessageList, Any]] """ kwargs = _get_kwargs( @@ -108,8 +104,8 @@ def sync( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> AiChatSessionMessageList | Any | None: """List AI chat session messages @@ -118,15 +114,15 @@ def sync( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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: - AiChatSessionMessageList | Any + Union[AiChatSessionMessageList, Any] """ return sync_detailed( @@ -141,8 +137,8 @@ async def asyncio_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[AiChatSessionMessageList | Any]: """List AI chat session messages @@ -151,15 +147,15 @@ async def asyncio_detailed( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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[AiChatSessionMessageList | Any] + Response[Union[AiChatSessionMessageList, Any]] """ kwargs = _get_kwargs( @@ -177,8 +173,8 @@ async def asyncio( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> AiChatSessionMessageList | Any | None: """List AI chat session messages @@ -187,15 +183,15 @@ async def asyncio( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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: - AiChatSessionMessageList | Any + Union[AiChatSessionMessageList, Any] """ return ( diff --git a/rootly_sdk/api/ai_chat/stream_ai_chat.py b/rootly_sdk/api/ai_chat/stream_ai_chat.py index db3d600b..1dab0fe1 100644 --- a/rootly_sdk/api/ai_chat/stream_ai_chat.py +++ b/rootly_sdk/api/ai_chat/stream_ai_chat.py @@ -12,26 +12,25 @@ def _get_kwargs( *, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["message"] = message - json_session_id: str | Unset = UNSET + json_session_id: Unset | str = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: str | Unset = UNSET + json_incident_id: Unset | str = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: str | Unset = UNSET + json_alert_id: Unset | str = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -73,9 +72,9 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -86,9 +85,9 @@ def sync_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,9 +115,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -129,9 +128,9 @@ async def asyncio_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_events/create_alert_event.py b/rootly_sdk/api/alert_events/create_alert_event.py index 1ba1d753..f5d287dc 100644 --- a/rootly_sdk/api/alert_events/create_alert_event.py +++ b/rootly_sdk/api/alert_events/create_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.alert_event_response import AlertEventResponse from ...models.errors_list import ErrorsList from ...models.new_alert_event import NewAlertEvent -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( alert_id: str, *, - body: NewAlertEvent | Unset = UNSET, + body: NewAlertEvent, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{alert_id}/events".format( - alert_id=quote(str(alert_id), safe=""), - ), + "url": f"/v1/alerts/{alert_id}/events", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -69,7 +65,7 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, + body: NewAlertEvent, ) -> Response[AlertEventResponse | ErrorsList]: """Create alert event @@ -77,14 +73,14 @@ def sync_detailed( Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): 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[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, + body: NewAlertEvent, ) -> AlertEventResponse | ErrorsList | None: """Create alert event @@ -111,14 +107,14 @@ def sync( Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): 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: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, + body: NewAlertEvent, ) -> Response[AlertEventResponse | ErrorsList]: """Create alert event @@ -140,14 +136,14 @@ async def asyncio_detailed( Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): 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[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, + body: NewAlertEvent, ) -> AlertEventResponse | ErrorsList | None: """Create alert event @@ -172,14 +168,14 @@ async def asyncio( Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): 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: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_events/delete_alert_event.py b/rootly_sdk/api/alert_events/delete_alert_event.py index fa37ebdf..cb3dd9b6 100644 --- a/rootly_sdk/api/alert_events/delete_alert_event.py +++ b/rootly_sdk/api/alert_events/delete_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_events/{id}", } return _kwargs @@ -67,7 +63,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -99,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -126,7 +122,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -156,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_events/get_alert_event.py b/rootly_sdk/api/alert_events/get_alert_event.py index 0c7b7f99..97436121 100644 --- a/rootly_sdk/api/alert_events/get_alert_event.py +++ b/rootly_sdk/api/alert_events/get_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_events/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_events/list_alert_events.py b/rootly_sdk/api/alert_events/list_alert_events.py index cdbb09b0..9f2e292e 100644 --- a/rootly_sdk/api/alert_events/list_alert_events.py +++ b/rootly_sdk/api/alert_events/list_alert_events.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,13 +12,12 @@ def _get_kwargs( alert_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -36,9 +34,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alerts/{alert_id}/events".format( - alert_id=quote(str(alert_id), safe=""), - ), + "url": f"/v1/alerts/{alert_id}/events", "params": params, } @@ -70,11 +66,11 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -82,11 +78,11 @@ def sync_detailed( Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,11 +112,11 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> AlertEventList | None: """List alert events @@ -128,11 +124,11 @@ def sync( Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,11 +153,11 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -169,11 +165,11 @@ async def asyncio_detailed( Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,11 +197,11 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> AlertEventList | None: """List alert events @@ -213,11 +209,11 @@ async def asyncio( Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_events/list_alert_events_feed.py b/rootly_sdk/api/alert_events/list_alert_events_feed.py index b9a7a95a..aa204cc1 100644 --- a/rootly_sdk/api/alert_events/list_alert_events_feed.py +++ b/rootly_sdk/api/alert_events/list_alert_events_feed.py @@ -18,19 +18,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -39,19 +38,19 @@ def _get_kwargs( params["page[after]"] = pageafter - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_filterkind: str | Unset = UNSET + json_filterkind: Unset | str = UNSET if not isinstance(filterkind, Unset): json_filterkind = filterkind params["filter[kind]"] = json_filterkind - json_filteraction: str | Unset = UNSET + json_filteraction: Unset | str = UNSET if not isinstance(filteraction, Unset): json_filteraction = filteraction @@ -102,17 +101,17 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -121,17 +120,17 @@ def sync_detailed( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -165,17 +164,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> AlertEventFeedList | None: """List alert events across alerts @@ -184,17 +183,17 @@ def sync( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -223,17 +222,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -242,17 +241,17 @@ async def asyncio_detailed( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -284,17 +283,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> AlertEventFeedList | None: """List alert events across alerts @@ -303,17 +302,17 @@ async def asyncio( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_events/update_alert_event.py b/rootly_sdk/api/alert_events/update_alert_event.py index ef172e7d..f4649948 100644 --- a/rootly_sdk/api/alert_events/update_alert_event.py +++ b/rootly_sdk/api/alert_events/update_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.alert_event_response import AlertEventResponse from ...models.errors_list import ErrorsList from ...models.update_alert_event import UpdateAlertEvent -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateAlertEvent | Unset = UNSET, + body: UpdateAlertEvent, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alert_events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_events/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, + body: UpdateAlertEvent, ) -> Response[AlertEventResponse | ErrorsList]: """Update alert event @@ -78,15 +74,15 @@ def sync_detailed( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. 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[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, + body: UpdateAlertEvent, ) -> AlertEventResponse | ErrorsList | None: """Update alert event @@ -114,15 +110,15 @@ def sync( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. 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: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, + body: UpdateAlertEvent, ) -> Response[AlertEventResponse | ErrorsList]: """Update alert event @@ -145,15 +141,15 @@ async def asyncio_detailed( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. 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[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -170,7 +166,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, + body: UpdateAlertEvent, ) -> AlertEventResponse | ErrorsList | None: """Update alert event @@ -179,15 +175,15 @@ async def asyncio( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. 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: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/create_alert_field.py b/rootly_sdk/api/alert_fields/create_alert_field.py index 7d0b7150..768e2a75 100644 --- a/rootly_sdk/api/alert_fields/create_alert_field.py +++ b/rootly_sdk/api/alert_fields/create_alert_field.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/delete_alert_field.py b/rootly_sdk/api/alert_fields/delete_alert_field.py index 0b0984e0..7adfde1f 100644 --- a/rootly_sdk/api/alert_fields/delete_alert_field.py +++ b/rootly_sdk/api/alert_fields/delete_alert_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_fields/{id}", } return _kwargs @@ -62,7 +58,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -71,14 +67,14 @@ def sync_detailed( Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -93,7 +89,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -102,14 +98,14 @@ def sync( Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -119,7 +115,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -128,14 +124,14 @@ async def asyncio_detailed( Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -148,7 +144,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -157,14 +153,14 @@ async def asyncio( Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/get_alert_field.py b/rootly_sdk/api/alert_fields/get_alert_field.py index 10e2a4c9..5d58ac0c 100644 --- a/rootly_sdk/api/alert_fields/get_alert_field.py +++ b/rootly_sdk/api/alert_fields/get_alert_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_fields/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/list_alert_fields.py b/rootly_sdk/api/alert_fields/list_alert_fields.py index 3215ff00..68df61d3 100644 --- a/rootly_sdk/api/alert_fields/list_alert_fields.py +++ b/rootly_sdk/api/alert_fields/list_alert_fields.py @@ -11,27 +11,26 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -107,50 +106,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertFieldList]: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,50 +191,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertFieldList | None: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,50 +271,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertFieldList]: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -355,50 +354,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertFieldList | None: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_fields/update_alert_field.py b/rootly_sdk/api/alert_fields/update_alert_field.py index a65a1e6f..256920be 100644 --- a/rootly_sdk/api/alert_fields/update_alert_field.py +++ b/rootly_sdk/api/alert_fields/update_alert_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateAlertField, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_fields/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -110,7 +107,7 @@ def sync( Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -171,7 +168,7 @@ async def asyncio( Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/create_alert_group.py b/rootly_sdk/api/alert_groups/create_alert_group.py index fc100c79..0a1096b0 100644 --- a/rootly_sdk/api/alert_groups/create_alert_group.py +++ b/rootly_sdk/api/alert_groups/create_alert_group.py @@ -84,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -145,7 +145,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -176,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/delete_alert_group.py b/rootly_sdk/api/alert_groups/delete_alert_group.py index e23900a9..71a11c17 100644 --- a/rootly_sdk/api/alert_groups/delete_alert_group.py +++ b/rootly_sdk/api/alert_groups/delete_alert_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_groups/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/get_alert_group.py b/rootly_sdk/api/alert_groups/get_alert_group.py index 67e96c43..01d08e47 100644 --- a/rootly_sdk/api/alert_groups/get_alert_group.py +++ b/rootly_sdk/api/alert_groups/get_alert_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_groups/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/list_alert_groups.py b/rootly_sdk/api/alert_groups/list_alert_groups.py index a7d416e0..c094e22c 100644 --- a/rootly_sdk/api/alert_groups/list_alert_groups.py +++ b/rootly_sdk/api/alert_groups/list_alert_groups.py @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -77,30 +76,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[AlertGroupList]: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +131,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> AlertGroupList | None: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +181,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[AlertGroupList]: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +234,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> AlertGroupList | None: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_groups/update_alert_group.py b/rootly_sdk/api/alert_groups/update_alert_group.py index 34654d17..f61520b5 100644 --- a/rootly_sdk/api/alert_groups/update_alert_group.py +++ b/rootly_sdk/api/alert_groups/update_alert_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateAlertGroup, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alert_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_groups/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -78,7 +75,7 @@ def sync_detailed( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -86,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,7 +99,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -114,7 +111,7 @@ def sync( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -133,7 +130,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -145,7 +142,7 @@ async def asyncio_detailed( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -153,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -167,7 +164,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -179,7 +176,7 @@ async def asyncio( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_retrigger_rules/__init__.py b/rootly_sdk/api/alert_retrigger_rules/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py new file mode 100644 index 00000000..46ebb90c --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...models.errors_list import ErrorsList +from ...models.new_alert_retrigger_rule import NewAlertRetriggerRule +from ...types import Response + + +def _get_kwargs( + *, + body: NewAlertRetriggerRule, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/alert_retrigger_rules", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRetriggerRuleResponse | ErrorsList | None: + if response.status_code == 201: + response_201 = AlertRetriggerRuleResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRetriggerRuleResponse | ErrorsList]: + 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: NewAlertRetriggerRule, +) -> Response[AlertRetriggerRuleResponse | ErrorsList]: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + 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[Union[AlertRetriggerRuleResponse, ErrorsList]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: NewAlertRetriggerRule, +) -> AlertRetriggerRuleResponse | ErrorsList | None: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + 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: + Union[AlertRetriggerRuleResponse, ErrorsList] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: NewAlertRetriggerRule, +) -> Response[AlertRetriggerRuleResponse | ErrorsList]: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + 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[Union[AlertRetriggerRuleResponse, ErrorsList]] + """ + + 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: NewAlertRetriggerRule, +) -> AlertRetriggerRuleResponse | ErrorsList | None: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + 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: + Union[AlertRetriggerRuleResponse, ErrorsList] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py new file mode 100644 index 00000000..e7846c20 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py @@ -0,0 +1,94 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/alert_retrigger_rules/{id}", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Deletes an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Deletes an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py new file mode 100644 index 00000000..b5b0f5f7 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py @@ -0,0 +1,151 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/alert_retrigger_rules/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRetriggerRuleResponse | None: + if response.status_code == 200: + response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRetriggerRuleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleResponse]: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + 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[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> AlertRetriggerRuleResponse | None: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + 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: + AlertRetriggerRuleResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleResponse]: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + 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[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> AlertRetriggerRuleResponse | None: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + 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: + AlertRetriggerRuleResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py b/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py new file mode 100644 index 00000000..8b9a6032 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_list import AlertRetriggerRuleList +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/alert_retrigger_rules", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertRetriggerRuleList | None: + if response.status_code == 200: + response_200 = AlertRetriggerRuleList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRetriggerRuleList]: + 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[AlertRetriggerRuleList]: + """List alert re-trigger rules + + 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[AlertRetriggerRuleList] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> AlertRetriggerRuleList | None: + """List alert re-trigger rules + + 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: + AlertRetriggerRuleList + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleList]: + """List alert re-trigger rules + + 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[AlertRetriggerRuleList] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> AlertRetriggerRuleList | None: + """List alert re-trigger rules + + 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: + AlertRetriggerRuleList + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py new file mode 100644 index 00000000..a2f98da6 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...models.update_alert_retrigger_rule import UpdateAlertRetriggerRule +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateAlertRetriggerRule, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/alert_retrigger_rules/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRetriggerRuleResponse | None: + if response.status_code == 200: + response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRetriggerRuleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> Response[AlertRetriggerRuleResponse]: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + 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[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> AlertRetriggerRuleResponse | None: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + 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: + AlertRetriggerRuleResponse + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> Response[AlertRetriggerRuleResponse]: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + 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[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> AlertRetriggerRuleResponse | None: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + 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: + AlertRetriggerRuleResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/alert_routes/create_alert_route.py b/rootly_sdk/api/alert_routes/create_alert_route.py index 26d162de..71352eb9 100644 --- a/rootly_sdk/api/alert_routes/create_alert_route.py +++ b/rootly_sdk/api/alert_routes/create_alert_route.py @@ -96,7 +96,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -141,7 +141,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -181,7 +181,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -224,7 +224,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/delete_alert_route.py b/rootly_sdk/api/alert_routes/delete_alert_route.py index 013c2d58..58ef7c73 100644 --- a/rootly_sdk/api/alert_routes/delete_alert_route.py +++ b/rootly_sdk/api/alert_routes/delete_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } return _kwargs @@ -84,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAlertRouteResponse200 | ErrorsList] + Response[Union[DeleteAlertRouteResponse200, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAlertRouteResponse200 | ErrorsList + Union[DeleteAlertRouteResponse200, ErrorsList] """ return sync_detailed( @@ -145,7 +141,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAlertRouteResponse200 | ErrorsList] + Response[Union[DeleteAlertRouteResponse200, ErrorsList]] """ kwargs = _get_kwargs( @@ -176,7 +172,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAlertRouteResponse200 | ErrorsList + Union[DeleteAlertRouteResponse200, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/get_alert_route.py b/rootly_sdk/api/alert_routes/get_alert_route.py index 72f3fec8..0cc6a688 100644 --- a/rootly_sdk/api/alert_routes/get_alert_route.py +++ b/rootly_sdk/api/alert_routes/get_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } return _kwargs @@ -86,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -126,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -161,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -199,7 +195,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/list_alert_routes.py b/rootly_sdk/api/alert_routes/list_alert_routes.py index 45ccfeeb..e248dc32 100644 --- a/rootly_sdk/api/alert_routes/list_alert_routes.py +++ b/rootly_sdk/api/alert_routes/list_alert_routes.py @@ -12,21 +12,20 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -99,19 +98,19 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertRouteList | ErrorsList]: """List alert routes @@ -120,26 +119,26 @@ def sync_detailed( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): 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[AlertRouteList | ErrorsList] + Response[Union[AlertRouteList, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,19 +167,19 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertRouteList | ErrorsList | None: """List alert routes @@ -189,26 +188,26 @@ def sync( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): 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: - AlertRouteList | ErrorsList + Union[AlertRouteList, ErrorsList] """ return sync_detailed( @@ -232,19 +231,19 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertRouteList | ErrorsList]: """List alert routes @@ -253,26 +252,26 @@ async def asyncio_detailed( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): 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[AlertRouteList | ErrorsList] + Response[Union[AlertRouteList, ErrorsList]] """ kwargs = _get_kwargs( @@ -299,19 +298,19 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertRouteList | ErrorsList | None: """List alert routes @@ -320,26 +319,26 @@ async def asyncio( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): 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: - AlertRouteList | ErrorsList + Union[AlertRouteList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/patch_alert_route.py b/rootly_sdk/api/alert_routes/patch_alert_route.py index a8c0c4a9..019b4703 100644 --- a/rootly_sdk/api/alert_routes/patch_alert_route.py +++ b/rootly_sdk/api/alert_routes/patch_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } _kwargs["json"] = body.to_dict() @@ -94,7 +91,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -129,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -159,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -192,7 +189,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/update_alert_route.py b/rootly_sdk/api/alert_routes/update_alert_route.py index 5a47cf35..61f7adaa 100644 --- a/rootly_sdk/api/alert_routes/update_alert_route.py +++ b/rootly_sdk/api/alert_routes/update_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } _kwargs["json"] = body.to_dict() @@ -102,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -150,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -193,7 +190,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -239,7 +236,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py index 55f243d7..1d62f2ab 100644 --- a/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py @@ -84,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -145,7 +145,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -176,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py index 9a0263e6..fbb953a2 100644 --- a/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_routing_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routing_rules/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -68,14 +64,14 @@ def sync_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -101,14 +97,14 @@ def sync( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -118,7 +114,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -129,14 +125,14 @@ async def asyncio_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -149,7 +145,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -160,14 +156,14 @@ async def asyncio( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py index 5946c97a..bf683612 100644 --- a/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_routing_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routing_rules/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -68,14 +64,14 @@ def sync_detailed( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -101,14 +97,14 @@ def sync( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -118,7 +114,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -129,14 +125,14 @@ async def asyncio_detailed( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -149,7 +145,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -160,14 +156,14 @@ async def asyncio( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): 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: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py b/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py index 19c93281..80ae8d97 100644 --- a/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py +++ b/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py @@ -11,26 +11,25 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -106,24 +105,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -132,24 +131,24 @@ def sync_detailed( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,24 +189,24 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertRoutingRuleList | None: """List alert routing rules @@ -216,24 +215,24 @@ def sync( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -269,24 +268,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -295,24 +294,24 @@ async def asyncio_detailed( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -351,24 +350,24 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertRoutingRuleList | None: """List alert routing rules @@ -377,24 +376,24 @@ async def asyncio( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py index 6bc038cd..2963b725 100644 --- a/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateAlertRoutingRule, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_routing_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routing_rules/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -78,7 +75,7 @@ def sync_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -86,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,7 +99,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -114,7 +111,7 @@ def sync( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -133,7 +130,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -145,7 +142,7 @@ async def asyncio_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -153,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -167,7 +164,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -179,7 +176,7 @@ async def asyncio( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/create_alerts_source.py b/rootly_sdk/api/alert_sources/create_alerts_source.py index 893eb998..2799fd4c 100644 --- a/rootly_sdk/api/alert_sources/create_alerts_source.py +++ b/rootly_sdk/api/alert_sources/create_alerts_source.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/delete_alerts_source.py b/rootly_sdk/api/alert_sources/delete_alerts_source.py index 24e0748d..92d06bad 100644 --- a/rootly_sdk/api/alert_sources/delete_alerts_source.py +++ b/rootly_sdk/api/alert_sources/delete_alerts_source.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_sources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_sources/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/get_alerts_source.py b/rootly_sdk/api/alert_sources/get_alerts_source.py index e3617a5a..dcca8a3e 100644 --- a/rootly_sdk/api/alert_sources/get_alerts_source.py +++ b/rootly_sdk/api/alert_sources/get_alerts_source.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_sources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_sources/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/list_alerts_sources.py b/rootly_sdk/api/alert_sources/list_alerts_sources.py index 39744362..be6ae53e 100644 --- a/rootly_sdk/api/alert_sources/list_alerts_sources.py +++ b/rootly_sdk/api/alert_sources/list_alerts_sources.py @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -77,30 +76,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertsSourceList]: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +131,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> AlertsSourceList | None: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +181,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertsSourceList]: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +234,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> AlertsSourceList | None: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_sources/update_alerts_source.py b/rootly_sdk/api/alert_sources/update_alerts_source.py index 32c1f348..0a73d9e4 100644 --- a/rootly_sdk/api/alert_sources/update_alerts_source.py +++ b/rootly_sdk/api/alert_sources/update_alerts_source.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_sources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_sources/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/create_alert_urgency.py b/rootly_sdk/api/alert_urgencies/create_alert_urgency.py index d44f0d38..875f1fa0 100644 --- a/rootly_sdk/api/alert_urgencies/create_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/create_alert_urgency.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py index 46ed88c4..e9f92b31 100644 --- a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_urgencies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_urgencies/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py index 947f8dd9..a1b9d84b 100644 --- a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_urgencies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_urgencies/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py index a4455d0f..3ce979c9 100644 --- a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py +++ b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py @@ -11,22 +11,21 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -92,40 +91,40 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,40 +161,40 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertUrgencyList | None: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -227,40 +226,40 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -295,40 +294,40 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AlertUrgencyList | None: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py index 2bef0a08..fb82767a 100644 --- a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_urgencies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_urgencies/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/acknowledge_alert.py b/rootly_sdk/api/alerts/acknowledge_alert.py index be8c6611..7bc7b1dd 100644 --- a/rootly_sdk/api/alerts/acknowledge_alert.py +++ b/rootly_sdk/api/alerts/acknowledge_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/acknowledge".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/acknowledge", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/attach_alert.py b/rootly_sdk/api/alerts/attach_alert.py index 3f0911e6..2c0ce528 100644 --- a/rootly_sdk/api/alerts/attach_alert.py +++ b/rootly_sdk/api/alerts/attach_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/alerts".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/alerts", } _kwargs["json"] = body.to_dict() @@ -81,7 +78,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertList | ErrorsList] + Response[Union[AlertList, ErrorsList]] """ kwargs = _get_kwargs( @@ -115,7 +112,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertList | ErrorsList + Union[AlertList, ErrorsList] """ return sync_detailed( @@ -144,7 +141,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertList | ErrorsList] + Response[Union[AlertList, ErrorsList]] """ kwargs = _get_kwargs( @@ -176,7 +173,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertList | ErrorsList + Union[AlertList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/create_alert.py b/rootly_sdk/api/alerts/create_alert.py index e7ef6e59..9578c1ca 100644 --- a/rootly_sdk/api/alerts/create_alert.py +++ b/rootly_sdk/api/alerts/create_alert.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/escalate_alert.py b/rootly_sdk/api/alerts/escalate_alert.py index c4a33380..bd4ac638 100644 --- a/rootly_sdk/api/alerts/escalate_alert.py +++ b/rootly_sdk/api/alerts/escalate_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.escalate_alert import EscalateAlert -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: EscalateAlert | Unset = UNSET, + body: EscalateAlert, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/escalate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/escalate", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -79,7 +75,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, + body: EscalateAlert, ) -> Response[AlertResponse | ErrorsList]: """Escalates an alert @@ -87,14 +83,14 @@ def sync_detailed( Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +109,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, + body: EscalateAlert, ) -> AlertResponse | ErrorsList | None: """Escalates an alert @@ -121,14 +117,14 @@ def sync( Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -142,7 +138,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, + body: EscalateAlert, ) -> Response[AlertResponse | ErrorsList]: """Escalates an alert @@ -150,14 +146,14 @@ async def asyncio_detailed( Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -174,7 +170,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, + body: EscalateAlert, ) -> AlertResponse | ErrorsList | None: """Escalates an alert @@ -182,14 +178,14 @@ async def asyncio( Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/get_alert.py b/rootly_sdk/api/alerts/get_alert.py index 20a1c7fd..c34c24e4 100644 --- a/rootly_sdk/api/alerts/get_alert.py +++ b/rootly_sdk/api/alerts/get_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetAlertInclude | Unset = UNSET, + include: Unset | GetAlertInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alerts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, + include: Unset | GetAlertInclude = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Retrieves an alert @@ -81,14 +77,14 @@ def sync_detailed( Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -107,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, + include: Unset | GetAlertInclude = UNSET, ) -> AlertResponse | ErrorsList | None: """Retrieves an alert @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, + include: Unset | GetAlertInclude = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Retrieves an alert @@ -144,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, + include: Unset | GetAlertInclude = UNSET, ) -> AlertResponse | ErrorsList | None: """Retrieves an alert @@ -176,14 +172,14 @@ async def asyncio( Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/get_receipt.py b/rootly_sdk/api/alerts/get_receipt.py index 0cd00675..032cd781 100644 --- a/rootly_sdk/api/alerts/get_receipt.py +++ b/rootly_sdk/api/alerts/get_receipt.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alerts/receipts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/receipts/{id}", } return _kwargs @@ -67,7 +63,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Receipt] + Response[Union[Any, Receipt]] """ kwargs = _get_kwargs( @@ -99,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Receipt + Union[Any, Receipt] """ return sync_detailed( @@ -126,7 +122,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Receipt] + Response[Union[Any, Receipt]] """ kwargs = _get_kwargs( @@ -156,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Receipt + Union[Any, Receipt] """ return ( diff --git a/rootly_sdk/api/alerts/list_alerts.py b/rootly_sdk/api/alerts/list_alerts.py index 6e36af8d..0193806d 100644 --- a/rootly_sdk/api/alerts/list_alerts.py +++ b/rootly_sdk/api/alerts/list_alerts.py @@ -12,61 +12,60 @@ def _get_kwargs( *, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -205,112 +204,112 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[AlertList]: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -383,112 +382,112 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> AlertList | None: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -556,112 +555,112 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[AlertList]: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -732,112 +731,112 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> AlertList | None: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alerts/list_incident_alerts.py b/rootly_sdk/api/alerts/list_incident_alerts.py index 4358b186..0932d1c3 100644 --- a/rootly_sdk/api/alerts/list_incident_alerts.py +++ b/rootly_sdk/api/alerts/list_incident_alerts.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -29,9 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/alerts".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/alerts", "params": params, } @@ -63,7 +59,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -71,7 +67,7 @@ def sync_detailed( Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,7 +93,7 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> AlertList | None: """List Incident alerts @@ -105,7 +101,7 @@ def sync( Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,7 +122,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -134,7 +130,7 @@ async def asyncio_detailed( Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,7 +154,7 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> AlertList | None: """List Incident alerts @@ -166,7 +162,7 @@ async def asyncio( Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alerts/resolve_alert.py b/rootly_sdk/api/alerts/resolve_alert.py index 66ec0165..0dfeab41 100644 --- a/rootly_sdk/api/alerts/resolve_alert.py +++ b/rootly_sdk/api/alerts/resolve_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.resolve_alert import ResolveAlert -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: ResolveAlert | Unset = UNSET, + body: ResolveAlert, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/resolve".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/resolve", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, + body: ResolveAlert, ) -> Response[AlertResponse | ErrorsList]: """Resolves an alert @@ -77,14 +73,14 @@ def sync_detailed( Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, + body: ResolveAlert, ) -> AlertResponse | ErrorsList | None: """Resolves an alert @@ -111,14 +107,14 @@ def sync( Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, + body: ResolveAlert, ) -> Response[AlertResponse | ErrorsList]: """Resolves an alert @@ -140,14 +136,14 @@ async def asyncio_detailed( Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, + body: ResolveAlert, ) -> AlertResponse | ErrorsList | None: """Resolves an alert @@ -172,14 +168,14 @@ async def asyncio( Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/snooze_alert.py b/rootly_sdk/api/alerts/snooze_alert.py index cf592ccd..3c2d9ff0 100644 --- a/rootly_sdk/api/alerts/snooze_alert.py +++ b/rootly_sdk/api/alerts/snooze_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/snooze".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/snooze", } _kwargs["json"] = body.to_dict() @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/update_alert.py b/rootly_sdk/api/alerts/update_alert.py index 5a60b818..169e0410 100644 --- a/rootly_sdk/api/alerts/update_alert.py +++ b/rootly_sdk/api/alerts/update_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.update_alert import UpdateAlert -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateAlert | Unset = UNSET, + body: UpdateAlert, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alerts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, + body: UpdateAlert, ) -> Response[AlertResponse | ErrorsList]: """Update alert @@ -77,14 +73,14 @@ def sync_detailed( Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, + body: UpdateAlert, ) -> AlertResponse | ErrorsList | None: """Update alert @@ -111,14 +107,14 @@ def sync( Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, + body: UpdateAlert, ) -> Response[AlertResponse | ErrorsList]: """Update alert @@ -140,14 +136,14 @@ async def asyncio_detailed( Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): 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[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, + body: UpdateAlert, ) -> AlertResponse | ErrorsList | None: """Update alert @@ -172,14 +168,14 @@ async def asyncio( Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): 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: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/create_api_key.py b/rootly_sdk/api/api_keys/create_api_key.py index 6573821d..5df4ee0d 100644 --- a/rootly_sdk/api/api_keys/create_api_key.py +++ b/rootly_sdk/api/api_keys/create_api_key.py @@ -93,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -135,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return sync_detailed( @@ -172,7 +172,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -212,7 +212,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/delete_api_key.py b/rootly_sdk/api/api_keys/delete_api_key.py index 948015a0..6760e4a8 100644 --- a/rootly_sdk/api/api_keys/delete_api_key.py +++ b/rootly_sdk/api/api_keys/delete_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -15,12 +14,9 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/api_keys/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -112,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return sync_detailed( @@ -142,7 +138,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -175,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/get_api_key.py b/rootly_sdk/api/api_keys/get_api_key.py index 6ba239a8..5cc91a24 100644 --- a/rootly_sdk/api/api_keys/get_api_key.py +++ b/rootly_sdk/api/api_keys/get_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -15,9 +14,8 @@ def _get_kwargs( id: UUID, *, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/api_keys/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}", "params": params, } @@ -69,7 +65,7 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> Response[ApiKeyResponse | ErrorsList]: """Retrieves an API key @@ -78,14 +74,14 @@ def sync_detailed( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): 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[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -104,7 +100,7 @@ def sync( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> ApiKeyResponse | ErrorsList | None: """Retrieves an API key @@ -113,14 +109,14 @@ def sync( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): 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: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> Response[ApiKeyResponse | ErrorsList]: """Retrieves an API key @@ -143,14 +139,14 @@ async def asyncio_detailed( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): 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[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -167,7 +163,7 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> ApiKeyResponse | ErrorsList | None: """Retrieves an API key @@ -176,14 +172,14 @@ async def asyncio( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): 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: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/list_api_keys.py b/rootly_sdk/api/api_keys/list_api_keys.py index 6f057d91..2c8322c6 100644 --- a/rootly_sdk/api/api_keys/list_api_keys.py +++ b/rootly_sdk/api/api_keys/list_api_keys.py @@ -12,32 +12,31 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -132,30 +131,30 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[ApiKeyList | ErrorsList]: """List API keys @@ -178,37 +177,37 @@ def sync_detailed( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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[ApiKeyList | ErrorsList] + Response[Union[ApiKeyList, ErrorsList]] """ kwargs = _get_kwargs( @@ -248,30 +247,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> ApiKeyList | ErrorsList | None: """List API keys @@ -294,37 +293,37 @@ def sync( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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: - ApiKeyList | ErrorsList + Union[ApiKeyList, ErrorsList] """ return sync_detailed( @@ -359,30 +358,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[ApiKeyList | ErrorsList]: """List API keys @@ -405,37 +404,37 @@ async def asyncio_detailed( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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[ApiKeyList | ErrorsList] + Response[Union[ApiKeyList, ErrorsList]] """ kwargs = _get_kwargs( @@ -473,30 +472,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> ApiKeyList | ErrorsList | None: """List API keys @@ -519,37 +518,37 @@ async def asyncio( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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: - ApiKeyList | ErrorsList + Union[ApiKeyList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/rotate_api_key.py b/rootly_sdk/api/api_keys/rotate_api_key.py index 9bdb2773..7fff187b 100644 --- a/rootly_sdk/api/api_keys/rotate_api_key.py +++ b/rootly_sdk/api/api_keys/rotate_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.api_key_with_token_response import ApiKeyWithTokenResponse from ...models.errors_list import ErrorsList from ...models.rotate_api_key import RotateApiKey -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: RotateApiKey | Unset = UNSET, + body: RotateApiKey, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/api_keys/{id}/rotate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}/rotate", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, + body: RotateApiKey, ) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Rotate an API key @@ -96,14 +92,14 @@ def sync_detailed( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): 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[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -122,7 +118,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, + body: RotateApiKey, ) -> ApiKeyWithTokenResponse | ErrorsList | None: """Rotate an API key @@ -149,14 +145,14 @@ def sync( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): 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: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return sync_detailed( @@ -170,7 +166,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, + body: RotateApiKey, ) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Rotate an API key @@ -197,14 +193,14 @@ async def asyncio_detailed( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): 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[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -221,7 +217,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, + body: RotateApiKey, ) -> ApiKeyWithTokenResponse | ErrorsList | None: """Rotate an API key @@ -248,14 +244,14 @@ async def asyncio( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): 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: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/update_api_key.py b/rootly_sdk/api/api_keys/update_api_key.py index 94cebad5..1411b1d1 100644 --- a/rootly_sdk/api/api_keys/update_api_key.py +++ b/rootly_sdk/api/api_keys/update_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/api_keys/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}", } _kwargs["json"] = body.to_dict() @@ -90,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -130,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return sync_detailed( @@ -165,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -203,7 +200,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/audits/list_audits.py b/rootly_sdk/api/audits/list_audits.py index fce7f754..4bca1146 100644 --- a/rootly_sdk/api/audits/list_audits.py +++ b/rootly_sdk/api/audits/list_audits.py @@ -11,36 +11,35 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -134,68 +133,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuditsList]: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -246,68 +245,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AuditsList | None: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -353,68 +352,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuditsList]: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -463,68 +462,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AuditsList | None: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/authorizations/create_authorization.py b/rootly_sdk/api/authorizations/create_authorization.py index 2d0bfee5..42583829 100644 --- a/rootly_sdk/api/authorizations/create_authorization.py +++ b/rootly_sdk/api/authorizations/create_authorization.py @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/authorizations/delete_authorization.py b/rootly_sdk/api/authorizations/delete_authorization.py index 9fed121b..bfe0dd26 100644 --- a/rootly_sdk/api/authorizations/delete_authorization.py +++ b/rootly_sdk/api/authorizations/delete_authorization.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/authorizations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/authorizations/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/authorizations/get_authorization.py b/rootly_sdk/api/authorizations/get_authorization.py index c58b0704..f715f915 100644 --- a/rootly_sdk/api/authorizations/get_authorization.py +++ b/rootly_sdk/api/authorizations/get_authorization.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/authorizations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/authorizations/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/authorizations/list_authorizations.py b/rootly_sdk/api/authorizations/list_authorizations.py index 46d7343d..a5da47f3 100644 --- a/rootly_sdk/api/authorizations/list_authorizations.py +++ b/rootly_sdk/api/authorizations/list_authorizations.py @@ -11,20 +11,19 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -86,36 +85,36 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuthorizationList]: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,36 +149,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AuthorizationList | None: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -209,36 +208,36 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuthorizationList]: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,36 +270,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> AuthorizationList | None: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/authorizations/update_authorization.py b/rootly_sdk/api/authorizations/update_authorization.py index 958e25ad..67dfa1c8 100644 --- a/rootly_sdk/api/authorizations/update_authorization.py +++ b/rootly_sdk/api/authorizations/update_authorization.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/authorizations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/authorizations/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py index a0c9a8cf..a78ecfc4 100644 --- a/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py index e96022f3..8dabe3aa 100644 --- a/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_checklist_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py index baaac4c8..7b09302b 100644 --- a/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_checklist_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py b/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py index 4b04ef57..3201e961 100644 --- a/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py +++ b/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py @@ -17,29 +17,28 @@ def _get_kwargs( *, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -104,36 +103,36 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,36 +167,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogChecklistTemplateList | None: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -227,36 +226,36 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -289,36 +288,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogChecklistTemplateList | None: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py index 03363ecf..6d42ab1f 100644 --- a/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote from uuid import UUID import httpx @@ -12,14 +11,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalog_checklist_templates/{id}/trigger".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}/trigger", } return _kwargs @@ -51,7 +47,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList]: @@ -60,14 +56,14 @@ def sync_detailed( Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -82,7 +78,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Any | ErrorsList | None: @@ -91,14 +87,14 @@ def sync( Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): 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 | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -108,7 +104,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList]: @@ -117,14 +113,14 @@ async def asyncio_detailed( Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -137,7 +133,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Any | ErrorsList | None: @@ -146,14 +142,14 @@ async def asyncio( Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): 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 | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py index 180d4b3c..23ee77cb 100644 --- a/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateCatalogChecklistTemplate, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_checklist_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -110,7 +107,7 @@ def sync( Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -171,7 +168,7 @@ async def asyncio( Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py index 2e7b988d..e356f8df 100644 --- a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Union import httpx @@ -16,17 +15,16 @@ def _get_kwargs( catalog_id: str, *, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/entities/bulk_delete".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyCatalogEntitiesType0): _kwargs["json"] = body.to_dict() else: @@ -40,7 +38,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: +) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyCatalogEntitiesResponse.from_dict(response.json()) @@ -53,14 +51,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyCatalogEntitiesResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -80,7 +78,9 @@ def _parse_response_422(data: object) -> BulkDestroyCatalogEntitiesResponse | Er def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: +) -> Response[ + BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -93,8 +93,10 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> Response[ + BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] +]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -102,8 +104,8 @@ def sync_detailed( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -111,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -130,8 +132,8 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -139,8 +141,8 @@ def sync( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -148,7 +150,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']] """ return sync_detailed( @@ -162,8 +164,10 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> Response[ + BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] +]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -171,8 +175,8 @@ async def asyncio_detailed( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -180,7 +184,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -197,8 +201,8 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -206,8 +210,8 @@ async def asyncio( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -215,7 +219,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py index 586bef40..f9eacd35 100644 --- a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Union import httpx @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/entities/bulk_upsert".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities/bulk_upsert", } _kwargs["json"] = body.to_dict() @@ -37,7 +34,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: +) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertCatalogEntitiesResponse.from_dict(response.json()) @@ -50,14 +47,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertCatalogEntitiesError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -77,7 +74,7 @@ def _parse_response_422(data: object) -> BulkUpsertCatalogEntitiesError | Errors def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: +) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -91,7 +88,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: +) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -106,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList] + Response[Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -126,7 +123,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: +) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -141,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']] """ return sync_detailed( @@ -156,7 +153,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: +) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -171,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList] + Response[Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -189,7 +186,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: +) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -204,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/catalog_entities/create_catalog_entity.py b/rootly_sdk/api/catalog_entities/create_catalog_entity.py index 37fa998e..19599362 100644 --- a/rootly_sdk/api/catalog_entities/create_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/create_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/entities".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py index f256d19c..0507b2ea 100644 --- a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_entities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entities/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogEntityResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogEntityResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogEntityResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogEntityResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/get_catalog_entity.py b/rootly_sdk/api/catalog_entities/get_catalog_entity.py index a2b59694..6251c47a 100644 --- a/rootly_sdk/api/catalog_entities/get_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/get_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - include: GetCatalogEntityInclude | Unset = UNSET, + include: Unset | GetCatalogEntityInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entities/{id}", "params": params, } @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, + include: Unset | GetCatalogEntityInclude = UNSET, ) -> Response[CatalogEntityResponse | ErrorsList]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): 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[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, + include: Unset | GetCatalogEntityInclude = UNSET, ) -> CatalogEntityResponse | ErrorsList | None: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): 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: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, + include: Unset | GetCatalogEntityInclude = UNSET, ) -> Response[CatalogEntityResponse | ErrorsList]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): 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[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, + include: Unset | GetCatalogEntityInclude = UNSET, ) -> CatalogEntityResponse | ErrorsList | None: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): 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: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/list_catalog_entities.py b/rootly_sdk/api/catalog_entities/list_catalog_entities.py index 82ca16de..2e2ba6b7 100644 --- a/rootly_sdk/api/catalog_entities/list_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/list_catalog_entities.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,43 +14,42 @@ def _get_kwargs( catalog_id: str, *, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -109,9 +107,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalogs/{catalog_id}/entities".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities", "params": params, } @@ -143,32 +139,32 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -176,32 +172,32 @@ def sync_detailed( Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -252,32 +248,32 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> CatalogEntityList | None: """List Catalog Entities @@ -285,32 +281,32 @@ def sync( Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -356,32 +352,32 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -389,32 +385,32 @@ async def asyncio_detailed( Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -463,32 +459,32 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> CatalogEntityList | None: """List Catalog Entities @@ -496,32 +492,32 @@ async def asyncio( Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_entities/update_catalog_entity.py b/rootly_sdk/api/catalog_entities/update_catalog_entity.py index 6613d141..9d1d2f5c 100644 --- a/rootly_sdk/api/catalog_entities/update_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/update_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateCatalogEntity, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_entities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entities/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -110,7 +107,7 @@ def sync( Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -171,7 +168,7 @@ async def asyncio( Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py b/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py index b1dacf13..3b9a528e 100644 --- a/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py +++ b/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -15,12 +14,9 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entity_checklists/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_checklists/{id}", } return _kwargs @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityChecklistResponse | ErrorsList] + Response[Union[CatalogEntityChecklistResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -104,7 +100,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityChecklistResponse | ErrorsList + Union[CatalogEntityChecklistResponse, ErrorsList] """ return sync_detailed( @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityChecklistResponse | ErrorsList] + Response[Union[CatalogEntityChecklistResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -159,7 +155,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityChecklistResponse | ErrorsList + Union[CatalogEntityChecklistResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py b/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py index 63fefcf6..78dacef1 100644 --- a/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py +++ b/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py @@ -11,18 +11,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -84,32 +83,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,32 +141,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogEntityChecklistList | None: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,32 +194,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,32 +250,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogEntityChecklistList | None: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py index 3c834928..43ab5578 100644 --- a/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalog_entities/{catalog_entity_id}/properties".format( - catalog_entity_id=quote(str(catalog_entity_id), safe=""), - ), + "url": f"/v1/catalog_entities/{catalog_entity_id}/properties", } _kwargs["json"] = body.to_dict() @@ -94,7 +91,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -134,7 +131,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -169,7 +166,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -207,7 +204,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py index 5fb2acac..acd0aab7 100644 --- a/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_entity_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_properties/{id}", } return _kwargs @@ -76,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -111,7 +107,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -141,7 +137,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -174,7 +170,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py index 698b1a78..774c79cb 100644 --- a/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -17,12 +16,11 @@ def _get_kwargs( id: str, *, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, + include: Unset | GetCatalogEntityPropertyInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -32,9 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entity_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_properties/{id}", "params": params, } @@ -75,7 +71,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, + include: Unset | GetCatalogEntityPropertyInclude = UNSET, ) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Retrieves a Catalog Entity Property @@ -87,14 +83,14 @@ def sync_detailed( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): 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[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +109,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, + include: Unset | GetCatalogEntityPropertyInclude = UNSET, ) -> CatalogEntityPropertyResponse | ErrorsList | None: """Retrieves a Catalog Entity Property @@ -125,14 +121,14 @@ def sync( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): 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: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +142,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, + include: Unset | GetCatalogEntityPropertyInclude = UNSET, ) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Retrieves a Catalog Entity Property @@ -158,14 +154,14 @@ async def asyncio_detailed( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): 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[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -182,7 +178,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, + include: Unset | GetCatalogEntityPropertyInclude = UNSET, ) -> CatalogEntityPropertyResponse | ErrorsList | None: """Retrieves a Catalog Entity Property @@ -194,14 +190,14 @@ async def asyncio( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): 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: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py b/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py index f4183034..b0e16a22 100644 --- a/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py +++ b/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -19,27 +18,26 @@ def _get_kwargs( catalog_entity_id: str, *, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -65,9 +63,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entities/{catalog_entity_id}/properties".format( - catalog_entity_id=quote(str(catalog_entity_id), safe=""), - ), + "url": f"/v1/catalog_entities/{catalog_entity_id}/properties", "params": params, } @@ -103,16 +99,16 @@ def sync_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -124,16 +120,16 @@ def sync_detailed( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,16 +164,16 @@ def sync( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogEntityPropertyList | None: """List catalog properties @@ -189,16 +185,16 @@ def sync( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -228,16 +224,16 @@ async def asyncio_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -249,16 +245,16 @@ async def asyncio_detailed( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -291,16 +287,16 @@ async def asyncio( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogEntityPropertyList | None: """List catalog properties @@ -312,16 +308,16 @@ async def asyncio( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py index 5d1cc4b3..121225f3 100644 --- a/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_entity_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_properties/{id}", } _kwargs["json"] = body.to_dict() @@ -90,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -131,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -167,7 +164,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -206,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_properties/create_catalog_property.py b/rootly_sdk/api/catalog_properties/create_catalog_property.py index ce8b71c5..572706bb 100644 --- a/rootly_sdk/api/catalog_properties/create_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/create_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -19,9 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/properties".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/properties", } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/catalog_properties/delete_catalog_property.py b/rootly_sdk/api/catalog_properties/delete_catalog_property.py index b08c47da..357e3f0a 100644 --- a/rootly_sdk/api/catalog_properties/delete_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/delete_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_properties/{id}", } return _kwargs diff --git a/rootly_sdk/api/catalog_properties/get_catalog_property.py b/rootly_sdk/api/catalog_properties/get_catalog_property.py index e42871f8..4735f106 100644 --- a/rootly_sdk/api/catalog_properties/get_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/get_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_properties/{id}", } return _kwargs diff --git a/rootly_sdk/api/catalog_properties/list_catalog_properties.py b/rootly_sdk/api/catalog_properties/list_catalog_properties.py index 4d717126..95f3c5c7 100644 --- a/rootly_sdk/api/catalog_properties/list_catalog_properties.py +++ b/rootly_sdk/api/catalog_properties/list_catalog_properties.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( catalog_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalogs/{catalog_id}/properties".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/properties", } return _kwargs diff --git a/rootly_sdk/api/catalog_properties/update_catalog_property.py b/rootly_sdk/api/catalog_properties/update_catalog_property.py index 2847e350..b52f9831 100644 --- a/rootly_sdk/api/catalog_properties/update_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/update_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -19,9 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_properties/{id}", } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/catalogs/create_catalog.py b/rootly_sdk/api/catalogs/create_catalog.py index 736014b9..17867409 100644 --- a/rootly_sdk/api/catalogs/create_catalog.py +++ b/rootly_sdk/api/catalogs/create_catalog.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalogs/delete_catalog.py b/rootly_sdk/api/catalogs/delete_catalog.py index eeebd62e..ec886956 100644 --- a/rootly_sdk/api/catalogs/delete_catalog.py +++ b/rootly_sdk/api/catalogs/delete_catalog.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalogs/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalogs/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalogs/get_catalog.py b/rootly_sdk/api/catalogs/get_catalog.py index 146cb1a4..4d6d46de 100644 --- a/rootly_sdk/api/catalogs/get_catalog.py +++ b/rootly_sdk/api/catalogs/get_catalog.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalogs/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalogs/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalogs/list_catalogs.py b/rootly_sdk/api/catalogs/list_catalogs.py index 47f483e2..cd3bd35f 100644 --- a/rootly_sdk/api/catalogs/list_catalogs.py +++ b/rootly_sdk/api/catalogs/list_catalogs.py @@ -13,42 +13,41 @@ def _get_kwargs( *, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -135,62 +134,62 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogList]: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -238,62 +237,62 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> CatalogList | None: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -336,62 +335,62 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogList]: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -437,62 +436,62 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> CatalogList | None: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalogs/update_catalog.py b/rootly_sdk/api/catalogs/update_catalog.py index 47da6eea..c4838523 100644 --- a/rootly_sdk/api/catalogs/update_catalog.py +++ b/rootly_sdk/api/catalogs/update_catalog.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateCatalog, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalogs/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalogs/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -110,7 +107,7 @@ def sync( Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -171,7 +168,7 @@ async def asyncio( Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/create_cause.py b/rootly_sdk/api/causes/create_cause.py index c1e704a0..963bab83 100644 --- a/rootly_sdk/api/causes/create_cause.py +++ b/rootly_sdk/api/causes/create_cause.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/create_cause_catalog_property.py b/rootly_sdk/api/causes/create_cause_catalog_property.py index 6e2bf436..753ab575 100644 --- a/rootly_sdk/api/causes/create_cause_catalog_property.py +++ b/rootly_sdk/api/causes/create_cause_catalog_property.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/delete_cause.py b/rootly_sdk/api/causes/delete_cause.py index 3edaf3a4..e025be3a 100644 --- a/rootly_sdk/api/causes/delete_cause.py +++ b/rootly_sdk/api/causes/delete_cause.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/causes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/causes/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/get_cause.py b/rootly_sdk/api/causes/get_cause.py index e8c8bff7..d0c85914 100644 --- a/rootly_sdk/api/causes/get_cause.py +++ b/rootly_sdk/api/causes/get_cause.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/causes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/causes/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/list_cause_catalog_properties.py b/rootly_sdk/api/causes/list_cause_catalog_properties.py index 56923dc0..665840f4 100644 --- a/rootly_sdk/api/causes/list_cause_catalog_properties.py +++ b/rootly_sdk/api/causes/list_cause_catalog_properties.py @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -97,34 +96,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +157,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +213,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +272,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/causes/list_causes.py b/rootly_sdk/api/causes/list_causes.py index 183d88e9..2da725c2 100644 --- a/rootly_sdk/api/causes/list_causes.py +++ b/rootly_sdk/api/causes/list_causes.py @@ -11,26 +11,25 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -104,48 +103,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[CauseList]: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,48 +185,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> CauseList | None: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,48 +262,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[CauseList]: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -343,48 +342,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> CauseList | None: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/causes/update_cause.py b/rootly_sdk/api/causes/update_cause.py index 46e11dce..a33c39fc 100644 --- a/rootly_sdk/api/causes/update_cause.py +++ b/rootly_sdk/api/causes/update_cause.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateCause, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/causes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/causes/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, @@ -110,7 +107,7 @@ def sync( Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, @@ -171,7 +168,7 @@ async def asyncio( Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/create_communications_group.py b/rootly_sdk/api/communications_groups/create_communications_group.py index 84fa7b89..c3ed86fd 100644 --- a/rootly_sdk/api/communications_groups/create_communications_group.py +++ b/rootly_sdk/api/communications_groups/create_communications_group.py @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return sync_detailed( @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/delete_communications_group.py b/rootly_sdk/api/communications_groups/delete_communications_group.py index 7bb4306a..3101f2d4 100644 --- a/rootly_sdk/api/communications_groups/delete_communications_group.py +++ b/rootly_sdk/api/communications_groups/delete_communications_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/groups/{id}", } return _kwargs @@ -66,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -97,7 +93,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -123,7 +119,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -152,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/get_communications_group.py b/rootly_sdk/api/communications_groups/get_communications_group.py index 9c1e74ef..d50430d4 100644 --- a/rootly_sdk/api/communications_groups/get_communications_group.py +++ b/rootly_sdk/api/communications_groups/get_communications_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/groups/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/list_communications_groups.py b/rootly_sdk/api/communications_groups/list_communications_groups.py index 880eea27..c3054d0c 100644 --- a/rootly_sdk/api/communications_groups/list_communications_groups.py +++ b/rootly_sdk/api/communications_groups/list_communications_groups.py @@ -11,21 +11,20 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -93,38 +92,38 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,38 +159,38 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsGroupsResponse | None: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,38 +221,38 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -287,38 +286,38 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsGroupsResponse | None: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_groups/update_communications_group.py b/rootly_sdk/api/communications_groups/update_communications_group.py index 56751baf..d8ec28ec 100644 --- a/rootly_sdk/api/communications_groups/update_communications_group.py +++ b/rootly_sdk/api/communications_groups/update_communications_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/groups/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/create_communications_stage.py b/rootly_sdk/api/communications_stages/create_communications_stage.py index 9e90afde..6d610ff8 100644 --- a/rootly_sdk/api/communications_stages/create_communications_stage.py +++ b/rootly_sdk/api/communications_stages/create_communications_stage.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/delete_communications_stage.py b/rootly_sdk/api/communications_stages/delete_communications_stage.py index b5921be8..acee9e80 100644 --- a/rootly_sdk/api/communications_stages/delete_communications_stage.py +++ b/rootly_sdk/api/communications_stages/delete_communications_stage.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/stages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/stages/{id}", } return _kwargs @@ -66,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -97,7 +93,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -123,7 +119,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -152,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/get_communications_stage.py b/rootly_sdk/api/communications_stages/get_communications_stage.py index 477e0d9a..11af7837 100644 --- a/rootly_sdk/api/communications_stages/get_communications_stage.py +++ b/rootly_sdk/api/communications_stages/get_communications_stage.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/stages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/stages/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/list_communications_stages.py b/rootly_sdk/api/communications_stages/list_communications_stages.py index 174a6873..e68a79e0 100644 --- a/rootly_sdk/api/communications_stages/list_communications_stages.py +++ b/rootly_sdk/api/communications_stages/list_communications_stages.py @@ -11,18 +11,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -84,32 +83,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,32 +141,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsStagesResponse | None: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,32 +194,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,32 +250,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsStagesResponse | None: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_stages/update_communications_stage.py b/rootly_sdk/api/communications_stages/update_communications_stage.py index 13ed4698..0214d959 100644 --- a/rootly_sdk/api/communications_stages/update_communications_stage.py +++ b/rootly_sdk/api/communications_stages/update_communications_stage.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/stages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/stages/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/create_communications_template.py b/rootly_sdk/api/communications_templates/create_communications_template.py index 5c62ff97..6c67d411 100644 --- a/rootly_sdk/api/communications_templates/create_communications_template.py +++ b/rootly_sdk/api/communications_templates/create_communications_template.py @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return sync_detailed( @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/delete_communications_template.py b/rootly_sdk/api/communications_templates/delete_communications_template.py index 5750a7a4..d1ffce2e 100644 --- a/rootly_sdk/api/communications_templates/delete_communications_template.py +++ b/rootly_sdk/api/communications_templates/delete_communications_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/templates/{id}", } return _kwargs @@ -66,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -97,7 +93,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -123,7 +119,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -152,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/get_communications_template.py b/rootly_sdk/api/communications_templates/get_communications_template.py index 84eda309..f8d67d19 100644 --- a/rootly_sdk/api/communications_templates/get_communications_template.py +++ b/rootly_sdk/api/communications_templates/get_communications_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/templates/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/list_communications_templates.py b/rootly_sdk/api/communications_templates/list_communications_templates.py index 8d3f4fb0..a3161de8 100644 --- a/rootly_sdk/api/communications_templates/list_communications_templates.py +++ b/rootly_sdk/api/communications_templates/list_communications_templates.py @@ -11,19 +11,18 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -87,34 +86,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,34 +147,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsTemplatesResponse | None: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -204,34 +203,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,34 +262,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsTemplatesResponse | None: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_templates/update_communications_template.py b/rootly_sdk/api/communications_templates/update_communications_template.py index d3b3b5a0..5894b08a 100644 --- a/rootly_sdk/api/communications_templates/update_communications_template.py +++ b/rootly_sdk/api/communications_templates/update_communications_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/templates/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/create_communications_type.py b/rootly_sdk/api/communications_types/create_communications_type.py index 873b6e89..62e71775 100644 --- a/rootly_sdk/api/communications_types/create_communications_type.py +++ b/rootly_sdk/api/communications_types/create_communications_type.py @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return sync_detailed( @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/delete_communications_type.py b/rootly_sdk/api/communications_types/delete_communications_type.py index c14a941b..50705d45 100644 --- a/rootly_sdk/api/communications_types/delete_communications_type.py +++ b/rootly_sdk/api/communications_types/delete_communications_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/types/{id}", } return _kwargs @@ -66,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -97,7 +93,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -123,7 +119,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -152,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/get_communications_type.py b/rootly_sdk/api/communications_types/get_communications_type.py index 1326081e..6c3d3e3f 100644 --- a/rootly_sdk/api/communications_types/get_communications_type.py +++ b/rootly_sdk/api/communications_types/get_communications_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/types/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/list_communications_types.py b/rootly_sdk/api/communications_types/list_communications_types.py index fdbac8ae..1d7c6b9a 100644 --- a/rootly_sdk/api/communications_types/list_communications_types.py +++ b/rootly_sdk/api/communications_types/list_communications_types.py @@ -11,18 +11,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -84,32 +83,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,32 +141,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsTypesResponse | None: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,32 +194,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,32 +250,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CommunicationsTypesResponse | None: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_types/update_communications_type.py b/rootly_sdk/api/communications_types/update_communications_type.py index 7e463b14..cda47a9b 100644 --- a/rootly_sdk/api/communications_types/update_communications_type.py +++ b/rootly_sdk/api/communications_types/update_communications_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/types/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/create_custom_form.py b/rootly_sdk/api/custom_forms/create_custom_form.py index 3ce9ad7d..bbe174d9 100644 --- a/rootly_sdk/api/custom_forms/create_custom_form.py +++ b/rootly_sdk/api/custom_forms/create_custom_form.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/delete_custom_form.py b/rootly_sdk/api/custom_forms/delete_custom_form.py index 596f17a9..18759967 100644 --- a/rootly_sdk/api/custom_forms/delete_custom_form.py +++ b/rootly_sdk/api/custom_forms/delete_custom_form.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/custom_forms/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_forms/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/get_custom_form.py b/rootly_sdk/api/custom_forms/get_custom_form.py index bddf53a7..b6d6b985 100644 --- a/rootly_sdk/api/custom_forms/get_custom_form.py +++ b/rootly_sdk/api/custom_forms/get_custom_form.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_forms/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_forms/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/list_custom_forms.py b/rootly_sdk/api/custom_forms/list_custom_forms.py index 0308a583..d1dc7aa2 100644 --- a/rootly_sdk/api/custom_forms/list_custom_forms.py +++ b/rootly_sdk/api/custom_forms/list_custom_forms.py @@ -12,19 +12,18 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -93,41 +92,41 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CustomFormList | ErrorsList]: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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[CustomFormList | ErrorsList] + Response[Union[CustomFormList, ErrorsList]] """ kwargs = _get_kwargs( @@ -154,41 +153,41 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CustomFormList | ErrorsList | None: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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: - CustomFormList | ErrorsList + Union[CustomFormList, ErrorsList] """ return sync_detailed( @@ -210,41 +209,41 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CustomFormList | ErrorsList]: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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[CustomFormList | ErrorsList] + Response[Union[CustomFormList, ErrorsList]] """ kwargs = _get_kwargs( @@ -269,41 +268,41 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> CustomFormList | ErrorsList | None: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): 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: - CustomFormList | ErrorsList + Union[CustomFormList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/update_custom_form.py b/rootly_sdk/api/custom_forms/update_custom_form.py index 1b640d81..c5e1b259 100644 --- a/rootly_sdk/api/custom_forms/update_custom_form.py +++ b/rootly_sdk/api/custom_forms/update_custom_form.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateCustomForm, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/custom_forms/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_forms/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -110,7 +107,7 @@ def sync( Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -171,7 +168,7 @@ async def asyncio( Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py index 89a6b704..e1302e00 100644 --- a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboards/{dashboard_id}/panels".format( - dashboard_id=quote(str(dashboard_id), safe=""), - ), + "url": f"/v1/dashboards/{dashboard_id}/panels", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py index d630d717..9580cb4c 100644 --- a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/dashboard_panels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}", } return _kwargs diff --git a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py index 825e1ab8..ef54bcfd 100644 --- a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboard_panels/{id}/duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}/duplicate", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py index 9bee49b7..8fabc049 100644 --- a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( id: str, *, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["range"] = range_ @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/dashboard_panels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}", "params": params, } @@ -66,9 +62,9 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -76,9 +72,9 @@ def sync_detailed( Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,9 +102,9 @@ def sync( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> DashboardPanelResponse | None: """Retrieves a dashboard panel @@ -116,9 +112,9 @@ def sync( Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +137,9 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -151,9 +147,9 @@ async def asyncio_detailed( Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,9 +175,9 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> DashboardPanelResponse | None: """Retrieves a dashboard panel @@ -189,9 +185,9 @@ async def asyncio( Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py index d807646c..60d15e58 100644 --- a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py +++ b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( dashboard_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/dashboards/{dashboard_id}/panels".format( - dashboard_id=quote(str(dashboard_id), safe=""), - ), + "url": f"/v1/dashboards/{dashboard_id}/panels", "params": params, } @@ -64,9 +60,9 @@ def sync_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -74,9 +70,9 @@ def sync_detailed( Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +100,9 @@ def sync( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> DashboardPanelList | None: """List dashboard panels @@ -114,9 +110,9 @@ def sync( Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +135,9 @@ async def asyncio_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -149,9 +145,9 @@ async def asyncio_detailed( Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +173,9 @@ async def asyncio( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> DashboardPanelList | None: """List dashboard panels @@ -187,9 +183,9 @@ async def asyncio( Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py index 8c15920b..05914600 100644 --- a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/dashboard_panels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}", } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/dashboards/create_dashboard.py b/rootly_sdk/api/dashboards/create_dashboard.py index 32bb4589..aa3291f9 100644 --- a/rootly_sdk/api/dashboards/create_dashboard.py +++ b/rootly_sdk/api/dashboards/create_dashboard.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/delete_dashboard.py b/rootly_sdk/api/dashboards/delete_dashboard.py index e16a82d5..8d7d943a 100644 --- a/rootly_sdk/api/dashboards/delete_dashboard.py +++ b/rootly_sdk/api/dashboards/delete_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/dashboards/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/duplicate_dashboard.py b/rootly_sdk/api/dashboards/duplicate_dashboard.py index 2c874a17..ae8dfea4 100644 --- a/rootly_sdk/api/dashboards/duplicate_dashboard.py +++ b/rootly_sdk/api/dashboards/duplicate_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboards/{id}/duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}/duplicate", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/get_dashboard.py b/rootly_sdk/api/dashboards/get_dashboard.py index f20260b3..41389041 100644 --- a/rootly_sdk/api/dashboards/get_dashboard.py +++ b/rootly_sdk/api/dashboards/get_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - include: GetDashboardInclude | Unset = UNSET, + include: Unset | GetDashboardInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/dashboards/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}", "params": params, } @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, + include: Unset | GetDashboardInclude = UNSET, ) -> Response[DashboardResponse | ErrorsList]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, + include: Unset | GetDashboardInclude = UNSET, ) -> DashboardResponse | ErrorsList | None: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, + include: Unset | GetDashboardInclude = UNSET, ) -> Response[DashboardResponse | ErrorsList]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, + include: Unset | GetDashboardInclude = UNSET, ) -> DashboardResponse | ErrorsList | None: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/list_dashboards.py b/rootly_sdk/api/dashboards/list_dashboards.py index c0c41cd8..13665e62 100644 --- a/rootly_sdk/api/dashboards/list_dashboards.py +++ b/rootly_sdk/api/dashboards/list_dashboards.py @@ -12,14 +12,13 @@ def _get_kwargs( *, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -64,18 +63,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardList]: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,18 +100,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> DashboardList | None: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,18 +132,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardList]: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,18 +167,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> DashboardList | None: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/dashboards/set_default_dashboard.py b/rootly_sdk/api/dashboards/set_default_dashboard.py index 7cf3246d..d6fb3419 100644 --- a/rootly_sdk/api/dashboards/set_default_dashboard.py +++ b/rootly_sdk/api/dashboards/set_default_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboards/{id}/set_default".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}/set_default", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): 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[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): 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: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/update_dashboard.py b/rootly_sdk/api/dashboards/update_dashboard.py index 56ac6566..f1dab2cb 100644 --- a/rootly_sdk/api/dashboards/update_dashboard.py +++ b/rootly_sdk/api/dashboards/update_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateDashboard, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/dashboards/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -110,7 +107,7 @@ def sync( Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -171,7 +168,7 @@ async def asyncio( Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py index 65314afc..64fb8702 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/custom_fields/{custom_field_id}/options".format( - custom_field_id=quote(str(custom_field_id), safe=""), - ), + "url": f"/v1/custom_fields/{custom_field_id}/options", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py index 3968cd4d..331f1a0e 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/custom_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_field_options/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py index afdda05c..1f7ee239 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_field_options/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py b/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py index bca688b3..cec6b6d7 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py +++ b/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,13 +12,12 @@ def _get_kwargs( custom_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -36,9 +34,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_fields/{custom_field_id}/options".format( - custom_field_id=quote(str(custom_field_id), safe=""), - ), + "url": f"/v1/custom_fields/{custom_field_id}/options", "params": params, } @@ -72,11 +68,11 @@ def sync_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -84,11 +80,11 @@ def sync_detailed( Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -118,11 +114,11 @@ def sync( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> CustomFieldOptionList | None: """[DEPRECATED] List custom field options @@ -130,11 +126,11 @@ def sync( Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,11 +155,11 @@ async def asyncio_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -171,11 +167,11 @@ async def asyncio_detailed( Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,11 +199,11 @@ async def asyncio( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> CustomFieldOptionList | None: """[DEPRECATED] List custom field options @@ -215,11 +211,11 @@ async def asyncio( Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py index 394362f8..4f114d44 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/custom_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_field_options/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py index d4ca5660..d8545178 100644 --- a/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py index 9fa62894..3391f10e 100644 --- a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/custom_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_fields/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py index 3ee224fc..693eb8ff 100644 --- a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetCustomFieldInclude | Unset = UNSET, + include: Unset | GetCustomFieldInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_fields/{id}", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, + include: Unset | GetCustomFieldInclude = UNSET, ) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Retrieves a Custom Field @@ -81,14 +77,14 @@ def sync_detailed( Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): 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[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -107,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, + include: Unset | GetCustomFieldInclude = UNSET, ) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Retrieves a Custom Field @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): 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: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, + include: Unset | GetCustomFieldInclude = UNSET, ) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Retrieves a Custom Field @@ -144,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): 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[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, + include: Unset | GetCustomFieldInclude = UNSET, ) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Retrieves a Custom Field @@ -176,14 +172,14 @@ async def asyncio( Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): 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: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py index 3d059a21..c792fd54 100644 --- a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py +++ b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py @@ -13,45 +13,44 @@ def _get_kwargs( *, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -144,68 +143,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -256,68 +255,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> CustomFieldList | None: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -363,68 +362,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -473,68 +472,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> CustomFieldList | None: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py index 6c03fcb7..bd9635d7 100644 --- a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/custom_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_fields/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py index 656ce720..c8df48b9 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/custom_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/custom_field_selections", } _kwargs["json"] = body.to_dict() @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -124,7 +121,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -154,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py index b96d8ac0..649c250e 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_custom_field_selections/{id}", } return _kwargs @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py index 51ee55a3..2eb7fe16 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_custom_field_selections/{id}", } return _kwargs @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py index 5e6f60d6..d57c8279 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/custom_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/custom_field_selections", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentCustomFieldSelectionList | None: """[DEPRECATED] List incident custom field selections @@ -118,9 +114,9 @@ def sync( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentCustomFieldSelectionList | None: """[DEPRECATED] List incident custom field selections @@ -191,9 +187,9 @@ async def asyncio( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py index b94030b8..7269c699 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_custom_field_selections/{id}", } _kwargs["json"] = body.to_dict() @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -119,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -149,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -182,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py index 60ac3c5d..5e0751b7 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/custom_field_selections".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/custom_field_selections", } _kwargs["json"] = body.to_dict() @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -119,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -149,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -182,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py index c41ac11d..6a1c1aed 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_custom_field_selections/{id}", } return _kwargs @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py index 30f721e6..01b037e7 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_custom_field_selections/{id}", } return _kwargs @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py index 764381f7..b023d80d 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/custom_field_selections".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/custom_field_selections", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -78,9 +74,9 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> WorkflowCustomFieldSelectionList | None: """[DEPRECATED] List workflow custom field selections @@ -118,9 +114,9 @@ def sync( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> WorkflowCustomFieldSelectionList | None: """[DEPRECATED] List workflow custom field selections @@ -191,9 +187,9 @@ async def asyncio( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py index 5f683704..78517bb2 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_custom_field_selections/{id}", } _kwargs["json"] = body.to_dict() @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -119,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -149,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -182,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py index 2fab426e..29ca9bbd 100644 --- a/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py @@ -1,31 +1,27 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_edge_connector_action_body import CreateEdgeConnectorActionBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( edge_connector_id: str, *, - body: CreateEdgeConnectorActionBody | Unset = UNSET, + body: CreateEdgeConnectorActionBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/edge_connectors/{edge_connector_id}/actions".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -59,13 +55,13 @@ def sync_detailed( edge_connector_id: str, *, client: AuthenticatedClient, - body: CreateEdgeConnectorActionBody | Unset = UNSET, + body: CreateEdgeConnectorActionBody, ) -> Response[Any]: """Create edge connector action Args: edge_connector_id (str): - body (CreateEdgeConnectorActionBody | Unset): + body (CreateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -91,13 +87,13 @@ async def asyncio_detailed( edge_connector_id: str, *, client: AuthenticatedClient, - body: CreateEdgeConnectorActionBody | Unset = UNSET, + body: CreateEdgeConnectorActionBody, ) -> Response[Any]: """Create edge connector action Args: edge_connector_id (str): - body (CreateEdgeConnectorActionBody | Unset): + body (CreateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py index bcad29a3..5ec477b2 100644 --- a/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -12,15 +11,11 @@ def _get_kwargs( edge_connector_id: str, - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", } return _kwargs @@ -47,7 +42,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -55,7 +50,7 @@ def sync_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -79,7 +74,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -87,7 +82,7 @@ async def asyncio_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py index 35449bd3..880d1923 100644 --- a/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -12,15 +11,11 @@ def _get_kwargs( edge_connector_id: str, - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", } return _kwargs @@ -50,7 +45,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -58,7 +53,7 @@ def sync_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,7 +77,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -90,7 +85,7 @@ async def asyncio_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py index ac27ce42..28079f6d 100644 --- a/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py +++ b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( edge_connector_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/edge_connectors/{edge_connector_id}/actions".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions", } return _kwargs diff --git a/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py index 9be920e7..cf2b03a1 100644 --- a/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -8,27 +7,23 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.update_edge_connector_action_body import UpdateEdgeConnectorActionBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, - body: UpdateEdgeConnectorActionBody | Unset = UNSET, + body: UpdateEdgeConnectorActionBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -57,17 +52,17 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorActionBody | Unset = UNSET, + body: UpdateEdgeConnectorActionBody, ) -> Response[Any]: """Update edge connector action Args: edge_connector_id (str): - id (str | UUID): - body (UpdateEdgeConnectorActionBody | Unset): + id (Union[UUID, str]): + body (UpdateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -92,17 +87,17 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorActionBody | Unset = UNSET, + body: UpdateEdgeConnectorActionBody, ) -> Response[Any]: """Update edge connector action Args: edge_connector_id (str): - id (str | UUID): - body (UpdateEdgeConnectorActionBody | Unset): + id (Union[UUID, str]): + body (UpdateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connectors/create_edge_connector.py b/rootly_sdk/api/edge_connectors/create_edge_connector.py index 4fd4237e..31971c77 100644 --- a/rootly_sdk/api/edge_connectors/create_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/create_edge_connector.py @@ -6,12 +6,12 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_edge_connector_body import CreateEdgeConnectorBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( *, - body: CreateEdgeConnectorBody | Unset = UNSET, + body: CreateEdgeConnectorBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -20,8 +20,7 @@ def _get_kwargs( "url": "/v1/edge_connectors", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -54,12 +53,12 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - body: CreateEdgeConnectorBody | Unset = UNSET, + body: CreateEdgeConnectorBody, ) -> Response[Any]: """Create edge connector Args: - body (CreateEdgeConnectorBody | Unset): + body (CreateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -83,12 +82,12 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - body: CreateEdgeConnectorBody | Unset = UNSET, + body: CreateEdgeConnectorBody, ) -> Response[Any]: """Create edge connector Args: - body (CreateEdgeConnectorBody | Unset): + body (CreateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connectors/delete_edge_connector.py b/rootly_sdk/api/edge_connectors/delete_edge_connector.py index a289f349..7f472c71 100644 --- a/rootly_sdk/api/edge_connectors/delete_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/delete_edge_connector.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/edge_connectors/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{id}", } return _kwargs diff --git a/rootly_sdk/api/edge_connectors/get_edge_connector.py b/rootly_sdk/api/edge_connectors/get_edge_connector.py index ce73bfe0..b1667ef7 100644 --- a/rootly_sdk/api/edge_connectors/get_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/get_edge_connector.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/edge_connectors/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{id}", } return _kwargs diff --git a/rootly_sdk/api/edge_connectors/list_edge_connectors.py b/rootly_sdk/api/edge_connectors/list_edge_connectors.py index e24a0844..1e7b1c39 100644 --- a/rootly_sdk/api/edge_connectors/list_edge_connectors.py +++ b/rootly_sdk/api/edge_connectors/list_edge_connectors.py @@ -10,12 +10,11 @@ def _get_kwargs( *, - page: int | Unset = UNSET, - per_page: int | Unset = UNSET, - status: str | Unset = UNSET, - name: str | Unset = UNSET, + page: Unset | int = UNSET, + per_page: Unset | int = UNSET, + status: Unset | str = UNSET, + name: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page"] = page @@ -59,18 +58,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - page: int | Unset = UNSET, - per_page: int | Unset = UNSET, - status: str | Unset = UNSET, - name: str | Unset = UNSET, + page: Unset | int = UNSET, + per_page: Unset | int = UNSET, + status: Unset | str = UNSET, + name: Unset | str = UNSET, ) -> Response[Any]: """List edge connectors Args: - page (int | Unset): - per_page (int | Unset): - status (str | Unset): - name (str | Unset): + page (Union[Unset, int]): + per_page (Union[Unset, int]): + status (Union[Unset, str]): + name (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,18 +96,18 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - page: int | Unset = UNSET, - per_page: int | Unset = UNSET, - status: str | Unset = UNSET, - name: str | Unset = UNSET, + page: Unset | int = UNSET, + per_page: Unset | int = UNSET, + status: Unset | str = UNSET, + name: Unset | str = UNSET, ) -> Response[Any]: """List edge connectors Args: - page (int | Unset): - per_page (int | Unset): - status (str | Unset): - name (str | Unset): + page (Union[Unset, int]): + per_page (Union[Unset, int]): + status (Union[Unset, str]): + name (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connectors/update_edge_connector.py b/rootly_sdk/api/edge_connectors/update_edge_connector.py index df27a0bb..1c7b0e27 100644 --- a/rootly_sdk/api/edge_connectors/update_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/update_edge_connector.py @@ -1,31 +1,27 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx from ... import errors from ...client import AuthenticatedClient, Client from ...models.update_edge_connector_body import UpdateEdgeConnectorBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateEdgeConnectorBody | Unset = UNSET, + body: UpdateEdgeConnectorBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/edge_connectors/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -59,13 +55,13 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorBody | Unset = UNSET, + body: UpdateEdgeConnectorBody, ) -> Response[Any]: """Update edge connector Args: id (str): - body (UpdateEdgeConnectorBody | Unset): + body (UpdateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -91,13 +87,13 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorBody | Unset = UNSET, + body: UpdateEdgeConnectorBody, ) -> Response[Any]: """Update edge connector Args: id (str): - body (UpdateEdgeConnectorBody | Unset): + body (UpdateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/environments/bulk_delete_environments.py b/rootly_sdk/api/environments/bulk_delete_environments.py index 7a889981..26e40317 100644 --- a/rootly_sdk/api/environments/bulk_delete_environments.py +++ b/rootly_sdk/api/environments/bulk_delete_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/environments/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyEnvironmentsType0): _kwargs["json"] = body.to_dict() else: @@ -36,7 +37,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: +) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyEnvironmentsResponse.from_dict(response.json()) @@ -49,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyEnvironmentsResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -76,7 +77,7 @@ def _parse_response_422(data: object) -> BulkDestroyEnvironmentsResponse | Error def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: +) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,24 +89,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -122,24 +123,24 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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: - BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']] """ return sync_detailed( @@ -151,24 +152,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -183,24 +184,24 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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: - BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/environments/bulk_upsert_environments.py b/rootly_sdk/api/environments/bulk_upsert_environments.py index 32b2cd6c..8ad20328 100644 --- a/rootly_sdk/api/environments/bulk_upsert_environments.py +++ b/rootly_sdk/api/environments/bulk_upsert_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList | None: +) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertEnvironmentsResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertEnvironmentsError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertEnvironmentsError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> BulkUpsertEnvironmentsError | ErrorsLis def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: +) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: +) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList] + Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList | None: +) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList + Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: +) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList] + Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList | None: +) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList + Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/environments/create_environment.py b/rootly_sdk/api/environments/create_environment.py index a12a138c..caf794c0 100644 --- a/rootly_sdk/api/environments/create_environment.py +++ b/rootly_sdk/api/environments/create_environment.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/create_environment_catalog_property.py b/rootly_sdk/api/environments/create_environment_catalog_property.py index d3a415ba..2f99eba5 100644 --- a/rootly_sdk/api/environments/create_environment_catalog_property.py +++ b/rootly_sdk/api/environments/create_environment_catalog_property.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/delete_environment.py b/rootly_sdk/api/environments/delete_environment.py index 48221a57..ef4496ee 100644 --- a/rootly_sdk/api/environments/delete_environment.py +++ b/rootly_sdk/api/environments/delete_environment.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/environments/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/environments/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/get_environment.py b/rootly_sdk/api/environments/get_environment.py index 2fb16213..8481d2d2 100644 --- a/rootly_sdk/api/environments/get_environment.py +++ b/rootly_sdk/api/environments/get_environment.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/environments/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/environments/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/list_environment_catalog_properties.py b/rootly_sdk/api/environments/list_environment_catalog_properties.py index cb526165..6a882fc6 100644 --- a/rootly_sdk/api/environments/list_environment_catalog_properties.py +++ b/rootly_sdk/api/environments/list_environment_catalog_properties.py @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -97,34 +96,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +157,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +213,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +272,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/environments/list_environments.py b/rootly_sdk/api/environments/list_environments.py index 20855cd6..00547daa 100644 --- a/rootly_sdk/api/environments/list_environments.py +++ b/rootly_sdk/api/environments/list_environments.py @@ -11,32 +11,31 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -122,60 +121,60 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[EnvironmentList]: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,60 +221,60 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> EnvironmentList | None: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -317,60 +316,60 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[EnvironmentList]: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -415,60 +414,60 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> EnvironmentList | None: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/environments/update_environment.py b/rootly_sdk/api/environments/update_environment.py index 6e9348d0..9c168e2a 100644 --- a/rootly_sdk/api/environments/update_environment.py +++ b/rootly_sdk/api/environments/update_environment.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateEnvironment, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/environments/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/environments/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -110,7 +107,7 @@ def sync( Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -171,7 +168,7 @@ async def asyncio( Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/escalation_levels/delete_escalation_level.py b/rootly_sdk/api/escalation_levels/delete_escalation_level.py index 957eb67f..88675392 100644 --- a/rootly_sdk/api/escalation_levels/delete_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/delete_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/escalation_levels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_levels/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels/get_escalation_level.py b/rootly_sdk/api/escalation_levels/get_escalation_level.py index b8da372a..b60bf742 100644 --- a/rootly_sdk/api/escalation_levels/get_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/get_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_levels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_levels/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels/update_escalation_level.py b/rootly_sdk/api/escalation_levels/update_escalation_level.py index 880d0415..8a2a4146 100644 --- a/rootly_sdk/api/escalation_levels/update_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/update_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/escalation_levels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_levels/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py b/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py index 9527978d..cf7dcc78 100644 --- a/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py +++ b/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels".format( - escalation_policy_path_id=quote(str(escalation_policy_path_id), safe=""), - ), + "url": f"/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py b/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py index 362d2739..b5aa0f32 100644 --- a/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py +++ b/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( escalation_policy_path_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels".format( - escalation_policy_path_id=quote(str(escalation_policy_path_id), safe=""), - ), + "url": f"/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -78,9 +74,9 @@ def sync_detailed( Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Path @@ -118,9 +114,9 @@ def sync( Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Path @@ -191,9 +187,9 @@ async def asyncio( Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py index 4132bf34..98b5d182 100644 --- a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py +++ b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_levels".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_levels", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py index b6baf965..d0911eef 100644 --- a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py +++ b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( escalation_policy_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_levels".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_levels", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -78,9 +74,9 @@ def sync_detailed( Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Policy @@ -118,9 +114,9 @@ def sync( Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Policy @@ -191,9 +187,9 @@ async def asyncio( Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_paths/create_escalation_path.py b/rootly_sdk/api/escalation_paths/create_escalation_path.py index 169f479f..21f082d3 100644 --- a/rootly_sdk/api/escalation_paths/create_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/create_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_paths".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_paths", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_paths/delete_escalation_path.py b/rootly_sdk/api/escalation_paths/delete_escalation_path.py index 8162cca8..f7fd6f89 100644 --- a/rootly_sdk/api/escalation_paths/delete_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/delete_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/escalation_paths/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_paths/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_paths/get_escalation_path.py b/rootly_sdk/api/escalation_paths/get_escalation_path.py index 1735ff2f..98762af3 100644 --- a/rootly_sdk/api/escalation_paths/get_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/get_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetEscalationPathInclude | Unset = UNSET, + include: Unset | GetEscalationPathInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_paths/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_paths/{id}", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, + include: Unset | GetEscalationPathInclude = UNSET, ) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Retrieves an escalation path @@ -81,14 +77,14 @@ def sync_detailed( Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): 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[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -107,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, + include: Unset | GetEscalationPathInclude = UNSET, ) -> ErrorsList | EscalationPolicyPathResponse | None: """Retrieves an escalation path @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): 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: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, + include: Unset | GetEscalationPathInclude = UNSET, ) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Retrieves an escalation path @@ -144,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): 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[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, + include: Unset | GetEscalationPathInclude = UNSET, ) -> ErrorsList | EscalationPolicyPathResponse | None: """Retrieves an escalation path @@ -176,14 +172,14 @@ async def asyncio( Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): 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: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_paths/list_escalation_paths.py b/rootly_sdk/api/escalation_paths/list_escalation_paths.py index 43a4fcd8..117e1031 100644 --- a/rootly_sdk/api/escalation_paths/list_escalation_paths.py +++ b/rootly_sdk/api/escalation_paths/list_escalation_paths.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -17,21 +16,20 @@ def _get_kwargs( escalation_policy_id: str, *, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_filterpath_type: str | Unset = UNSET + json_filterpath_type: Unset | str = UNSET if not isinstance(filterpath_type, Unset): json_filterpath_type = filterpath_type @@ -45,9 +43,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_paths".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_paths", "params": params, } @@ -83,10 +79,10 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -94,10 +90,10 @@ def sync_detailed( Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,10 +122,10 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyPathList | None: """List escalation paths @@ -137,10 +133,10 @@ def sync( Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,10 +160,10 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -175,10 +171,10 @@ async def asyncio_detailed( Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -205,10 +201,10 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyPathList | None: """List escalation paths @@ -216,10 +212,10 @@ async def asyncio( Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_paths/update_escalation_path.py b/rootly_sdk/api/escalation_paths/update_escalation_path.py index ccbf345f..9187d4d9 100644 --- a/rootly_sdk/api/escalation_paths/update_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/update_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/escalation_paths/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_paths/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/create_escalation_policy.py b/rootly_sdk/api/escalation_policies/create_escalation_policy.py index 714b4503..74416a48 100644 --- a/rootly_sdk/api/escalation_policies/create_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/create_escalation_policy.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py index 2c40b934..e07ef4de 100644 --- a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/escalation_policies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_policies/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/get_escalation_policy.py b/rootly_sdk/api/escalation_policies/get_escalation_policy.py index e17a0ca0..c19bfb44 100644 --- a/rootly_sdk/api/escalation_policies/get_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/get_escalation_policy.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetEscalationPolicyInclude | Unset = UNSET, + include: Unset | GetEscalationPolicyInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_policies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_policies/{id}", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, + include: Unset | GetEscalationPolicyInclude = UNSET, ) -> Response[ErrorsList | EscalationPolicyResponse]: """Retrieves an escalation policy @@ -81,14 +77,14 @@ def sync_detailed( Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): 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[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -107,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, + include: Unset | GetEscalationPolicyInclude = UNSET, ) -> ErrorsList | EscalationPolicyResponse | None: """Retrieves an escalation policy @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): 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: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, + include: Unset | GetEscalationPolicyInclude = UNSET, ) -> Response[ErrorsList | EscalationPolicyResponse]: """Retrieves an escalation policy @@ -144,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): 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[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, + include: Unset | GetEscalationPolicyInclude = UNSET, ) -> ErrorsList | EscalationPolicyResponse | None: """Retrieves an escalation policy @@ -176,14 +172,14 @@ async def asyncio( Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): 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: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/list_escalation_policies.py b/rootly_sdk/api/escalation_policies/list_escalation_policies.py index 28e01db1..6d945707 100644 --- a/rootly_sdk/api/escalation_policies/list_escalation_policies.py +++ b/rootly_sdk/api/escalation_policies/list_escalation_policies.py @@ -14,29 +14,28 @@ def _get_kwargs( *, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -113,48 +112,48 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyList]: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,48 +194,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyList | None: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,48 +271,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyList]: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -352,48 +351,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> EscalationPolicyList | None: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_policies/update_escalation_policy.py b/rootly_sdk/api/escalation_policies/update_escalation_policy.py index d779d41b..11db6e82 100644 --- a/rootly_sdk/api/escalation_policies/update_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/update_escalation_policy.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/escalation_policies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_policies/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/create_form_field_option.py b/rootly_sdk/api/form_field_options/create_form_field_option.py index f403634b..292bf1c9 100644 --- a/rootly_sdk/api/form_field_options/create_form_field_option.py +++ b/rootly_sdk/api/form_field_options/create_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_fields/{form_field_id}/options".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/options", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/delete_form_field_option.py b/rootly_sdk/api/form_field_options/delete_form_field_option.py index 7475c4c1..b7ff0f29 100644 --- a/rootly_sdk/api/form_field_options/delete_form_field_option.py +++ b/rootly_sdk/api/form_field_options/delete_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_options/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/get_form_field_option.py b/rootly_sdk/api/form_field_options/get_form_field_option.py index 6b07adca..0cf1dfbc 100644 --- a/rootly_sdk/api/form_field_options/get_form_field_option.py +++ b/rootly_sdk/api/form_field_options/get_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_options/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/list_form_field_options.py b/rootly_sdk/api/form_field_options/list_form_field_options.py index 9acb8d0b..08cd3f56 100644 --- a/rootly_sdk/api/form_field_options/list_form_field_options.py +++ b/rootly_sdk/api/form_field_options/list_form_field_options.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,13 +12,12 @@ def _get_kwargs( form_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -36,9 +34,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{form_field_id}/options".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/options", "params": params, } @@ -70,11 +66,11 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -82,11 +78,11 @@ def sync_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,11 +112,11 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> FormFieldOptionList | None: """List FormField Options @@ -128,11 +124,11 @@ def sync( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,11 +153,11 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -169,11 +165,11 @@ async def asyncio_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,11 +197,11 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> FormFieldOptionList | None: """List FormField Options @@ -213,11 +209,11 @@ async def asyncio( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_options/update_form_field_option.py b/rootly_sdk/api/form_field_options/update_form_field_option.py index 246e39f3..80c84c48 100644 --- a/rootly_sdk/api/form_field_options/update_form_field_option.py +++ b/rootly_sdk/api/form_field_options/update_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_options/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py index 014965e1..11a876d3 100644 --- a/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_field_placements/{form_field_placement_id}/conditions".format( - form_field_placement_id=quote(str(form_field_placement_id), safe=""), - ), + "url": f"/v1/form_field_placements/{form_field_placement_id}/conditions", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py index 568253ab..39538b58 100644 --- a/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_placement_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placement_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py index 8d6e2170..5a711a1c 100644 --- a/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_placement_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placement_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py b/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py index 5730bb1d..b7b9946d 100644 --- a/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py +++ b/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_field_placement_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_placements/{form_field_placement_id}/conditions".format( - form_field_placement_id=quote(str(form_field_placement_id), safe=""), - ), + "url": f"/v1/form_field_placements/{form_field_placement_id}/conditions", "params": params, } @@ -71,10 +67,10 @@ def sync_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -82,10 +78,10 @@ def sync_detailed( Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,10 +110,10 @@ def sync( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> FormFieldPlacementConditionList | None: """List Form Set Conditions @@ -125,10 +121,10 @@ def sync( Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,10 +148,10 @@ async def asyncio_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -163,10 +159,10 @@ async def asyncio_detailed( Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,10 +189,10 @@ async def asyncio( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> FormFieldPlacementConditionList | None: """List Form Set Conditions @@ -204,10 +200,10 @@ async def asyncio( Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py index a9fe050c..66a45fc6 100644 --- a/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_placement_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placement_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/create_form_field_placement.py b/rootly_sdk/api/form_field_placements/create_form_field_placement.py index 247a26a7..6e198d96 100644 --- a/rootly_sdk/api/form_field_placements/create_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/create_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_fields/{form_field_id}/placements".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/placements", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/delete_form_field_placement.py b/rootly_sdk/api/form_field_placements/delete_form_field_placement.py index 424eeaa0..424e34e1 100644 --- a/rootly_sdk/api/form_field_placements/delete_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/delete_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_placements/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placements/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/get_form_field_placement.py b/rootly_sdk/api/form_field_placements/get_form_field_placement.py index 0d9e7d4e..18e171f2 100644 --- a/rootly_sdk/api/form_field_placements/get_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/get_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_placements/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placements/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/list_form_field_placements.py b/rootly_sdk/api/form_field_placements/list_form_field_placements.py index cfc35101..11bb34cc 100644 --- a/rootly_sdk/api/form_field_placements/list_form_field_placements.py +++ b/rootly_sdk/api/form_field_placements/list_form_field_placements.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{form_field_id}/placements".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/placements", "params": params, } @@ -69,10 +65,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -80,10 +76,10 @@ def sync_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,10 +108,10 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> FormFieldPlacementList | None: """List Form Field Placements @@ -123,10 +119,10 @@ def sync( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +146,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -161,10 +157,10 @@ async def asyncio_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,10 +187,10 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> FormFieldPlacementList | None: """List Form Field Placements @@ -202,10 +198,10 @@ async def asyncio( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_placements/update_form_field_placement.py b/rootly_sdk/api/form_field_placements/update_form_field_placement.py index 47e84275..87ff299a 100644 --- a/rootly_sdk/api/form_field_placements/update_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/update_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_placements/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placements/{id}", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/create_form_field_position.py b/rootly_sdk/api/form_field_positions/create_form_field_position.py index baa834ef..b4a5ccb1 100644 --- a/rootly_sdk/api/form_field_positions/create_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/create_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_fields/{form_field_id}/positions".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/positions", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/delete_form_field_position.py b/rootly_sdk/api/form_field_positions/delete_form_field_position.py index e4c0d5a2..c4649baf 100644 --- a/rootly_sdk/api/form_field_positions/delete_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/delete_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_positions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_positions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/get_form_field_position.py b/rootly_sdk/api/form_field_positions/get_form_field_position.py index 999abfae..c99f14ad 100644 --- a/rootly_sdk/api/form_field_positions/get_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/get_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_positions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_positions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/list_form_field_positions.py b/rootly_sdk/api/form_field_positions/list_form_field_positions.py index cb81b62a..d29efabe 100644 --- a/rootly_sdk/api/form_field_positions/list_form_field_positions.py +++ b/rootly_sdk/api/form_field_positions/list_form_field_positions.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{form_field_id}/positions".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/positions", "params": params, } @@ -69,10 +65,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -80,10 +76,10 @@ def sync_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,10 +108,10 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> FormFieldPositionList | None: """List FormField Position @@ -123,10 +119,10 @@ def sync( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +146,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -161,10 +157,10 @@ async def asyncio_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,10 +187,10 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> FormFieldPositionList | None: """List FormField Position @@ -202,10 +198,10 @@ async def asyncio( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_positions/update_form_field_position.py b/rootly_sdk/api/form_field_positions/update_form_field_position.py index 71c94ee0..8a906621 100644 --- a/rootly_sdk/api/form_field_positions/update_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/update_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_positions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_positions/{id}", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/create_form_field.py b/rootly_sdk/api/form_fields/create_form_field.py index c2069472..22ff4b11 100644 --- a/rootly_sdk/api/form_fields/create_form_field.py +++ b/rootly_sdk/api/form_fields/create_form_field.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/delete_form_field.py b/rootly_sdk/api/form_fields/delete_form_field.py index 40362583..7fd167da 100644 --- a/rootly_sdk/api/form_fields/delete_form_field.py +++ b/rootly_sdk/api/form_fields/delete_form_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_fields/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormFieldResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FormFieldResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormFieldResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FormFieldResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/get_form_field.py b/rootly_sdk/api/form_fields/get_form_field.py index b6fcd5f0..f491ac34 100644 --- a/rootly_sdk/api/form_fields/get_form_field.py +++ b/rootly_sdk/api/form_fields/get_form_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - include: GetFormFieldInclude | Unset = UNSET, + include: Unset | GetFormFieldInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_fields/{id}", "params": params, } @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, + include: Unset | GetFormFieldInclude = UNSET, ) -> Response[ErrorsList | FormFieldResponse]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): 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[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, + include: Unset | GetFormFieldInclude = UNSET, ) -> ErrorsList | FormFieldResponse | None: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): 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: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, + include: Unset | GetFormFieldInclude = UNSET, ) -> Response[ErrorsList | FormFieldResponse]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): 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[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, + include: Unset | GetFormFieldInclude = UNSET, ) -> ErrorsList | FormFieldResponse | None: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): 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: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/list_form_fields.py b/rootly_sdk/api/form_fields/list_form_fields.py index 737edc91..f41e79aa 100644 --- a/rootly_sdk/api/form_fields/list_form_fields.py +++ b/rootly_sdk/api/form_fields/list_form_fields.py @@ -12,39 +12,38 @@ def _get_kwargs( *, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -139,68 +138,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[FormFieldList]: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,68 +250,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> FormFieldList | None: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -358,68 +357,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[FormFieldList]: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -468,68 +467,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> FormFieldList | None: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_fields/update_form_field.py b/rootly_sdk/api/form_fields/update_form_field.py index 2aa102db..ea2f4249 100644 --- a/rootly_sdk/api/form_fields/update_form_field.py +++ b/rootly_sdk/api/form_fields/update_form_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateFormField, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_fields/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, @@ -110,7 +107,7 @@ def sync( Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, @@ -171,7 +168,7 @@ async def asyncio( Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/create_form_set_condition.py b/rootly_sdk/api/form_set_conditions/create_form_set_condition.py index 09e9bfec..6a3f278c 100644 --- a/rootly_sdk/api/form_set_conditions/create_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/create_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_sets/{form_set_id}/conditions".format( - form_set_id=quote(str(form_set_id), safe=""), - ), + "url": f"/v1/form_sets/{form_set_id}/conditions", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py b/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py index ba34efc2..9fe830e3 100644 --- a/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_set_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_set_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/get_form_set_condition.py b/rootly_sdk/api/form_set_conditions/get_form_set_condition.py index e84846b0..08b6d6aa 100644 --- a/rootly_sdk/api/form_set_conditions/get_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/get_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_set_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_set_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py b/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py index c12eaca5..8d9548f1 100644 --- a/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py +++ b/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_set_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_sets/{form_set_id}/conditions".format( - form_set_id=quote(str(form_set_id), safe=""), - ), + "url": f"/v1/form_sets/{form_set_id}/conditions", "params": params, } @@ -69,10 +65,10 @@ def sync_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -80,10 +76,10 @@ def sync_detailed( Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,10 +108,10 @@ def sync( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> FormSetConditionList | None: """List Form Set Conditions @@ -123,10 +119,10 @@ def sync( Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +146,10 @@ async def asyncio_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -161,10 +157,10 @@ async def asyncio_detailed( Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,10 +187,10 @@ async def asyncio( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> FormSetConditionList | None: """List Form Set Conditions @@ -202,10 +198,10 @@ async def asyncio( Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_set_conditions/update_form_set_condition.py b/rootly_sdk/api/form_set_conditions/update_form_set_condition.py index e1ad30f4..f0a6a415 100644 --- a/rootly_sdk/api/form_set_conditions/update_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/update_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_set_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_set_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/create_form_set.py b/rootly_sdk/api/form_sets/create_form_set.py index b1132cef..23414b97 100644 --- a/rootly_sdk/api/form_sets/create_form_set.py +++ b/rootly_sdk/api/form_sets/create_form_set.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/delete_form_set.py b/rootly_sdk/api/form_sets/delete_form_set.py index 8f5e77e5..9fe2a6fc 100644 --- a/rootly_sdk/api/form_sets/delete_form_set.py +++ b/rootly_sdk/api/form_sets/delete_form_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_sets/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/get_form_set.py b/rootly_sdk/api/form_sets/get_form_set.py index 6028ddb4..c1f524ab 100644 --- a/rootly_sdk/api/form_sets/get_form_set.py +++ b/rootly_sdk/api/form_sets/get_form_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_sets/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/list_form_sets.py b/rootly_sdk/api/form_sets/list_form_sets.py index 794d9d24..03441b76 100644 --- a/rootly_sdk/api/form_sets/list_form_sets.py +++ b/rootly_sdk/api/form_sets/list_form_sets.py @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -77,30 +76,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[FormSetList]: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +131,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> FormSetList | None: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +181,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[FormSetList]: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +234,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> FormSetList | None: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_sets/update_form_set.py b/rootly_sdk/api/form_sets/update_form_set.py index 1fd4b788..bb60765d 100644 --- a/rootly_sdk/api/form_sets/update_form_set.py +++ b/rootly_sdk/api/form_sets/update_form_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateFormSet, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_sets/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -110,7 +107,7 @@ def sync( Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -171,7 +168,7 @@ async def asyncio( Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py index 9889d1b6..19ab8b52 100644 --- a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py +++ b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/functionalities/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyFunctionalitiesType0): _kwargs["json"] = body.to_dict() else: @@ -36,7 +37,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: +) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyFunctionalitiesResponse.from_dict(response.json()) @@ -49,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyFunctionalitiesResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -76,7 +77,9 @@ def _parse_response_422(data: object) -> BulkDestroyFunctionalitiesResponse | Er def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: +) -> Response[ + BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,24 +91,26 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> Response[ + BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] +]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). 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[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -122,24 +127,24 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). 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: - BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']] """ return sync_detailed( @@ -151,24 +156,26 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> Response[ + BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] +]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). 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[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -183,24 +190,24 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). 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: - BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py index f2e88ac0..d194bfb1 100644 --- a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py +++ b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList | None: +) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertFunctionalitiesResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertFunctionalitiesError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertFunctionalitiesError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> BulkUpsertFunctionalitiesError | Errors def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: +) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: +) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList] + Response[Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList | None: +) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: +) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList] + Response[Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList | None: +) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/functionalities/create_functionality.py b/rootly_sdk/api/functionalities/create_functionality.py index 1f7ef099..182d32f4 100644 --- a/rootly_sdk/api/functionalities/create_functionality.py +++ b/rootly_sdk/api/functionalities/create_functionality.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/create_functionality_catalog_property.py b/rootly_sdk/api/functionalities/create_functionality_catalog_property.py index ffaecab2..1d2108e9 100644 --- a/rootly_sdk/api/functionalities/create_functionality_catalog_property.py +++ b/rootly_sdk/api/functionalities/create_functionality_catalog_property.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/functionalities/delete_functionality.py b/rootly_sdk/api/functionalities/delete_functionality.py index fe3cb866..8859e976 100644 --- a/rootly_sdk/api/functionalities/delete_functionality.py +++ b/rootly_sdk/api/functionalities/delete_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality.py b/rootly_sdk/api/functionalities/get_functionality.py index 746c5e60..18143e81 100644 --- a/rootly_sdk/api/functionalities/get_functionality.py +++ b/rootly_sdk/api/functionalities/get_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py index 0ebccfaf..26df4c9a 100644 --- a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, period: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/functionalities/{id}/incidents_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}/incidents_chart", "params": params, } @@ -66,7 +62,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -76,7 +72,7 @@ def sync_detailed( Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -84,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -100,7 +96,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -110,7 +106,7 @@ def sync( Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -118,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -139,7 +135,7 @@ async def asyncio_detailed( Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -147,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -161,7 +157,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -171,7 +167,7 @@ async def asyncio( Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -179,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py index 6fa744af..3ed7b9fd 100644 --- a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/functionalities/{id}/uptime_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}/uptime_chart", "params": params, } @@ -66,25 +62,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -100,25 +96,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return sync_detailed( @@ -129,25 +125,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -161,25 +157,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/list_functionalities.py b/rootly_sdk/api/functionalities/list_functionalities.py index d00ffd21..d0dc2cbf 100644 --- a/rootly_sdk/api/functionalities/list_functionalities.py +++ b/rootly_sdk/api/functionalities/list_functionalities.py @@ -11,31 +11,30 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -119,58 +118,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[FunctionalityList]: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -216,58 +215,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> FunctionalityList | None: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -308,58 +307,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[FunctionalityList]: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -403,58 +402,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> FunctionalityList | None: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py index 80b13adb..e5661399 100644 --- a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py +++ b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -97,34 +96,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +157,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +213,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +272,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/functionalities/update_functionality.py b/rootly_sdk/api/functionalities/update_functionality.py index 5098e9df..9806eae2 100644 --- a/rootly_sdk/api/functionalities/update_functionality.py +++ b/rootly_sdk/api/functionalities/update_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateFunctionality, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -110,7 +107,7 @@ def sync( Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -171,7 +168,7 @@ async def asyncio( Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/create_heartbeat.py b/rootly_sdk/api/heartbeats/create_heartbeat.py index c03eed95..04e60cb0 100644 --- a/rootly_sdk/api/heartbeats/create_heartbeat.py +++ b/rootly_sdk/api/heartbeats/create_heartbeat.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/delete_heartbeat.py b/rootly_sdk/api/heartbeats/delete_heartbeat.py index 674106f9..2e74ade2 100644 --- a/rootly_sdk/api/heartbeats/delete_heartbeat.py +++ b/rootly_sdk/api/heartbeats/delete_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/heartbeats/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/heartbeats/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/get_heartbeat.py b/rootly_sdk/api/heartbeats/get_heartbeat.py index 8ab9ac45..a18d703d 100644 --- a/rootly_sdk/api/heartbeats/get_heartbeat.py +++ b/rootly_sdk/api/heartbeats/get_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/heartbeats/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/heartbeats/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/list_heartbeats.py b/rootly_sdk/api/heartbeats/list_heartbeats.py index 19af7d67..585c0f32 100644 --- a/rootly_sdk/api/heartbeats/list_heartbeats.py +++ b/rootly_sdk/api/heartbeats/list_heartbeats.py @@ -11,18 +11,17 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -80,32 +79,32 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[HeartbeatList]: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,32 +137,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> HeartbeatList | None: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,32 +190,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[HeartbeatList]: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -247,32 +246,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> HeartbeatList | None: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/heartbeats/ping_heartbeat.py b/rootly_sdk/api/heartbeats/ping_heartbeat.py index 786ca9cc..557cc949 100644 --- a/rootly_sdk/api/heartbeats/ping_heartbeat.py +++ b/rootly_sdk/api/heartbeats/ping_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( heartbeat_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/heartbeats/{heartbeat_id}/ping".format( - heartbeat_id=quote(str(heartbeat_id), safe=""), - ), + "url": f"/v1/heartbeats/{heartbeat_id}/ping", } return _kwargs @@ -66,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -97,7 +93,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -123,7 +119,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -152,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/heartbeats/update_heartbeat.py b/rootly_sdk/api/heartbeats/update_heartbeat.py index 533b0dfb..76cd6f90 100644 --- a/rootly_sdk/api/heartbeats/update_heartbeat.py +++ b/rootly_sdk/api/heartbeats/update_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateHeartbeat, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/heartbeats/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/heartbeats/{id}", } _kwargs["json"] = body.to_dict() @@ -71,7 +68,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -81,7 +78,7 @@ def sync_detailed( Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -105,7 +102,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -115,7 +112,7 @@ def sync( Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -134,7 +131,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -144,7 +141,7 @@ async def asyncio_detailed( Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -152,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -166,7 +163,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -176,7 +173,7 @@ async def asyncio( Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -184,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/create_incident_action_item.py b/rootly_sdk/api/incident_action_items/create_incident_action_item.py index 8eefa46c..a8e52752 100644 --- a/rootly_sdk/api/incident_action_items/create_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/create_incident_action_item.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/action_items".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/action_items", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/delete_incident_action_item.py b/rootly_sdk/api/incident_action_items/delete_incident_action_item.py index 3c58343a..2ed1c40a 100644 --- a/rootly_sdk/api/incident_action_items/delete_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/delete_incident_action_item.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/action_items/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/action_items/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/get_incident_action_items.py b/rootly_sdk/api/incident_action_items/get_incident_action_items.py index 978d0899..6dd4bc1c 100644 --- a/rootly_sdk/api/incident_action_items/get_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/get_incident_action_items.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/action_items/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/action_items/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py b/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py index 9fdcf45a..0b566a8d 100644 --- a/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py @@ -11,44 +11,43 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -160,84 +159,84 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -296,84 +295,84 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentActionItemList | None: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -427,84 +426,84 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -561,84 +560,84 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentActionItemList | None: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_action_items/list_incident_action_items.py b/rootly_sdk/api/incident_action_items/list_incident_action_items.py index da0cf81e..9ea3c16e 100644 --- a/rootly_sdk/api/incident_action_items/list_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/list_incident_action_items.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/action_items".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/action_items", "params": params, } @@ -66,9 +62,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -76,9 +72,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,9 +102,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentActionItemList | None: """List incident action items @@ -116,9 +112,9 @@ def sync( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +137,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -151,9 +147,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,9 +175,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentActionItemList | None: """List incident action items @@ -189,9 +185,9 @@ async def asyncio( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_action_items/update_incident_action_item.py b/rootly_sdk/api/incident_action_items/update_incident_action_item.py index 709c5962..9c0b7bbf 100644 --- a/rootly_sdk/api/incident_action_items/update_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/update_incident_action_item.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/action_items/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/action_items/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py index 44067ca5..736aae39 100644 --- a/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/events/{incident_event_id}/functionalities".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/functionalities", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py index 31be22c6..fa9b8b75 100644 --- a/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_event_functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_functionalities/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py b/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py index 5b698657..bcbd76ae 100644 --- a/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py +++ b/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_event_functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_functionalities/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py b/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py index 805eeb7a..3676b424 100644 --- a/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py +++ b/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_event_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/events/{incident_event_id}/functionalities".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/functionalities", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentEventFunctionalityList | None: """List incident event functionalities @@ -118,9 +114,9 @@ def sync( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentEventFunctionalityList | None: """List incident event functionalities @@ -191,9 +187,9 @@ async def asyncio( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py index 3f2bf2b7..09b0e16e 100644 --- a/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_event_functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_functionalities/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/create_incident_event_service.py b/rootly_sdk/api/incident_event_services/create_incident_event_service.py index e1b7f48f..8cbda389 100644 --- a/rootly_sdk/api/incident_event_services/create_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/create_incident_event_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/events/{incident_event_id}/services".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/services", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/delete_incident_event_service.py b/rootly_sdk/api/incident_event_services/delete_incident_event_service.py index e4ce309c..ae2f92e5 100644 --- a/rootly_sdk/api/incident_event_services/delete_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/delete_incident_event_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_event_services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_services/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/get_incident_event_services.py b/rootly_sdk/api/incident_event_services/get_incident_event_services.py index 83c948c2..fc9396a8 100644 --- a/rootly_sdk/api/incident_event_services/get_incident_event_services.py +++ b/rootly_sdk/api/incident_event_services/get_incident_event_services.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_event_services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_services/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/list_incident_event_services.py b/rootly_sdk/api/incident_event_services/list_incident_event_services.py index 5087b62e..2301da6a 100644 --- a/rootly_sdk/api/incident_event_services/list_incident_event_services.py +++ b/rootly_sdk/api/incident_event_services/list_incident_event_services.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_event_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/events/{incident_event_id}/services".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/services", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentEventServiceList | None: """List incident event services @@ -118,9 +114,9 @@ def sync( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentEventServiceList | None: """List incident event services @@ -191,9 +187,9 @@ async def asyncio( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_event_services/update_incident_event_service.py b/rootly_sdk/api/incident_event_services/update_incident_event_service.py index 11e2528f..be5fe06a 100644 --- a/rootly_sdk/api/incident_event_services/update_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/update_incident_event_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_event_services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_services/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/create_incident_event.py b/rootly_sdk/api/incident_events/create_incident_event.py index 443576f9..218606b0 100644 --- a/rootly_sdk/api/incident_events/create_incident_event.py +++ b/rootly_sdk/api/incident_events/create_incident_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/events", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/delete_incident_event.py b/rootly_sdk/api/incident_events/delete_incident_event.py index 906602f5..9fda3db4 100644 --- a/rootly_sdk/api/incident_events/delete_incident_event.py +++ b/rootly_sdk/api/incident_events/delete_incident_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/events/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/get_incident_events.py b/rootly_sdk/api/incident_events/get_incident_events.py index 092a2816..df761f0d 100644 --- a/rootly_sdk/api/incident_events/get_incident_events.py +++ b/rootly_sdk/api/incident_events/get_incident_events.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/events/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/list_incident_events.py b/rootly_sdk/api/incident_events/list_incident_events.py index ddd02177..84b2c44f 100644 --- a/rootly_sdk/api/incident_events/list_incident_events.py +++ b/rootly_sdk/api/incident_events/list_incident_events.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/events", "params": params, } @@ -64,9 +60,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -74,9 +70,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +100,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentEventList | None: """List incident events @@ -114,9 +110,9 @@ def sync( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +135,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -149,9 +145,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +173,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentEventList | None: """List incident events @@ -187,9 +183,9 @@ async def asyncio( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_events/update_incident_event.py b/rootly_sdk/api/incident_events/update_incident_event.py index 6e364970..bc6dd20a 100644 --- a/rootly_sdk/api/incident_events/update_incident_event.py +++ b/rootly_sdk/api/incident_events/update_incident_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/events/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py index 3a29fbc2..6b3767bd 100644 --- a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/feedbacks".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/feedbacks", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return ( diff --git a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py index 6c834602..8e53814d 100644 --- a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/feedbacks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/feedbacks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return ( diff --git a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py index e9606100..3efafc21 100644 --- a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/feedbacks".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/feedbacks", "params": params, } @@ -66,9 +62,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -76,9 +72,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,9 +102,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentFeedbackList | None: """List incident feedbacks @@ -116,9 +112,9 @@ def sync( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +137,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -151,9 +147,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,9 +175,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentFeedbackList | None: """List incident feedbacks @@ -189,9 +185,9 @@ async def asyncio( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py index 95e97705..e23f16ea 100644 --- a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/feedbacks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/feedbacks/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py index a24a4d0c..acce98af 100644 --- a/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/form_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/form_field_selections", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py index e1158bcf..657ef26a 100644 --- a/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_form_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_form_field_selections/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py index 7649c119..73f16e1f 100644 --- a/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_form_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_form_field_selections/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py b/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py index 8da161a7..2cc3ecde 100644 --- a/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py +++ b/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/form_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/form_field_selections", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentFormFieldSelectionList | None: """List incident form field selections @@ -118,9 +114,9 @@ def sync( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentFormFieldSelectionList | None: """List incident form field selections @@ -191,9 +187,9 @@ async def asyncio( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py index 8d933d3b..bf3ff766 100644 --- a/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_form_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_form_field_selections/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py index b2923285..5ef2ca88 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/booleans".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/booleans", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py index 2597380c..d9af5506 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_permission_set_booleans/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_booleans/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py index fd412645..3d982670 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_set_booleans/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_booleans/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py b/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py index 4f640b28..19f86eaa 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py +++ b/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,17 +12,16 @@ def _get_kwargs( incident_permission_set_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -48,9 +46,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/booleans".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/booleans", "params": params, } @@ -86,15 +82,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -102,15 +98,15 @@ def sync_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,15 +140,15 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPermissionSetBooleanList | None: """List incident_permission_set_booleans @@ -160,15 +156,15 @@ def sync( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,15 +193,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -213,15 +209,15 @@ async def asyncio_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,15 +249,15 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPermissionSetBooleanList | None: """List incident_permission_set_booleans @@ -269,15 +265,15 @@ async def asyncio( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py index cd4630de..dfb06a52 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_permission_set_booleans/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_booleans/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py index 1c90322b..eed644e9 100644 --- a/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/resources".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/resources", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py index b0df5cea..509b5486 100644 --- a/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_permission_set_resources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_resources/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py index 3ecc6bcb..95a6d9f9 100644 --- a/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_set_resources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_resources/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py b/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py index 7be18300..d3468228 100644 --- a/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py +++ b/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,17 +12,16 @@ def _get_kwargs( incident_permission_set_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -48,9 +46,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/resources".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/resources", "params": params, } @@ -86,15 +82,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -102,15 +98,15 @@ def sync_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,15 +140,15 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPermissionSetResourceList | None: """List incident_permission_set_resources @@ -160,15 +156,15 @@ def sync( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,15 +193,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -213,15 +209,15 @@ async def asyncio_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,15 +249,15 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPermissionSetResourceList | None: """List incident_permission_set_resources @@ -269,15 +265,15 @@ async def asyncio( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py index 9448553c..836110ab 100644 --- a/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_permission_set_resources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_resources/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py index 72ee39ce..3ca7465c 100644 --- a/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py index e4a987ec..c918492e 100644 --- a/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_permission_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py index 6ceccff2..b04192d0 100644 --- a/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py b/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py index cd7a2c18..6d7617d7 100644 --- a/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py +++ b/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -87,34 +86,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,34 +147,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPermissionSetList | None: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -204,34 +203,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,34 +262,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPermissionSetList | None: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py index 32f42235..c3e19cac 100644 --- a/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateIncidentPermissionSet, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_permission_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -110,7 +107,7 @@ def sync( Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -171,7 +168,7 @@ async def asyncio( Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py b/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py index ab0153d1..f9ea28aa 100644 --- a/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py +++ b/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_retrospective_steps/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py b/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py index 8956c7c5..12aec1a9 100644 --- a/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py +++ b/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_retrospective_steps/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py index 1c183c5c..8aa4c16c 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py @@ -11,45 +11,44 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -163,86 +162,86 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -302,86 +301,86 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPostMortemList | None: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -436,86 +435,86 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -573,86 +572,86 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentPostMortemList | None: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py index 0914afba..44d0276b 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/post_mortems/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortems/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPostMortemResponse]: @@ -66,14 +62,14 @@ def sync_detailed( List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPostMortemResponse | None: @@ -97,14 +93,14 @@ def sync( List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPostMortemResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPostMortemResponse | None: @@ -152,14 +148,14 @@ async def asyncio( List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py index 226bb3b4..7eb66270 100644 --- a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateIncidentPostMortem, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/post_mortems/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortems/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, @@ -110,7 +107,7 @@ def sync( Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, @@ -171,7 +168,7 @@ async def asyncio( Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py index ee4e706e..855f016c 100644 --- a/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incident_roles/{incident_role_id}/incident_role_tasks".format( - incident_role_id=quote(str(incident_role_id), safe=""), - ), + "url": f"/v1/incident_roles/{incident_role_id}/incident_role_tasks", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py index d4271588..9fb114a0 100644 --- a/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_role_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_role_tasks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py index 8c240008..76609b7c 100644 --- a/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_role_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_role_tasks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py b/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py index c5d8a805..610fa1ef 100644 --- a/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py +++ b/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_role_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_roles/{incident_role_id}/incident_role_tasks".format( - incident_role_id=quote(str(incident_role_id), safe=""), - ), + "url": f"/v1/incident_roles/{incident_role_id}/incident_role_tasks", "params": params, } @@ -66,9 +62,9 @@ def sync_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -76,9 +72,9 @@ def sync_detailed( Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,9 +102,9 @@ def sync( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentRoleTaskList | None: """List incident role tasks @@ -116,9 +112,9 @@ def sync( Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +137,9 @@ async def asyncio_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -151,9 +147,9 @@ async def asyncio_detailed( Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,9 +175,9 @@ async def asyncio( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentRoleTaskList | None: """List incident role tasks @@ -189,9 +185,9 @@ async def asyncio( Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py index 0ab3fb0a..0ac5e71f 100644 --- a/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_role_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_role_tasks/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/create_incident_role.py b/rootly_sdk/api/incident_roles/create_incident_role.py index 6b747e39..a3244bb6 100644 --- a/rootly_sdk/api/incident_roles/create_incident_role.py +++ b/rootly_sdk/api/incident_roles/create_incident_role.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/delete_incident_role.py b/rootly_sdk/api/incident_roles/delete_incident_role.py index 82e614df..36721535 100644 --- a/rootly_sdk/api/incident_roles/delete_incident_role.py +++ b/rootly_sdk/api/incident_roles/delete_incident_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_roles/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/get_incident_role.py b/rootly_sdk/api/incident_roles/get_incident_role.py index 17763838..8ec86036 100644 --- a/rootly_sdk/api/incident_roles/get_incident_role.py +++ b/rootly_sdk/api/incident_roles/get_incident_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_roles/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/list_incident_roles.py b/rootly_sdk/api/incident_roles/list_incident_roles.py index 3d27e9e4..b3b19baa 100644 --- a/rootly_sdk/api/incident_roles/list_incident_roles.py +++ b/rootly_sdk/api/incident_roles/list_incident_roles.py @@ -11,31 +11,30 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -119,58 +118,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentRoleList]: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -216,58 +215,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentRoleList | None: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -308,58 +307,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentRoleList]: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -403,58 +402,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentRoleList | None: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_roles/update_incident_role.py b/rootly_sdk/api/incident_roles/update_incident_role.py index e9c102f3..d65d7d9c 100644 --- a/rootly_sdk/api/incident_roles/update_incident_role.py +++ b/rootly_sdk/api/incident_roles/update_incident_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateIncidentRole, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_roles/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -110,7 +107,7 @@ def sync( Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -171,7 +168,7 @@ async def asyncio( Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py index 8372e2da..f046af4c 100644 --- a/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/status-page-events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/status-page-events", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py index 8dd1c6e7..36058d66 100644 --- a/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/status-page-events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-page-events/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py b/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py index d7df3eea..eb52a159 100644 --- a/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py +++ b/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/status-page-events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-page-events/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py b/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py index e247949f..104d288b 100644 --- a/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py +++ b/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/status-page-events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/status-page-events", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentStatusPageEventList | None: """List incident status page events @@ -118,9 +114,9 @@ def sync( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> IncidentStatusPageEventList | None: """List incident status page events @@ -191,9 +187,9 @@ async def asyncio( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py index acd3ab5f..6b544116 100644 --- a/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/status-page-events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-page-events/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py index 005343b0..eff7cccb 100644 --- a/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/sub_statuses".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/sub_statuses", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return ( diff --git a/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py index d0ede7b9..a0050da0 100644 --- a/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_sub_statuses/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return ( diff --git a/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py index 8c79545a..e08c4dd9 100644 --- a/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,11 @@ def _get_kwargs( id: str, *, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -29,9 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_sub_statuses/{id}", "params": params, } @@ -67,7 +63,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -75,7 +71,7 @@ def sync_detailed( Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,7 +97,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> IncidentSubStatusResponse | None: """Retrieves incident_sub_status @@ -109,7 +105,7 @@ def sync( Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,7 +126,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -138,7 +134,7 @@ async def asyncio_detailed( Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,7 +158,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> IncidentSubStatusResponse | None: """Retrieves incident_sub_status @@ -170,7 +166,7 @@ async def asyncio( Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py b/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py index 9baf07e2..fb6483d6 100644 --- a/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py +++ b/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -17,26 +16,25 @@ def _get_kwargs( incident_id: str, *, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -60,9 +58,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/sub_statuses".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/sub_statuses", "params": params, } @@ -96,15 +92,15 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -112,15 +108,15 @@ def sync_detailed( Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,15 +150,15 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> IncidentSubStatusList | None: """List incident_sub_statuses @@ -170,15 +166,15 @@ def sync( Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,15 +203,15 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -223,15 +219,15 @@ async def asyncio_detailed( Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,15 +259,15 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> IncidentSubStatusList | None: """List incident_sub_statuses @@ -279,15 +275,15 @@ async def asyncio( Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py index a2e84f7f..767df1f8 100644 --- a/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_sub_statuses/{id}", } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/incident_types/create_incident_type.py b/rootly_sdk/api/incident_types/create_incident_type.py index d54679eb..850d7886 100644 --- a/rootly_sdk/api/incident_types/create_incident_type.py +++ b/rootly_sdk/api/incident_types/create_incident_type.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py b/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py index 7a8b50ab..2f4aed56 100644 --- a/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py +++ b/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/incident_types/delete_incident_type.py b/rootly_sdk/api/incident_types/delete_incident_type.py index c6f0addd..5318328f 100644 --- a/rootly_sdk/api/incident_types/delete_incident_type.py +++ b/rootly_sdk/api/incident_types/delete_incident_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_types/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incident_types/get_incident_type.py b/rootly_sdk/api/incident_types/get_incident_type.py index 598b47e2..48476201 100644 --- a/rootly_sdk/api/incident_types/get_incident_type.py +++ b/rootly_sdk/api/incident_types/get_incident_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_types/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py b/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py index 322d4536..b102ba96 100644 --- a/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py +++ b/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -97,34 +96,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +157,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +213,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +272,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_types/list_incident_types.py b/rootly_sdk/api/incident_types/list_incident_types.py index ba2eeaf3..461425b8 100644 --- a/rootly_sdk/api/incident_types/list_incident_types.py +++ b/rootly_sdk/api/incident_types/list_incident_types.py @@ -11,31 +11,30 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -119,58 +118,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentTypeList]: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -216,58 +215,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentTypeList | None: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -308,58 +307,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentTypeList]: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -403,58 +402,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> IncidentTypeList | None: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_types/update_incident_type.py b/rootly_sdk/api/incident_types/update_incident_type.py index 3df712c1..ba3f07cd 100644 --- a/rootly_sdk/api/incident_types/update_incident_type.py +++ b/rootly_sdk/api/incident_types/update_incident_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateIncidentType, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_types/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -110,7 +107,7 @@ def sync( Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -171,7 +168,7 @@ async def asyncio( Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incidents/add_subscribers_to_incident.py b/rootly_sdk/api/incidents/add_subscribers_to_incident.py index d652ab8a..28cc4647 100644 --- a/rootly_sdk/api/incidents/add_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/add_subscribers_to_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: AddSubscribers, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{id}/add_subscribers".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/add_subscribers", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, @@ -76,7 +73,7 @@ def sync_detailed( Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, @@ -110,7 +107,7 @@ def sync( Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, @@ -139,7 +136,7 @@ async def asyncio_detailed( Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, @@ -171,7 +168,7 @@ async def asyncio( Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/assign_user_to_incident.py b/rootly_sdk/api/incidents/assign_user_to_incident.py index 183ed7ec..85f5d763 100644 --- a/rootly_sdk/api/incidents/assign_user_to_incident.py +++ b/rootly_sdk/api/incidents/assign_user_to_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: AssignRoleToUser, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{id}/assign_role_to_user".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/assign_role_to_user", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -76,7 +73,7 @@ def sync_detailed( Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -110,7 +107,7 @@ def sync( Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -139,7 +136,7 @@ async def asyncio_detailed( Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -171,7 +168,7 @@ async def asyncio( Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/cancel_incident.py b/rootly_sdk/api/incidents/cancel_incident.py index acdcb056..127e505a 100644 --- a/rootly_sdk/api/incidents/cancel_incident.py +++ b/rootly_sdk/api/incidents/cancel_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: CancelIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/cancel".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/cancel", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, @@ -76,7 +73,7 @@ def sync_detailed( Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, @@ -110,7 +107,7 @@ def sync( Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, @@ -171,7 +168,7 @@ async def asyncio( Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/create_incident.py b/rootly_sdk/api/incidents/create_incident.py index 5e580107..8150ea17 100644 --- a/rootly_sdk/api/incidents/create_incident.py +++ b/rootly_sdk/api/incidents/create_incident.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/delete_incident.py b/rootly_sdk/api/incidents/delete_incident.py index 93326984..b39d249e 100644 --- a/rootly_sdk/api/incidents/delete_incident.py +++ b/rootly_sdk/api/incidents/delete_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incidents/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/detach_from_parent_incident.py b/rootly_sdk/api/incidents/detach_from_parent_incident.py index 97f2e681..071c3b5a 100644 --- a/rootly_sdk/api/incidents/detach_from_parent_incident.py +++ b/rootly_sdk/api/incidents/detach_from_parent_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/detach_from_parent".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/detach_from_parent", } return _kwargs @@ -61,7 +57,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -70,14 +66,14 @@ def sync_detailed( Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -92,7 +88,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -101,14 +97,14 @@ def sync( Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): 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 | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -127,14 +123,14 @@ async def asyncio_detailed( Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -147,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -156,14 +152,14 @@ async def asyncio( Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): 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 | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/get_incident.py b/rootly_sdk/api/incidents/get_incident.py index 60b93b84..86bea102 100644 --- a/rootly_sdk/api/incidents/get_incident.py +++ b/rootly_sdk/api/incidents/get_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - include: GetIncidentInclude | Unset = UNSET, + include: Unset | GetIncidentInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}", "params": params, } @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, + include: Unset | GetIncidentInclude = UNSET, ) -> Response[ErrorsList | IncidentResponse]: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): 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[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, + include: Unset | GetIncidentInclude = UNSET, ) -> ErrorsList | IncidentResponse | None: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): 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: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, + include: Unset | GetIncidentInclude = UNSET, ) -> Response[ErrorsList | IncidentResponse]: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): 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[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, + include: Unset | GetIncidentInclude = UNSET, ) -> ErrorsList | IncidentResponse | None: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): 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: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/list_incidents.py b/rootly_sdk/api/incidents/list_incidents.py index f320a9cc..d6bc8f16 100644 --- a/rootly_sdk/api/incidents/list_incidents.py +++ b/rootly_sdk/api/incidents/list_incidents.py @@ -14,171 +14,170 @@ def _get_kwargs( *, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[after]"] = pageafter @@ -503,13 +502,13 @@ def _get_kwargs( params["filter[team_names][not_in]"] = filterteam_namesnot_in - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -559,345 +558,345 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, ) -> Response[ErrorsList | IncidentList]: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): 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[ErrorsList | IncidentList] + Response[Union[ErrorsList, IncidentList]] """ kwargs = _get_kwargs( @@ -1076,345 +1075,345 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, ) -> ErrorsList | IncidentList | None: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): 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: - ErrorsList | IncidentList + Union[ErrorsList, IncidentList] """ return sync_detailed( @@ -1588,345 +1587,345 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, ) -> Response[ErrorsList | IncidentList]: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): 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[ErrorsList | IncidentList] + Response[Union[ErrorsList, IncidentList]] """ kwargs = _get_kwargs( @@ -2103,345 +2102,345 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, ) -> ErrorsList | IncidentList | None: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): 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: - ErrorsList | IncidentList + Union[ErrorsList, IncidentList] """ return ( diff --git a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py index e93e2b46..d6ed447d 100644 --- a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: ResolveIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/duplicate", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -76,7 +73,7 @@ def sync_detailed( Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -110,7 +107,7 @@ def sync( Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -171,7 +168,7 @@ async def asyncio( Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/mitigate_incident.py b/rootly_sdk/api/incidents/mitigate_incident.py index 4c713578..efb44525 100644 --- a/rootly_sdk/api/incidents/mitigate_incident.py +++ b/rootly_sdk/api/incidents/mitigate_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: MitigateIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/mitigate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/mitigate", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, @@ -76,7 +73,7 @@ def sync_detailed( Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, @@ -110,7 +107,7 @@ def sync( Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, @@ -171,7 +168,7 @@ async def asyncio( Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py index c86e1ec4..ae393430 100644 --- a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py +++ b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UnassignRoleFromUser, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incidents/{id}/unassign_role_from_user".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/unassign_role_from_user", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -76,7 +73,7 @@ def sync_detailed( Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -110,7 +107,7 @@ def sync( Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -139,7 +136,7 @@ async def asyncio_detailed( Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -171,7 +168,7 @@ async def asyncio( Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py index 0be005da..ba5666eb 100644 --- a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: RemoveSubscribers, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incidents/{id}/remove_subscribers".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/remove_subscribers", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -76,7 +73,7 @@ def sync_detailed( Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -110,7 +107,7 @@ def sync( Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -139,7 +136,7 @@ async def asyncio_detailed( Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -171,7 +168,7 @@ async def asyncio( Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/resolve_incident.py b/rootly_sdk/api/incidents/resolve_incident.py index 094ca943..690fa270 100644 --- a/rootly_sdk/api/incidents/resolve_incident.py +++ b/rootly_sdk/api/incidents/resolve_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: ResolveIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/resolve".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/resolve", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -76,7 +73,7 @@ def sync_detailed( Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -110,7 +107,7 @@ def sync( Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, @@ -171,7 +168,7 @@ async def asyncio( Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/restart_incident.py b/rootly_sdk/api/incidents/restart_incident.py index 45953fc9..7ff3aaca 100644 --- a/rootly_sdk/api/incidents/restart_incident.py +++ b/rootly_sdk/api/incidents/restart_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: RestartIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/restart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/restart", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, @@ -76,7 +73,7 @@ def sync_detailed( Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, @@ -110,7 +107,7 @@ def sync( Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, @@ -171,7 +168,7 @@ async def asyncio( Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/triage_incident.py b/rootly_sdk/api/incidents/triage_incident.py index 819bedd0..b70ba562 100644 --- a/rootly_sdk/api/incidents/triage_incident.py +++ b/rootly_sdk/api/incidents/triage_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: InTriageIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/in_triage".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/in_triage", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, @@ -76,7 +73,7 @@ def sync_detailed( Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, @@ -110,7 +107,7 @@ def sync( Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, @@ -171,7 +168,7 @@ async def asyncio( Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py index d5a053f8..3d1d9822 100644 --- a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/unmark_as_duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/unmark_as_duplicate", } return _kwargs @@ -61,7 +57,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -70,14 +66,14 @@ def sync_detailed( Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -92,7 +88,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -101,14 +97,14 @@ def sync( Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): 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 | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -127,14 +123,14 @@ async def asyncio_detailed( Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -147,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -156,14 +152,14 @@ async def asyncio( Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): 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 | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/update_incident.py b/rootly_sdk/api/incidents/update_incident.py index 470c044e..00521b61 100644 --- a/rootly_sdk/api/incidents/update_incident.py +++ b/rootly_sdk/api/incidents/update_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, @@ -110,7 +107,7 @@ def sync( Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, @@ -171,7 +168,7 @@ async def asyncio( Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/ip_ranges/get_ip_ranges.py b/rootly_sdk/api/ip_ranges/get_ip_ranges.py index 1c8c7d81..de282bf7 100644 --- a/rootly_sdk/api/ip_ranges/get_ip_ranges.py +++ b/rootly_sdk/api/ip_ranges/get_ip_ranges.py @@ -10,7 +10,6 @@ def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", "url": "/v1/ip_ranges", diff --git a/rootly_sdk/api/live_call_routers/create_live_call_router.py b/rootly_sdk/api/live_call_routers/create_live_call_router.py index 3411697b..e34f474e 100644 --- a/rootly_sdk/api/live_call_routers/create_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/create_live_call_router.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/live_call_routers/delete_live_call_router.py b/rootly_sdk/api/live_call_routers/delete_live_call_router.py index 599d3193..c4c1e7cc 100644 --- a/rootly_sdk/api/live_call_routers/delete_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/delete_live_call_router.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/live_call_routers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/live_call_routers/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py b/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py index f9a03d53..405a91e4 100644 --- a/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py @@ -20,7 +20,6 @@ def _get_kwargs( country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, ) -> dict[str, Any]: - params: dict[str, Any] = {} json_country_code: str = country_code @@ -84,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -118,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -147,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -179,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/live_call_routers/get_live_call_router.py b/rootly_sdk/api/live_call_routers/get_live_call_router.py index df6f8458..477a4a36 100644 --- a/rootly_sdk/api/live_call_routers/get_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/get_live_call_router.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/live_call_routers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/live_call_routers/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/live_call_routers/list_live_call_routers.py b/rootly_sdk/api/live_call_routers/list_live_call_routers.py index fe5ad768..3725a19e 100644 --- a/rootly_sdk/api/live_call_routers/list_live_call_routers.py +++ b/rootly_sdk/api/live_call_routers/list_live_call_routers.py @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -83,34 +82,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,34 +143,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> LiveCallRouterList | None: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,34 +199,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,34 +258,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> LiveCallRouterList | None: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/live_call_routers/update_live_call_router.py b/rootly_sdk/api/live_call_routers/update_live_call_router.py index 8fd9e6f4..41e988ce 100644 --- a/rootly_sdk/api/live_call_routers/update_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/update_live_call_router.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/live_call_routers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/live_call_routers/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py index 567609c4..bf134334 100644 --- a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -16,12 +15,11 @@ def _get_kwargs( incident_id: str, *, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, + platform: Unset | CreateMeetingRecordingPlatform = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_platform: str | Unset = UNSET + json_platform: Unset | str = UNSET if not isinstance(platform, Unset): json_platform = platform @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/meeting_recordings".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/meeting_recordings", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, + platform: Unset | CreateMeetingRecordingPlatform = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Create meeting recording @@ -83,14 +79,14 @@ def sync_detailed( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -109,7 +105,7 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, + platform: Unset | CreateMeetingRecordingPlatform = UNSET, ) -> Any | MeetingRecordingResponse | None: """Create meeting recording @@ -119,14 +115,14 @@ def sync( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): 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 | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -140,7 +136,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, + platform: Unset | CreateMeetingRecordingPlatform = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Create meeting recording @@ -150,14 +146,14 @@ async def asyncio_detailed( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -174,7 +170,7 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, + platform: Unset | CreateMeetingRecordingPlatform = UNSET, ) -> Any | MeetingRecordingResponse | None: """Create meeting recording @@ -184,14 +180,14 @@ async def asyncio( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): 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 | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py index d1b80dd8..80104322 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/meeting_recordings/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}", } return _kwargs @@ -71,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -160,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py index b673907a..eb3a7026 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/meeting_recordings/{id}/delete_video".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/delete_video", } return _kwargs @@ -71,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -160,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py index 92892c14..7b359c18 100644 --- a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -12,12 +11,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/meeting_recordings/{id}/delete_session".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/delete_session", } return _kwargs diff --git a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py index a32f12ff..c6427f71 100644 --- a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -14,12 +13,11 @@ def _get_kwargs( id: str, *, - include: GetMeetingRecordingInclude | Unset = UNSET, + include: Unset | GetMeetingRecordingInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -29,9 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/meeting_recordings/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}", "params": params, } @@ -71,7 +67,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, + include: Unset | GetMeetingRecordingInclude = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Get a meeting recording @@ -80,14 +76,14 @@ def sync_detailed( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -106,7 +102,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, + include: Unset | GetMeetingRecordingInclude = UNSET, ) -> Any | MeetingRecordingResponse | None: """Get a meeting recording @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): 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 | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, + include: Unset | GetMeetingRecordingInclude = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Get a meeting recording @@ -145,14 +141,14 @@ async def asyncio_detailed( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -169,7 +165,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, + include: Unset | GetMeetingRecordingInclude = UNSET, ) -> Any | MeetingRecordingResponse | None: """Get a meeting recording @@ -178,14 +174,14 @@ async def asyncio( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): 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 | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py index 121345b4..2eac11ac 100644 --- a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -8,25 +7,22 @@ from ...client import AuthenticatedClient, Client from ...models.import_meeting_recording import ImportMeetingRecording from ...models.meeting_recording_response import MeetingRecordingResponse -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( incident_id: str, *, - body: ImportMeetingRecording | Unset = UNSET, + body: ImportMeetingRecording, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/meeting_recordings/import".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/meeting_recordings/import", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -67,7 +63,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, + body: ImportMeetingRecording, ) -> Response[Any | MeetingRecordingResponse]: """Import a meeting recording @@ -78,14 +74,14 @@ def sync_detailed( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -104,7 +100,7 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, + body: ImportMeetingRecording, ) -> Any | MeetingRecordingResponse | None: """Import a meeting recording @@ -115,14 +111,14 @@ def sync( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): 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 | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, + body: ImportMeetingRecording, ) -> Response[Any | MeetingRecordingResponse]: """Import a meeting recording @@ -147,14 +143,14 @@ async def asyncio_detailed( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -171,7 +167,7 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, + body: ImportMeetingRecording, ) -> Any | MeetingRecordingResponse | None: """Import a meeting recording @@ -182,14 +178,14 @@ async def asyncio( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): 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 | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py index 1e6a2067..a1766945 100644 --- a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/leave".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/leave", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -133,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py index 65341cd2..728c67b1 100644 --- a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py @@ -11,11 +11,10 @@ def _get_kwargs( *, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["status"] = status @@ -61,9 +60,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -72,9 +71,9 @@ def sync_detailed( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +99,9 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> MeetingRecordingList | None: """List all meeting recordings @@ -111,9 +110,9 @@ def sync( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,9 +133,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -145,9 +144,9 @@ async def asyncio_detailed( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,9 +170,9 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> MeetingRecordingList | None: """List all meeting recordings @@ -182,9 +181,9 @@ async def asyncio( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py index 891b4d58..834d62fc 100644 --- a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,10 +12,9 @@ def _get_kwargs( incident_id: str, *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -27,9 +25,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/meeting_recordings".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/meeting_recordings", "params": params, } @@ -69,8 +65,8 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[Any | MeetingRecordingList]: """List meeting recordings @@ -79,15 +75,15 @@ def sync_detailed( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingList] + Response[Union[Any, MeetingRecordingList]] """ kwargs = _get_kwargs( @@ -107,8 +103,8 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Any | MeetingRecordingList | None: """List meeting recordings @@ -117,15 +113,15 @@ def sync( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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 | MeetingRecordingList + Union[Any, MeetingRecordingList] """ return sync_detailed( @@ -140,8 +136,8 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[Any | MeetingRecordingList]: """List meeting recordings @@ -150,15 +146,15 @@ async def asyncio_detailed( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingList] + Response[Union[Any, MeetingRecordingList]] """ kwargs = _get_kwargs( @@ -176,8 +172,8 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Any | MeetingRecordingList | None: """List meeting recordings @@ -186,15 +182,15 @@ async def asyncio( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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 | MeetingRecordingList + Union[Any, MeetingRecordingList] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py index ad7f07dc..85dce15f 100644 --- a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/pause".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/pause", } return _kwargs @@ -71,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -160,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py index 867ec697..f1370763 100644 --- a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/resume".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/resume", } return _kwargs @@ -70,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -101,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -127,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -156,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/start_recording_session.py b/rootly_sdk/api/meeting_recordings/start_recording_session.py index 21addcf5..0c4149b1 100644 --- a/rootly_sdk/api/meeting_recordings/start_recording_session.py +++ b/rootly_sdk/api/meeting_recordings/start_recording_session.py @@ -7,12 +7,12 @@ from ...client import AuthenticatedClient, Client from ...models.start_session_request import StartSessionRequest from ...models.start_session_response import StartSessionResponse -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( *, - body: StartSessionRequest | Unset = UNSET, + body: StartSessionRequest, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -21,8 +21,7 @@ def _get_kwargs( "url": "/v1/meeting_recordings/start_session", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -62,7 +61,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, + body: StartSessionRequest, ) -> Response[Any | StartSessionResponse]: """Start a recording session @@ -71,14 +70,14 @@ def sync_detailed( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | StartSessionResponse] + Response[Union[Any, StartSessionResponse]] """ kwargs = _get_kwargs( @@ -95,7 +94,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, + body: StartSessionRequest, ) -> Any | StartSessionResponse | None: """Start a recording session @@ -104,14 +103,14 @@ def sync( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): 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 | StartSessionResponse + Union[Any, StartSessionResponse] """ return sync_detailed( @@ -123,7 +122,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, + body: StartSessionRequest, ) -> Response[Any | StartSessionResponse]: """Start a recording session @@ -132,14 +131,14 @@ async def asyncio_detailed( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | StartSessionResponse] + Response[Union[Any, StartSessionResponse]] """ kwargs = _get_kwargs( @@ -154,7 +153,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, + body: StartSessionRequest, ) -> Any | StartSessionResponse | None: """Start a recording session @@ -163,14 +162,14 @@ async def asyncio( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): 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 | StartSessionResponse + Union[Any, StartSessionResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py index 4b59b83a..6254c41e 100644 --- a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/stop".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/stop", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -133,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py index cf078832..983d83f1 100644 --- a/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py index e367d8f4..99a0722e 100644 --- a/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,9 +13,8 @@ def _get_kwargs( id: str, *, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -25,9 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/on_call_pay_reports/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_pay_reports/{id}", "params": params, } @@ -68,7 +64,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> Response[ErrorsList | OnCallPayReportResponse]: """Retrieves an On-Call Pay Report @@ -76,14 +72,14 @@ def sync_detailed( Args: id (str): - include (str | Unset): + include (Union[Unset, str]): 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[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -102,7 +98,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> ErrorsList | OnCallPayReportResponse | None: """Retrieves an On-Call Pay Report @@ -110,14 +106,14 @@ def sync( Args: id (str): - include (str | Unset): + include (Union[Unset, str]): 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: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -131,7 +127,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> Response[ErrorsList | OnCallPayReportResponse]: """Retrieves an On-Call Pay Report @@ -139,14 +135,14 @@ async def asyncio_detailed( Args: id (str): - include (str | Unset): + include (Union[Unset, str]): 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[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, + include: Unset | str = UNSET, ) -> ErrorsList | OnCallPayReportResponse | None: """Retrieves an On-Call Pay Report @@ -171,14 +167,14 @@ async def asyncio( Args: id (str): - include (str | Unset): + include (Union[Unset, str]): 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: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py b/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py index b365e4b4..787eb8cf 100644 --- a/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py +++ b/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py @@ -11,16 +11,15 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -74,28 +73,28 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,28 +125,28 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> OnCallPayReportList | None: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,28 +172,28 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -223,28 +222,28 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> OnCallPayReportList | None: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py index a1d72c27..759b2879 100644 --- a/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/on_call_pay_reports/{id}/regenerate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_pay_reports/{id}/regenerate", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py index 7939e005..b65dc22c 100644 --- a/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/on_call_pay_reports/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_pay_reports/{id}", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/create_on_call_role.py b/rootly_sdk/api/on_call_roles/create_on_call_role.py index 322f9107..5ad769b9 100644 --- a/rootly_sdk/api/on_call_roles/create_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/create_on_call_role.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/delete_on_call_role.py b/rootly_sdk/api/on_call_roles/delete_on_call_role.py index 3fe85371..e01d7f37 100644 --- a/rootly_sdk/api/on_call_roles/delete_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/delete_on_call_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/on_call_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_roles/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/get_on_call_role.py b/rootly_sdk/api/on_call_roles/get_on_call_role.py index b58a3457..c796b0f9 100644 --- a/rootly_sdk/api/on_call_roles/get_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/get_on_call_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/on_call_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_roles/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/list_on_call_roles.py b/rootly_sdk/api/on_call_roles/list_on_call_roles.py index cee91de5..8b175ca8 100644 --- a/rootly_sdk/api/on_call_roles/list_on_call_roles.py +++ b/rootly_sdk/api/on_call_roles/list_on_call_roles.py @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -83,34 +82,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,34 +143,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> OnCallRoleList | None: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,34 +199,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,34 +258,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> OnCallRoleList | None: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/on_call_roles/update_on_call_role.py b/rootly_sdk/api/on_call_roles/update_on_call_role.py index 9fc73101..97cfb572 100644 --- a/rootly_sdk/api/on_call_roles/update_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/update_on_call_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/on_call_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_roles/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py index e1038ade..06292c4b 100644 --- a/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/on_call_shadows".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/on_call_shadows", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py index 3892b844..33c9d5e0 100644 --- a/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/on_call_shadows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_shadows/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py b/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py index 310cdcf4..4f6a4101 100644 --- a/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py +++ b/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/on_call_shadows".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/on_call_shadows", "params": params, } @@ -64,9 +60,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -74,9 +70,9 @@ def sync_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +100,9 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> OnCallShadowsList | None: """List On Call Shadows for Shift @@ -114,9 +110,9 @@ def sync( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +135,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -149,9 +145,9 @@ async def asyncio_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +173,9 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> OnCallShadowsList | None: """List On Call Shadows for Shift @@ -187,9 +183,9 @@ async def asyncio( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py index cbaeedb7..c053d8a2 100644 --- a/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/on_call_shadows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_shadows/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/on_calls/list_oncalls.py b/rootly_sdk/api/on_calls/list_oncalls.py index 4d9fca2e..3429aedd 100644 --- a/rootly_sdk/api/on_calls/list_oncalls.py +++ b/rootly_sdk/api/on_calls/list_oncalls.py @@ -13,22 +13,21 @@ def _get_kwargs( *, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -103,17 +102,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, ) -> Response[ErrorsList | OncallList]: """List on-calls @@ -121,24 +120,24 @@ def sync_detailed( Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): 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[ErrorsList | OncallList] + Response[Union[ErrorsList, OncallList]] """ kwargs = _get_kwargs( @@ -165,17 +164,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, ) -> ErrorsList | OncallList | None: """List on-calls @@ -183,24 +182,24 @@ def sync( Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): 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: - ErrorsList | OncallList + Union[ErrorsList, OncallList] """ return sync_detailed( @@ -222,17 +221,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, ) -> Response[ErrorsList | OncallList]: """List on-calls @@ -240,24 +239,24 @@ async def asyncio_detailed( Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): 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[ErrorsList | OncallList] + Response[Union[ErrorsList, OncallList]] """ kwargs = _get_kwargs( @@ -282,17 +281,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, ) -> ErrorsList | OncallList | None: """List on-calls @@ -300,24 +299,24 @@ async def asyncio( Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): 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: - ErrorsList | OncallList + Union[ErrorsList, OncallList] """ return ( diff --git a/rootly_sdk/api/override_shifts/create_override_shift.py b/rootly_sdk/api/override_shifts/create_override_shift.py index ec336dd4..53a40917 100644 --- a/rootly_sdk/api/override_shifts/create_override_shift.py +++ b/rootly_sdk/api/override_shifts/create_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/override_shifts".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/override_shifts", } _kwargs["json"] = body.to_dict() @@ -96,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -133,7 +130,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -165,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -200,7 +197,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py index ee1f2e0d..5c08cc93 100644 --- a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py +++ b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/on_call_shadows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_shadows/{id}", } return _kwargs @@ -78,7 +74,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -110,7 +106,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -137,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -167,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/delete_override_shift.py b/rootly_sdk/api/override_shifts/delete_override_shift.py index 200bc1a1..cb4a3e9c 100644 --- a/rootly_sdk/api/override_shifts/delete_override_shift.py +++ b/rootly_sdk/api/override_shifts/delete_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/override_shifts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/override_shifts/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/get_override_shift.py b/rootly_sdk/api/override_shifts/get_override_shift.py index 1116f33d..945033d2 100644 --- a/rootly_sdk/api/override_shifts/get_override_shift.py +++ b/rootly_sdk/api/override_shifts/get_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/override_shifts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/override_shifts/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/list_override_shifts.py b/rootly_sdk/api/override_shifts/list_override_shifts.py index 8370ff93..778a806c 100644 --- a/rootly_sdk/api/override_shifts/list_override_shifts.py +++ b/rootly_sdk/api/override_shifts/list_override_shifts.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/override_shifts".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/override_shifts", "params": params, } @@ -64,9 +60,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -74,9 +70,9 @@ def sync_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +100,9 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> OverrideShiftList | None: """List override shifts @@ -114,9 +110,9 @@ def sync( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +135,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -149,9 +145,9 @@ async def asyncio_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +173,9 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> OverrideShiftList | None: """List override shifts @@ -187,9 +183,9 @@ async def asyncio( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/override_shifts/update_override_shift.py b/rootly_sdk/api/override_shifts/update_override_shift.py index 3f692427..1d51fe99 100644 --- a/rootly_sdk/api/override_shifts/update_override_shift.py +++ b/rootly_sdk/api/override_shifts/update_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/override_shifts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/override_shifts/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/create_playbook_task.py b/rootly_sdk/api/playbook_tasks/create_playbook_task.py index 4589a663..1d183cf4 100644 --- a/rootly_sdk/api/playbook_tasks/create_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/create_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/playbooks/{playbook_id}/playbook_tasks".format( - playbook_id=quote(str(playbook_id), safe=""), - ), + "url": f"/v1/playbooks/{playbook_id}/playbook_tasks", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py index 9c9328d4..6b25e8b3 100644 --- a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/playbook_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbook_tasks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/get_playbook_task.py b/rootly_sdk/api/playbook_tasks/get_playbook_task.py index 415605da..1caa8d23 100644 --- a/rootly_sdk/api/playbook_tasks/get_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/get_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/playbook_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbook_tasks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py index cc9e0fa2..7c9aad1c 100644 --- a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py +++ b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( playbook_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/playbooks/{playbook_id}/playbook_tasks".format( - playbook_id=quote(str(playbook_id), safe=""), - ), + "url": f"/v1/playbooks/{playbook_id}/playbook_tasks", "params": params, } @@ -64,9 +60,9 @@ def sync_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -74,9 +70,9 @@ def sync_detailed( Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +100,9 @@ def sync( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PlaybookTaskList | None: """List playbook tasks @@ -114,9 +110,9 @@ def sync( Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +135,9 @@ async def asyncio_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -149,9 +145,9 @@ async def asyncio_detailed( Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +173,9 @@ async def asyncio( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PlaybookTaskList | None: """List playbook tasks @@ -187,9 +183,9 @@ async def asyncio( Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/playbook_tasks/update_playbook_task.py b/rootly_sdk/api/playbook_tasks/update_playbook_task.py index b84699b6..11903b62 100644 --- a/rootly_sdk/api/playbook_tasks/update_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/update_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/playbook_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbook_tasks/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/create_playbook.py b/rootly_sdk/api/playbooks/create_playbook.py index cee3273e..ca3ebc8c 100644 --- a/rootly_sdk/api/playbooks/create_playbook.py +++ b/rootly_sdk/api/playbooks/create_playbook.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/delete_playbook.py b/rootly_sdk/api/playbooks/delete_playbook.py index f666eef3..5ef76845 100644 --- a/rootly_sdk/api/playbooks/delete_playbook.py +++ b/rootly_sdk/api/playbooks/delete_playbook.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/playbooks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbooks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/get_playbook.py b/rootly_sdk/api/playbooks/get_playbook.py index 7faea0c0..8d8dcb9c 100644 --- a/rootly_sdk/api/playbooks/get_playbook.py +++ b/rootly_sdk/api/playbooks/get_playbook.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetPlaybookInclude | Unset = UNSET, + include: Unset | GetPlaybookInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/playbooks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbooks/{id}", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, + include: Unset | GetPlaybookInclude = UNSET, ) -> Response[ErrorsList | PlaybookResponse]: """Retrieves a playbook @@ -81,14 +77,14 @@ def sync_detailed( Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): 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[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -107,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, + include: Unset | GetPlaybookInclude = UNSET, ) -> ErrorsList | PlaybookResponse | None: """Retrieves a playbook @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): 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: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, + include: Unset | GetPlaybookInclude = UNSET, ) -> Response[ErrorsList | PlaybookResponse]: """Retrieves a playbook @@ -144,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): 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[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, + include: Unset | GetPlaybookInclude = UNSET, ) -> ErrorsList | PlaybookResponse | None: """Retrieves a playbook @@ -176,14 +172,14 @@ async def asyncio( Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): 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: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/list_playbooks.py b/rootly_sdk/api/playbooks/list_playbooks.py index 0326a21d..e7ba8cb3 100644 --- a/rootly_sdk/api/playbooks/list_playbooks.py +++ b/rootly_sdk/api/playbooks/list_playbooks.py @@ -12,14 +12,13 @@ def _get_kwargs( *, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -64,18 +63,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookList]: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,18 +100,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PlaybookList | None: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,18 +132,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookList]: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,18 +167,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PlaybookList | None: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/playbooks/update_playbook.py b/rootly_sdk/api/playbooks/update_playbook.py index 9fe8a131..06bf4a5e 100644 --- a/rootly_sdk/api/playbooks/update_playbook.py +++ b/rootly_sdk/api/playbooks/update_playbook.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/playbooks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbooks/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/pulses/create_pulse.py b/rootly_sdk/api/pulses/create_pulse.py index 30b82b81..a54eb50b 100644 --- a/rootly_sdk/api/pulses/create_pulse.py +++ b/rootly_sdk/api/pulses/create_pulse.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return ( diff --git a/rootly_sdk/api/pulses/get_pulse.py b/rootly_sdk/api/pulses/get_pulse.py index 1d751fd4..66769553 100644 --- a/rootly_sdk/api/pulses/get_pulse.py +++ b/rootly_sdk/api/pulses/get_pulse.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/pulses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/pulses/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return ( diff --git a/rootly_sdk/api/pulses/list_pulses.py b/rootly_sdk/api/pulses/list_pulses.py index 1603a528..c03b1e5f 100644 --- a/rootly_sdk/api/pulses/list_pulses.py +++ b/rootly_sdk/api/pulses/list_pulses.py @@ -11,48 +11,47 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -170,92 +169,92 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PulseList]: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -318,92 +317,92 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PulseList | None: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -461,92 +460,92 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PulseList]: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -607,92 +606,92 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PulseList | None: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/pulses/update_pulse.py b/rootly_sdk/api/pulses/update_pulse.py index 38022933..2364915a 100644 --- a/rootly_sdk/api/pulses/update_pulse.py +++ b/rootly_sdk/api/pulses/update_pulse.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/pulses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/pulses/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py index a198248f..c9e25ba8 100644 --- a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -17,12 +16,11 @@ def _get_kwargs( id: str, *, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -32,9 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_configurations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_configurations/{id}", "params": params, } @@ -75,7 +71,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, ) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Retrieves a Retrospective Configuration @@ -83,14 +79,14 @@ def sync_detailed( Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): 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[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -109,7 +105,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, ) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Retrieves a Retrospective Configuration @@ -117,14 +113,14 @@ def sync( Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): 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: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return sync_detailed( @@ -138,7 +134,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, ) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Retrieves a Retrospective Configuration @@ -146,14 +142,14 @@ async def asyncio_detailed( Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): 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[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -170,7 +166,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, ) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Retrieves a Retrospective Configuration @@ -178,14 +174,14 @@ async def asyncio( Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): 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: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py index 41494cab..219d509d 100644 --- a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py +++ b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py @@ -14,15 +14,14 @@ def _get_kwargs( *, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -73,20 +72,20 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,20 +112,20 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> RetrospectiveConfigurationList | None: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,20 +147,20 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,20 +185,20 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> RetrospectiveConfigurationList | None: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py index ceb35adb..0947dc5e 100644 --- a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_configurations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_configurations/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py index 2284fedd..fc44bf43 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/retrospective_process_groups/{retrospective_process_group_id}/steps".format( - retrospective_process_group_id=quote(str(retrospective_process_group_id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{retrospective_process_group_id}/steps", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py index e49707dd..f3a4c85f 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_process_group_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_group_steps/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py index 7cb7eca6..769b164e 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_process_group_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_group_steps/{id}", } return _kwargs diff --git a/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py b/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py index 71508e1f..2c7ec67e 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py +++ b/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,16 +12,15 @@ def _get_kwargs( retrospective_process_group_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -45,9 +43,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_process_groups/{retrospective_process_group_id}/steps".format( - retrospective_process_group_id=quote(str(retrospective_process_group_id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{retrospective_process_group_id}/steps", "params": params, } @@ -83,14 +79,14 @@ def sync_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -98,14 +94,14 @@ def sync_detailed( Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,14 +134,14 @@ def sync( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> RetrospectiveProcessGroupStepList | None: """List RetrospectiveProcessGroup Steps @@ -153,14 +149,14 @@ def sync( Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,14 +184,14 @@ async def asyncio_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -203,14 +199,14 @@ async def asyncio_detailed( Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -241,14 +237,14 @@ async def asyncio( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> RetrospectiveProcessGroupStepList | None: """List RetrospectiveProcessGroup Steps @@ -256,14 +252,14 @@ async def asyncio( Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py index 6672af62..db601b68 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_process_group_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_group_steps/{id}", } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py index 5d7feb3c..b2593167 100644 --- a/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/retrospective_processes/{retrospective_process_id}/groups".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/groups", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py index ffa0bd00..e5af35fc 100644 --- a/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_process_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py index a1f3483d..02bd0f1b 100644 --- a/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -16,12 +15,11 @@ def _get_kwargs( id: str, *, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_process_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{id}", "params": params, } @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -77,7 +73,7 @@ def sync_detailed( Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,7 +99,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> RetrospectiveProcessGroupResponse | None: """Retrieves a Retrospective Process Group @@ -111,7 +107,7 @@ def sync( Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,7 +128,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -140,7 +136,7 @@ async def asyncio_detailed( Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,7 +160,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> RetrospectiveProcessGroupResponse | None: """Retrieves a Retrospective Process Group @@ -172,7 +168,7 @@ async def asyncio( Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py b/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py index a2ace0f8..364e8a03 100644 --- a/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py +++ b/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -19,26 +18,25 @@ def _get_kwargs( retrospective_process_id: str, *, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -62,9 +60,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_processes/{retrospective_process_id}/groups".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/groups", "params": params, } @@ -100,15 +96,15 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -116,15 +112,15 @@ def sync_detailed( Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,15 +154,15 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> RetrospectiveProcessGroupList | None: """List Retrospective Process Groups @@ -174,15 +170,15 @@ def sync( Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -211,15 +207,15 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -227,15 +223,15 @@ async def asyncio_detailed( Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -267,15 +263,15 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> RetrospectiveProcessGroupList | None: """List Retrospective Process Groups @@ -283,15 +279,15 @@ async def asyncio( Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py index 025b6851..0960115f 100644 --- a/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_process_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{id}", } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/retrospective_processes/create_retrospective_process.py b/rootly_sdk/api/retrospective_processes/create_retrospective_process.py index 958b54e7..80fdaa15 100644 --- a/rootly_sdk/api/retrospective_processes/create_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/create_retrospective_process.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py index cb4c54f8..8c3808e0 100644 --- a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_processes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_processes/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py index f88cfd09..f86ca3de 100644 --- a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -17,12 +16,11 @@ def _get_kwargs( id: str, *, - include: GetRetrospectiveProcessInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -32,9 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_processes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_processes/{id}", "params": params, } @@ -75,7 +71,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessInclude = UNSET, ) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Retrieves a retrospective process @@ -83,14 +79,14 @@ def sync_detailed( Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): 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[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -109,7 +105,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessInclude = UNSET, ) -> ErrorsList | RetrospectiveProcessResponse | None: """Retrieves a retrospective process @@ -117,14 +113,14 @@ def sync( Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): 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: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -138,7 +134,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessInclude = UNSET, ) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Retrieves a retrospective process @@ -146,14 +142,14 @@ async def asyncio_detailed( Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): 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[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -170,7 +166,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, + include: Unset | GetRetrospectiveProcessInclude = UNSET, ) -> ErrorsList | RetrospectiveProcessResponse | None: """Retrieves a retrospective process @@ -178,14 +174,14 @@ async def asyncio( Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): 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: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py index a106a418..b2fbd7b2 100644 --- a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py +++ b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py @@ -14,14 +14,13 @@ def _get_kwargs( *, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -70,18 +69,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -107,18 +106,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> RetrospectiveProcessList | None: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,18 +138,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,18 +173,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> RetrospectiveProcessList | None: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py index d290ed1b..8afeb077 100644 --- a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_processes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_processes/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py index 92dfb6e8..8c370ff6 100644 --- a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py index 51361c85..5988c137 100644 --- a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_steps/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py index 416a641b..52b64de5 100644 --- a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_steps/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py index d611a9e0..11922444 100644 --- a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py +++ b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( retrospective_process_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps", "params": params, } @@ -69,10 +65,10 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -80,10 +76,10 @@ def sync_detailed( Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,10 +108,10 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> RetrospectiveStepList | None: """List retrospective steps @@ -123,10 +119,10 @@ def sync( Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +146,10 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -161,10 +157,10 @@ async def asyncio_detailed( Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,10 +187,10 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> RetrospectiveStepList | None: """List retrospective steps @@ -202,10 +198,10 @@ async def asyncio( Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py index 004aa760..553bd75e 100644 --- a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_steps/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/create_postmortem_template.py b/rootly_sdk/api/retrospective_templates/create_postmortem_template.py index a45d193d..854b6889 100644 --- a/rootly_sdk/api/retrospective_templates/create_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/create_postmortem_template.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py index aafa6848..b88c5b8d 100644 --- a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/post_mortem_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortem_templates/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py index 20fda05d..b4484263 100644 --- a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/post_mortem_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortem_templates/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py index a85e9595..4bd711cb 100644 --- a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py +++ b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py @@ -11,11 +11,10 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -61,18 +60,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -98,18 +97,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PostMortemTemplateList | None: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,18 +129,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -165,18 +164,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> PostMortemTemplateList | None: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py index 32d1be7f..c3d78abf 100644 --- a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdatePostMortemTemplate, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/post_mortem_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortem_templates/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -110,7 +107,7 @@ def sync( Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -171,7 +168,7 @@ async def asyncio( Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/roles/create_role.py b/rootly_sdk/api/roles/create_role.py index 14a23064..cc05aa9d 100644 --- a/rootly_sdk/api/roles/create_role.py +++ b/rootly_sdk/api/roles/create_role.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/roles/delete_role.py b/rootly_sdk/api/roles/delete_role.py index 72c04400..c4103b98 100644 --- a/rootly_sdk/api/roles/delete_role.py +++ b/rootly_sdk/api/roles/delete_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/roles/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/roles/get_role.py b/rootly_sdk/api/roles/get_role.py index ec32d7ee..fa5e147f 100644 --- a/rootly_sdk/api/roles/get_role.py +++ b/rootly_sdk/api/roles/get_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/roles/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/roles/list_roles.py b/rootly_sdk/api/roles/list_roles.py index fd378970..92958f7c 100644 --- a/rootly_sdk/api/roles/list_roles.py +++ b/rootly_sdk/api/roles/list_roles.py @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -83,34 +82,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[RoleList]: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,34 +143,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> RoleList | None: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,34 +199,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[RoleList]: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,34 +258,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> RoleList | None: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/roles/update_role.py b/rootly_sdk/api/roles/update_role.py index a0e1e4cd..2aae9b98 100644 --- a/rootly_sdk/api/roles/update_role.py +++ b/rootly_sdk/api/roles/update_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateRole, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/roles/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, @@ -110,7 +107,7 @@ def sync( Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, @@ -171,7 +168,7 @@ async def asyncio( Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py index 8bb86f5f..c107f416 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py index a98550d8..8e688f7c 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedule_rotation_active_days/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_active_days/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py index fa2947c6..e0458be5 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotation_active_days/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_active_days/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py b/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py index 17ccecb6..1e54c8a5 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py +++ b/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -78,9 +74,9 @@ def sync_detailed( Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ScheduleRotationActiveDayList | None: """List schedule rotation active days @@ -118,9 +114,9 @@ def sync( Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ScheduleRotationActiveDayList | None: """List schedule rotation active days @@ -191,9 +187,9 @@ async def asyncio( Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py index b6446600..4b87bbda 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedule_rotation_active_days/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_active_days/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py index 87733a8a..b87c2ed5 100644 --- a/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py index 77221b81..f7fe1339 100644 --- a/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedule_rotation_users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_users/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py index bf1a538b..d1e6b151 100644 --- a/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotation_users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_users/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py b/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py index a217745f..21d8f869 100644 --- a/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py +++ b/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users", "params": params, } @@ -68,17 +64,17 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,17 +102,17 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ScheduleRotationUserList | None: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,17 +135,17 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,17 +171,17 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ScheduleRotationUserList | None: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py index c8dbb34b..85250a89 100644 --- a/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedule_rotation_users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_users/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py index 61069e24..9e113ece 100644 --- a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/schedule_rotations".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/schedule_rotations", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py index 441f2ff1..0bd9ab54 100644 --- a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedule_rotations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotations/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py index 09f83172..7cb6f77b 100644 --- a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotations/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py index 80ad5986..1cc7afbf 100644 --- a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py +++ b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( schedule_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/schedule_rotations".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/schedule_rotations", "params": params, } @@ -69,10 +65,10 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -80,10 +76,10 @@ def sync_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,10 +108,10 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> ScheduleRotationList | None: """List schedule rotations @@ -123,10 +119,10 @@ def sync( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +146,10 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -161,10 +157,10 @@ async def asyncio_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,10 +187,10 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> ScheduleRotationList | None: """List schedule rotations @@ -202,10 +198,10 @@ async def asyncio( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py index 2016f193..5ec8c3c3 100644 --- a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedule_rotations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotations/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedules/create_schedule.py b/rootly_sdk/api/schedules/create_schedule.py index fe6cb78c..41dd8104 100644 --- a/rootly_sdk/api/schedules/create_schedule.py +++ b/rootly_sdk/api/schedules/create_schedule.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/schedules/delete_schedule.py b/rootly_sdk/api/schedules/delete_schedule.py index 1d4d73ba..83c1016e 100644 --- a/rootly_sdk/api/schedules/delete_schedule.py +++ b/rootly_sdk/api/schedules/delete_schedule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/schedules/get_schedule.py b/rootly_sdk/api/schedules/get_schedule.py index 254e51f6..5449e85a 100644 --- a/rootly_sdk/api/schedules/get_schedule.py +++ b/rootly_sdk/api/schedules/get_schedule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/schedules/list_schedules.py b/rootly_sdk/api/schedules/list_schedules.py index a10d4e91..16a4ceca 100644 --- a/rootly_sdk/api/schedules/list_schedules.py +++ b/rootly_sdk/api/schedules/list_schedules.py @@ -11,21 +11,25 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -34,6 +38,8 @@ def _get_kwargs( params["filter[name]"] = filtername + params["filter[team_ids]"] = filterteam_ids + params["filter[created_at][gt]"] = filtercreated_atgt params["filter[created_at][gte]"] = filtercreated_atgte @@ -50,6 +56,14 @@ def _get_kwargs( params["filter[name][not_in]"] = filternamenot_in + params["filter[team_ids][eq]"] = filterteam_idseq + + params["filter[team_ids][not_eq]"] = filterteam_idsnot_eq + + params["filter[team_ids][in]"] = filterteam_idsin + + params["filter[team_ids][not_in]"] = filterteam_idsnot_in + params["page[number]"] = pagenumber params["page[size]"] = pagesize @@ -89,38 +103,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleList]: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,6 +158,7 @@ def sync_detailed( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -142,6 +167,10 @@ def sync_detailed( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ) @@ -156,38 +185,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ScheduleList | None: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -202,6 +241,7 @@ def sync( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -210,6 +250,10 @@ def sync( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ).parsed @@ -218,38 +262,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleList]: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,6 +317,7 @@ async def asyncio_detailed( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -271,6 +326,10 @@ async def asyncio_detailed( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ) @@ -283,38 +342,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ScheduleList | None: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -330,6 +399,7 @@ async def asyncio( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -338,6 +408,10 @@ async def asyncio( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ) diff --git a/rootly_sdk/api/schedules/update_schedule.py b/rootly_sdk/api/schedules/update_schedule.py index cc14d173..0ba5b2b4 100644 --- a/rootly_sdk/api/schedules/update_schedule.py +++ b/rootly_sdk/api/schedules/update_schedule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/secrets/create_secret.py b/rootly_sdk/api/secrets/create_secret.py index 927e7547..a28973eb 100644 --- a/rootly_sdk/api/secrets/create_secret.py +++ b/rootly_sdk/api/secrets/create_secret.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/secrets/delete_secret.py b/rootly_sdk/api/secrets/delete_secret.py index cab7f849..aded439f 100644 --- a/rootly_sdk/api/secrets/delete_secret.py +++ b/rootly_sdk/api/secrets/delete_secret.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/secrets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/secrets/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/secrets/get_secret.py b/rootly_sdk/api/secrets/get_secret.py index 0a85cd44..4d1b134a 100644 --- a/rootly_sdk/api/secrets/get_secret.py +++ b/rootly_sdk/api/secrets/get_secret.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/secrets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/secrets/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/secrets/list_secrets.py b/rootly_sdk/api/secrets/list_secrets.py index 5763e6c0..09aced5b 100644 --- a/rootly_sdk/api/secrets/list_secrets.py +++ b/rootly_sdk/api/secrets/list_secrets.py @@ -11,11 +11,10 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -59,18 +58,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[SecretList]: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,18 +95,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> SecretList | None: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,18 +127,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[SecretList]: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,18 +162,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> SecretList | None: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/secrets/update_secret.py b/rootly_sdk/api/secrets/update_secret.py index 41fe293e..b6c122d6 100644 --- a/rootly_sdk/api/secrets/update_secret.py +++ b/rootly_sdk/api/secrets/update_secret.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/secrets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/secrets/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/services/bulk_delete_services.py b/rootly_sdk/api/services/bulk_delete_services.py index cb45739c..a0b10bc5 100644 --- a/rootly_sdk/api/services/bulk_delete_services.py +++ b/rootly_sdk/api/services/bulk_delete_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/services/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyServicesType0): _kwargs["json"] = body.to_dict() else: @@ -36,7 +37,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: +) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyServicesResponse.from_dict(response.json()) @@ -49,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyServicesResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyServicesResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -76,7 +77,7 @@ def _parse_response_422(data: object) -> BulkDestroyServicesResponse | ErrorsLis def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: +) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,23 +89,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,23 +122,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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: - BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList + Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']] """ return sync_detailed( @@ -149,23 +150,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -180,23 +181,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). 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: - BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList + Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/services/bulk_upsert_services.py b/rootly_sdk/api/services/bulk_upsert_services.py index c1aaa566..8acfaa05 100644 --- a/rootly_sdk/api/services/bulk_upsert_services.py +++ b/rootly_sdk/api/services/bulk_upsert_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList | None: +) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertServicesResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertServicesError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertServicesError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> BulkUpsertServicesError | ErrorsList: def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: +) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: +) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList] + Response[Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList | None: +) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList + Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: +) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList] + Response[Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList | None: +) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList + Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/services/create_service.py b/rootly_sdk/api/services/create_service.py index fcd786db..56e5f79c 100644 --- a/rootly_sdk/api/services/create_service.py +++ b/rootly_sdk/api/services/create_service.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/services/create_service_catalog_property.py b/rootly_sdk/api/services/create_service_catalog_property.py index 3c61dc54..10022b29 100644 --- a/rootly_sdk/api/services/create_service_catalog_property.py +++ b/rootly_sdk/api/services/create_service_catalog_property.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/services/delete_service.py b/rootly_sdk/api/services/delete_service.py index 52fc6e7d..e4761a6c 100644 --- a/rootly_sdk/api/services/delete_service.py +++ b/rootly_sdk/api/services/delete_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/services/get_service.py b/rootly_sdk/api/services/get_service.py index 17d3ef16..eea3f3c3 100644 --- a/rootly_sdk/api/services/get_service.py +++ b/rootly_sdk/api/services/get_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/services/get_service_incidents_chart.py b/rootly_sdk/api/services/get_service_incidents_chart.py index 7a881811..499f72b2 100644 --- a/rootly_sdk/api/services/get_service_incidents_chart.py +++ b/rootly_sdk/api/services/get_service_incidents_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, period: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/services/{id}/incidents_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}/incidents_chart", "params": params, } @@ -66,7 +62,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -76,7 +72,7 @@ def sync_detailed( Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -84,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -100,7 +96,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -110,7 +106,7 @@ def sync( Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -118,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -139,7 +135,7 @@ async def asyncio_detailed( Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -147,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -161,7 +157,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, period: str, @@ -171,7 +167,7 @@ async def asyncio( Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -179,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return ( diff --git a/rootly_sdk/api/services/get_service_uptime_chart.py b/rootly_sdk/api/services/get_service_uptime_chart.py index 1976e560..7efba8d2 100644 --- a/rootly_sdk/api/services/get_service_uptime_chart.py +++ b/rootly_sdk/api/services/get_service_uptime_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/services/{id}/uptime_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}/uptime_chart", "params": params, } @@ -66,25 +62,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -100,25 +96,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return sync_detailed( @@ -129,25 +125,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -161,25 +157,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - period: str | Unset = UNSET, + period: Unset | str = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): 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: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return ( diff --git a/rootly_sdk/api/services/list_service_catalog_properties.py b/rootly_sdk/api/services/list_service_catalog_properties.py index 54b4e887..85a6e5c7 100644 --- a/rootly_sdk/api/services/list_service_catalog_properties.py +++ b/rootly_sdk/api/services/list_service_catalog_properties.py @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -97,34 +96,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +157,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +213,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +272,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/services/list_services.py b/rootly_sdk/api/services/list_services.py index 0bec2c70..f691c5c3 100644 --- a/rootly_sdk/api/services/list_services.py +++ b/rootly_sdk/api/services/list_services.py @@ -11,41 +11,40 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -149,78 +148,78 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[ServiceList]: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -276,78 +275,78 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> ServiceList | None: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -398,78 +397,78 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[ServiceList]: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -523,78 +522,78 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> ServiceList | None: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/services/update_service.py b/rootly_sdk/api/services/update_service.py index 5ba68ee9..23521465 100644 --- a/rootly_sdk/api/services/update_service.py +++ b/rootly_sdk/api/services/update_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateService, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, @@ -110,7 +107,7 @@ def sync( Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, @@ -171,7 +168,7 @@ async def asyncio( Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/severities/create_severity.py b/rootly_sdk/api/severities/create_severity.py index ac3b5494..5282399a 100644 --- a/rootly_sdk/api/severities/create_severity.py +++ b/rootly_sdk/api/severities/create_severity.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/severities/delete_severity.py b/rootly_sdk/api/severities/delete_severity.py index 466626a3..53aa6ffe 100644 --- a/rootly_sdk/api/severities/delete_severity.py +++ b/rootly_sdk/api/severities/delete_severity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/severities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/severities/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/severities/get_severity.py b/rootly_sdk/api/severities/get_severity.py index f36d72b9..cf85c9b3 100644 --- a/rootly_sdk/api/severities/get_severity.py +++ b/rootly_sdk/api/severities/get_severity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/severities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/severities/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/severities/list_severities.py b/rootly_sdk/api/severities/list_severities.py index 8102f620..221516df 100644 --- a/rootly_sdk/api/severities/list_severities.py +++ b/rootly_sdk/api/severities/list_severities.py @@ -11,37 +11,36 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -137,70 +136,70 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SeverityList]: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -252,70 +251,70 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> SeverityList | None: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -362,70 +361,70 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SeverityList]: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -475,70 +474,70 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> SeverityList | None: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/severities/update_severity.py b/rootly_sdk/api/severities/update_severity.py index d1794033..552576b1 100644 --- a/rootly_sdk/api/severities/update_severity.py +++ b/rootly_sdk/api/severities/update_severity.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateSeverity, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/severities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/severities/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -110,7 +107,7 @@ def sync( Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -171,7 +168,7 @@ async def asyncio( Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py index 422f1a19..7c89bc56 100644 --- a/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/shift_coverage_requests".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/shift_coverage_requests", } _kwargs["json"] = body.to_dict() @@ -86,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftCoverageRequestList] + Response[Union[ErrorsList, ShiftCoverageRequestList]] """ kwargs = _get_kwargs( @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftCoverageRequestList + Union[ErrorsList, ShiftCoverageRequestList] """ return sync_detailed( @@ -155,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftCoverageRequestList] + Response[Union[ErrorsList, ShiftCoverageRequestList]] """ kwargs = _get_kwargs( @@ -190,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftCoverageRequestList + Union[ErrorsList, ShiftCoverageRequestList] """ return ( diff --git a/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py index af89d0d5..bd91309d 100644 --- a/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/shift_coverage_requests/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/shift_coverage_requests/{id}", } return _kwargs diff --git a/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py index b841df57..b2ef0c39 100644 --- a/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/shift_coverage_requests/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/shift_coverage_requests/{id}", } return _kwargs diff --git a/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py b/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py index 62355c3a..8f2a905e 100644 --- a/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py +++ b/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( schedule_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/shift_coverage_requests".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/shift_coverage_requests", } return _kwargs diff --git a/rootly_sdk/api/shifts/get_schedule_shifts.py b/rootly_sdk/api/shifts/get_schedule_shifts.py index e263871a..baf5f6bb 100644 --- a/rootly_sdk/api/shifts/get_schedule_shifts.py +++ b/rootly_sdk/api/shifts/get_schedule_shifts.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,10 +13,9 @@ def _get_kwargs( id: str, *, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, + to: Unset | str = UNSET, + from_: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["to"] = to @@ -28,9 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{id}/shifts".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}/shifts", "params": params, } @@ -69,8 +65,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, + to: Unset | str = UNSET, + from_: Unset | str = UNSET, ) -> Response[ErrorsList | ShiftList]: """Retrieves a schedule shifts @@ -78,15 +74,15 @@ def sync_detailed( Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): 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[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -106,8 +102,8 @@ def sync( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, + to: Unset | str = UNSET, + from_: Unset | str = UNSET, ) -> ErrorsList | ShiftList | None: """Retrieves a schedule shifts @@ -115,15 +111,15 @@ def sync( Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): 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: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return sync_detailed( @@ -138,8 +134,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, + to: Unset | str = UNSET, + from_: Unset | str = UNSET, ) -> Response[ErrorsList | ShiftList]: """Retrieves a schedule shifts @@ -147,15 +143,15 @@ async def asyncio_detailed( Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): 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[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -173,8 +169,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, + to: Unset | str = UNSET, + from_: Unset | str = UNSET, ) -> ErrorsList | ShiftList | None: """Retrieves a schedule shifts @@ -182,15 +178,15 @@ async def asyncio( Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): 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: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return ( diff --git a/rootly_sdk/api/shifts/list_shifts.py b/rootly_sdk/api/shifts/list_shifts.py index 33fbd52d..6ee43619 100644 --- a/rootly_sdk/api/shifts/list_shifts.py +++ b/rootly_sdk/api/shifts/list_shifts.py @@ -13,18 +13,17 @@ def _get_kwargs( *, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -34,13 +33,13 @@ def _get_kwargs( params["to"] = to - json_user_ids: list[int] | Unset = UNSET + json_user_ids: Unset | list[int] = UNSET if not isinstance(user_ids, Unset): json_user_ids = user_ids params["user_ids[]"] = json_user_ids - json_schedule_ids: list[str] | Unset = UNSET + json_schedule_ids: Unset | list[str] = UNSET if not isinstance(schedule_ids, Unset): json_schedule_ids = schedule_ids @@ -92,33 +91,33 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ErrorsList | ShiftList]: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -141,33 +140,33 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ErrorsList | ShiftList | None: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return sync_detailed( @@ -185,33 +184,33 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ErrorsList | ShiftList]: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -232,33 +231,33 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> ErrorsList | ShiftList | None: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): 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: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return ( diff --git a/rootly_sdk/api/sl_as/create_sla.py b/rootly_sdk/api/sl_as/create_sla.py index 578b60d8..338f3be4 100644 --- a/rootly_sdk/api/sl_as/create_sla.py +++ b/rootly_sdk/api/sl_as/create_sla.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/sl_as/delete_sla.py b/rootly_sdk/api/sl_as/delete_sla.py index 19b1e4eb..97174330 100644 --- a/rootly_sdk/api/sl_as/delete_sla.py +++ b/rootly_sdk/api/sl_as/delete_sla.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/slas/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/slas/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/sl_as/get_sla.py b/rootly_sdk/api/sl_as/get_sla.py index b2dcad6d..8cf0f064 100644 --- a/rootly_sdk/api/sl_as/get_sla.py +++ b/rootly_sdk/api/sl_as/get_sla.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/slas/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/slas/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/sl_as/list_sl_as.py b/rootly_sdk/api/sl_as/list_sl_as.py index d7f57b0a..25cca503 100644 --- a/rootly_sdk/api/sl_as/list_sl_as.py +++ b/rootly_sdk/api/sl_as/list_sl_as.py @@ -11,26 +11,25 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -104,48 +103,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SlaList]: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,48 +185,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> SlaList | None: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,48 +262,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SlaList]: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -343,48 +342,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> SlaList | None: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/sl_as/update_sla.py b/rootly_sdk/api/sl_as/update_sla.py index f168bfc9..25d81a75 100644 --- a/rootly_sdk/api/sl_as/update_sla.py +++ b/rootly_sdk/api/sl_as/update_sla.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/slas/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/slas/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/status_page_announcements/__init__.py b/rootly_sdk/api/status_page_announcements/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py new file mode 100644 index 00000000..c15ef8e3 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.new_status_page_announcement import NewStatusPageAnnouncement +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageAnnouncement, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/v1/status-pages/{status_page_id}/announcements", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: + if response.status_code == 201: + response_201 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorsList.from_dict(response.json()) + + return response_401 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py new file mode 100644 index 00000000..1314cc77 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/announcements/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: + if response.status_code == 200: + response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py new file mode 100644 index 00000000..bc616232 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/announcements/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: + if response.status_code == 200: + response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py new file mode 100644 index 00000000..2bc98e02 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.status_page_announcement_list import StatusPageAnnouncementList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/status-pages/{status_page_id}/announcements", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StatusPageAnnouncementList | None: + if response.status_code == 200: + response_200 = StatusPageAnnouncementList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[StatusPageAnnouncementList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[StatusPageAnnouncementList]: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[StatusPageAnnouncementList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageAnnouncementList | None: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + StatusPageAnnouncementList + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[StatusPageAnnouncementList]: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[StatusPageAnnouncementList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageAnnouncementList | None: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + StatusPageAnnouncementList + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py new file mode 100644 index 00000000..85139011 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...models.update_status_page_announcement import UpdateStatusPageAnnouncement +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateStatusPageAnnouncement, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/announcements/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: + if response.status_code == 200: + response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + 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[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> ErrorsList | StatusPageAnnouncementResponse | None: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + 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: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/__init__.py b/rootly_sdk/api/status_page_component_groups/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py new file mode 100644 index 00000000..62f8a188 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.new_status_page_component_group import NewStatusPageComponentGroup +from ...models.status_page_component_group_response import StatusPageComponentGroupResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageComponentGroup, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/v1/status-pages/{status_page_id}/component-groups", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentGroupResponse | None: + if response.status_code == 201: + response_201 = StatusPageComponentGroupResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorsList.from_dict(response.json()) + + return response_401 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + 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[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> ErrorsList | StatusPageComponentGroupResponse | None: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + 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: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + 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[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> ErrorsList | StatusPageComponentGroupResponse | None: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + 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: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py new file mode 100644 index 00000000..8c5021bc --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py @@ -0,0 +1,98 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/component-groups/{id}", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component group + + Delete a status page component group together with its components + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component group + + Delete a status page component group together with its components + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py new file mode 100644 index 00000000..2539c21b --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_group_response import StatusPageComponentGroupResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include: Unset | str = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/component-groups/{id}", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentGroupResponse | None: + if response.status_code == 200: + response_200 = StatusPageComponentGroupResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + 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[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentGroupResponse | None: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + 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: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return sync_detailed( + id=id, + client=client, + include=include, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + 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[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentGroupResponse | None: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + 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: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include=include, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py b/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py new file mode 100644 index 00000000..a78bcc4a --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.status_page_component_group_list import StatusPageComponentGroupList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/status-pages/{status_page_id}/component-groups", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StatusPageComponentGroupList | None: + if response.status_code == 200: + response_200 = StatusPageComponentGroupList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[StatusPageComponentGroupList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[StatusPageComponentGroupList]: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[StatusPageComponentGroupList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentGroupList | None: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + StatusPageComponentGroupList + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[StatusPageComponentGroupList]: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[StatusPageComponentGroupList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentGroupList | None: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + StatusPageComponentGroupList + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py new file mode 100644 index 00000000..a416ba29 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_group_response import StatusPageComponentGroupResponse +from ...models.update_status_page_component_group import UpdateStatusPageComponentGroup +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateStatusPageComponentGroup, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/component-groups/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentGroupResponse | None: + if response.status_code == 200: + response_200 = StatusPageComponentGroupResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + 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[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> ErrorsList | StatusPageComponentGroupResponse | None: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + 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: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + 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[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> ErrorsList | StatusPageComponentGroupResponse | None: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + 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: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/__init__.py b/rootly_sdk/api/status_page_components/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_components/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_components/create_status_page_component.py b/rootly_sdk/api/status_page_components/create_status_page_component.py new file mode 100644 index 00000000..9b026f90 --- /dev/null +++ b/rootly_sdk/api/status_page_components/create_status_page_component.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.new_status_page_component import NewStatusPageComponent +from ...models.status_page_component_response import StatusPageComponentResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageComponent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/v1/status-pages/{status_page_id}/components", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentResponse | None: + if response.status_code == 201: + response_201 = StatusPageComponentResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorsList.from_dict(response.json()) + + return response_401 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> Response[ErrorsList | StatusPageComponentResponse]: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + 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[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> ErrorsList | StatusPageComponentResponse | None: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + 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: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> Response[ErrorsList | StatusPageComponentResponse]: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + 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[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> ErrorsList | StatusPageComponentResponse | None: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + 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: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/delete_status_page_component.py b/rootly_sdk/api/status_page_components/delete_status_page_component.py new file mode 100644 index 00000000..e362005d --- /dev/null +++ b/rootly_sdk/api/status_page_components/delete_status_page_component.py @@ -0,0 +1,98 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/components/{id}", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component + + Delete a status page component + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component + + Delete a status page component + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/rootly_sdk/api/status_page_components/get_status_page_component.py b/rootly_sdk/api/status_page_components/get_status_page_component.py new file mode 100644 index 00000000..b89508ec --- /dev/null +++ b/rootly_sdk/api/status_page_components/get_status_page_component.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_response import StatusPageComponentResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include: Unset | str = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/components/{id}", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentResponse | None: + if response.status_code == 200: + response_200 = StatusPageComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentResponse]: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + 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[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentResponse | None: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + 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: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return sync_detailed( + id=id, + client=client, + include=include, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentResponse]: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + 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[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentResponse | None: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + 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: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include=include, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/list_status_page_components.py b/rootly_sdk/api/status_page_components/list_status_page_components.py new file mode 100644 index 00000000..575d4e2b --- /dev/null +++ b/rootly_sdk/api/status_page_components/list_status_page_components.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.status_page_component_list import StatusPageComponentList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/status-pages/{status_page_id}/components", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StatusPageComponentList | None: + if response.status_code == 200: + response_200 = StatusPageComponentList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[StatusPageComponentList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[StatusPageComponentList]: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[StatusPageComponentList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentList | None: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + StatusPageComponentList + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[StatusPageComponentList]: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[StatusPageComponentList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentList | None: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + StatusPageComponentList + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/update_status_page_component.py b/rootly_sdk/api/status_page_components/update_status_page_component.py new file mode 100644 index 00000000..e049a15f --- /dev/null +++ b/rootly_sdk/api/status_page_components/update_status_page_component.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_response import StatusPageComponentResponse +from ...models.update_status_page_component import UpdateStatusPageComponent +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateStatusPageComponent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/components/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentResponse | None: + if response.status_code == 200: + response_200 = StatusPageComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> Response[ErrorsList | StatusPageComponentResponse]: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + 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[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> ErrorsList | StatusPageComponentResponse | None: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + 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: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> Response[ErrorsList | StatusPageComponentResponse]: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + 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[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> ErrorsList | StatusPageComponentResponse | None: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + 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: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_templates/create_status_page_template.py b/rootly_sdk/api/status_page_templates/create_status_page_template.py index 38428024..b2f957dc 100644 --- a/rootly_sdk/api/status_page_templates/create_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/create_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/status-pages/{status_page_id}/templates".format( - status_page_id=quote(str(status_page_id), safe=""), - ), + "url": f"/v1/status-pages/{status_page_id}/templates", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_page_templates/delete_status_page_template.py b/rootly_sdk/api/status_page_templates/delete_status_page_template.py index 0fccfa58..161fa164 100644 --- a/rootly_sdk/api/status_page_templates/delete_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/delete_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/templates/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_page_templates/get_status_page_template.py b/rootly_sdk/api/status_page_templates/get_status_page_template.py index cd9c534c..14fdfede 100644 --- a/rootly_sdk/api/status_page_templates/get_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/get_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/templates/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_page_templates/list_status_page_templates.py b/rootly_sdk/api/status_page_templates/list_status_page_templates.py index 806aef61..e3a79d97 100644 --- a/rootly_sdk/api/status_page_templates/list_status_page_templates.py +++ b/rootly_sdk/api/status_page_templates/list_status_page_templates.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( status_page_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/status-pages/{status_page_id}/templates".format( - status_page_id=quote(str(status_page_id), safe=""), - ), + "url": f"/v1/status-pages/{status_page_id}/templates", "params": params, } @@ -66,9 +62,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -76,9 +72,9 @@ def sync_detailed( Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,9 +102,9 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> StatusPageTemplateList | None: """List status page templates @@ -116,9 +112,9 @@ def sync( Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +137,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -151,9 +147,9 @@ async def asyncio_detailed( Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,9 +175,9 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> StatusPageTemplateList | None: """List status page templates @@ -189,9 +185,9 @@ async def asyncio( Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/status_page_templates/update_status_page_template.py b/rootly_sdk/api/status_page_templates/update_status_page_template.py index e8f68a20..88b755fa 100644 --- a/rootly_sdk/api/status_page_templates/update_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/update_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/templates/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/create_status_page.py b/rootly_sdk/api/status_pages/create_status_page.py index 499bcdb8..9e7615a1 100644 --- a/rootly_sdk/api/status_pages/create_status_page.py +++ b/rootly_sdk/api/status_pages/create_status_page.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/delete_status_page.py b/rootly_sdk/api/status_pages/delete_status_page.py index fcb4150f..ef7a14b6 100644 --- a/rootly_sdk/api/status_pages/delete_status_page.py +++ b/rootly_sdk/api/status_pages/delete_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/status-pages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-pages/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/get_status_page.py b/rootly_sdk/api/status_pages/get_status_page.py index d48c36a9..5f12160f 100644 --- a/rootly_sdk/api/status_pages/get_status_page.py +++ b/rootly_sdk/api/status_pages/get_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/status-pages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-pages/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/list_status_pages.py b/rootly_sdk/api/status_pages/list_status_pages.py index 1e11a52a..abf15426 100644 --- a/rootly_sdk/api/status_pages/list_status_pages.py +++ b/rootly_sdk/api/status_pages/list_status_pages.py @@ -11,27 +11,26 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -107,50 +106,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[StatusPageList]: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,50 +191,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> StatusPageList | None: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,50 +271,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[StatusPageList]: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -355,50 +354,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> StatusPageList | None: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/status_pages/update_status_page.py b/rootly_sdk/api/status_pages/update_status_page.py index a6136c7a..74ebf96f 100644 --- a/rootly_sdk/api/status_pages/update_status_page.py +++ b/rootly_sdk/api/status_pages/update_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateStatusPage, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/status-pages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-pages/{id}", } _kwargs["json"] = body.to_dict() @@ -71,7 +68,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -81,7 +78,7 @@ def sync_detailed( Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -105,7 +102,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -115,7 +112,7 @@ def sync( Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -134,7 +131,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -144,7 +141,7 @@ async def asyncio_detailed( Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -152,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -166,7 +163,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -176,7 +173,7 @@ async def asyncio( Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -184,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/statuses/get_status.py b/rootly_sdk/api/statuses/get_status.py index 185a8694..d10a7bc7 100644 --- a/rootly_sdk/api/statuses/get_status.py +++ b/rootly_sdk/api/statuses/get_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/statuses/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | StatusResponse] + Response[Union[ErrorsList, StatusResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | StatusResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | StatusResponse + Union[ErrorsList, StatusResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | StatusResponse] + Response[Union[ErrorsList, StatusResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | StatusResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | StatusResponse + Union[ErrorsList, StatusResponse] """ return ( diff --git a/rootly_sdk/api/statuses/list_statuses.py b/rootly_sdk/api/statuses/list_statuses.py index d7ddd61a..b2f4c035 100644 --- a/rootly_sdk/api/statuses/list_statuses.py +++ b/rootly_sdk/api/statuses/list_statuses.py @@ -12,18 +12,17 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -90,39 +89,39 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[ErrorsList | StatusList]: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): 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[ErrorsList | StatusList] + Response[Union[ErrorsList, StatusList]] """ kwargs = _get_kwargs( @@ -148,39 +147,39 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> ErrorsList | StatusList | None: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): 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: - ErrorsList | StatusList + Union[ErrorsList, StatusList] """ return sync_detailed( @@ -201,39 +200,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[ErrorsList | StatusList]: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): 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[ErrorsList | StatusList] + Response[Union[ErrorsList, StatusList]] """ kwargs = _get_kwargs( @@ -257,39 +256,39 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> ErrorsList | StatusList | None: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): 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: - ErrorsList | StatusList + Union[ErrorsList, StatusList] """ return ( diff --git a/rootly_sdk/api/sub_statuses/create_sub_status.py b/rootly_sdk/api/sub_statuses/create_sub_status.py index 47b85e50..f34b6c2d 100644 --- a/rootly_sdk/api/sub_statuses/create_sub_status.py +++ b/rootly_sdk/api/sub_statuses/create_sub_status.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/sub_statuses/delete_sub_status.py b/rootly_sdk/api/sub_statuses/delete_sub_status.py index 4e323dfb..88af630e 100644 --- a/rootly_sdk/api/sub_statuses/delete_sub_status.py +++ b/rootly_sdk/api/sub_statuses/delete_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/sub_statuses/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/sub_statuses/get_sub_status.py b/rootly_sdk/api/sub_statuses/get_sub_status.py index 74ea1a88..a364bb50 100644 --- a/rootly_sdk/api/sub_statuses/get_sub_status.py +++ b/rootly_sdk/api/sub_statuses/get_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/sub_statuses/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -97,14 +93,14 @@ def sync( Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/sub_statuses/list_sub_statuses.py b/rootly_sdk/api/sub_statuses/list_sub_statuses.py index ecbe33ee..4bd03cdb 100644 --- a/rootly_sdk/api/sub_statuses/list_sub_statuses.py +++ b/rootly_sdk/api/sub_statuses/list_sub_statuses.py @@ -11,18 +11,17 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -80,32 +79,32 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,32 +137,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> SubStatusList | None: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,32 +190,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -247,32 +246,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> SubStatusList | None: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/sub_statuses/update_sub_status.py b/rootly_sdk/api/sub_statuses/update_sub_status.py index 290e2864..684f59c8 100644 --- a/rootly_sdk/api/sub_statuses/update_sub_status.py +++ b/rootly_sdk/api/sub_statuses/update_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateSubStatus, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/sub_statuses/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -110,7 +107,7 @@ def sync( Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -171,7 +168,7 @@ async def asyncio( Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/teams/bulk_delete_groups.py b/rootly_sdk/api/teams/bulk_delete_groups.py index dc3ee765..f748b5db 100644 --- a/rootly_sdk/api/teams/bulk_delete_groups.py +++ b/rootly_sdk/api/teams/bulk_delete_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/teams/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyTeamsType0): _kwargs["json"] = body.to_dict() else: @@ -36,7 +37,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: +) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyTeamsResponse.from_dict(response.json()) @@ -49,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyTeamsResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyTeamsResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -76,7 +77,7 @@ def _parse_response_422(data: object) -> BulkDestroyTeamsResponse | ErrorsList: def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: +) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,23 +89,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). 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[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,23 +122,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). 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: - BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList + Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']] """ return sync_detailed( @@ -149,23 +150,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). 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[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -180,23 +181,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). 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: - BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList + Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/teams/bulk_upsert_groups.py b/rootly_sdk/api/teams/bulk_upsert_groups.py index 406c76f5..5a5a471a 100644 --- a/rootly_sdk/api/teams/bulk_upsert_groups.py +++ b/rootly_sdk/api/teams/bulk_upsert_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Union import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: +) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertTeamsResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertTeamsError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertTeamsError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> BulkUpsertTeamsError | ErrorsList: def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: +) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: +) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList] + Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: +) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList + Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: +) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList] + Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: +) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList + Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/teams/create_group_catalog_property.py b/rootly_sdk/api/teams/create_group_catalog_property.py index c3a7a4ef..d8f5620c 100644 --- a/rootly_sdk/api/teams/create_group_catalog_property.py +++ b/rootly_sdk/api/teams/create_group_catalog_property.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/teams/create_team.py b/rootly_sdk/api/teams/create_team.py index aa00b3db..17bbf1b8 100644 --- a/rootly_sdk/api/teams/create_team.py +++ b/rootly_sdk/api/teams/create_team.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/teams/delete_team.py b/rootly_sdk/api/teams/delete_team.py index bd6221ce..c9bb64fa 100644 --- a/rootly_sdk/api/teams/delete_team.py +++ b/rootly_sdk/api/teams/delete_team.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/teams/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | TeamResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | TeamResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | TeamResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | TeamResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/teams/get_team.py b/rootly_sdk/api/teams/get_team.py index 3c4c049d..154624c1 100644 --- a/rootly_sdk/api/teams/get_team.py +++ b/rootly_sdk/api/teams/get_team.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - include: GetTeamInclude | Unset = UNSET, + include: Unset | GetTeamInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/teams/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}", "params": params, } @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, + include: Unset | GetTeamInclude = UNSET, ) -> Response[ErrorsList | TeamResponse]: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): 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[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, + include: Unset | GetTeamInclude = UNSET, ) -> ErrorsList | TeamResponse | None: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): 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: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, + include: Unset | GetTeamInclude = UNSET, ) -> Response[ErrorsList | TeamResponse]: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): 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[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, + include: Unset | GetTeamInclude = UNSET, ) -> ErrorsList | TeamResponse | None: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): 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: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/teams/get_team_incidents_chart.py b/rootly_sdk/api/teams/get_team_incidents_chart.py index 7f173bd8..46979aba 100644 --- a/rootly_sdk/api/teams/get_team_incidents_chart.py +++ b/rootly_sdk/api/teams/get_team_incidents_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -16,7 +15,6 @@ def _get_kwargs( *, period: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -25,9 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/teams/{id}/incidents_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}/incidents_chart", "params": params, } @@ -83,7 +79,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -117,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return sync_detailed( @@ -146,7 +142,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -178,7 +174,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return ( diff --git a/rootly_sdk/api/teams/list_group_catalog_properties.py b/rootly_sdk/api/teams/list_group_catalog_properties.py index 59d899d2..99dda92c 100644 --- a/rootly_sdk/api/teams/list_group_catalog_properties.py +++ b/rootly_sdk/api/teams/list_group_catalog_properties.py @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -97,34 +96,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +157,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +213,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +272,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> CatalogPropertyList | None: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/teams/list_teams.py b/rootly_sdk/api/teams/list_teams.py index 8ae9cdb6..c31abb6b 100644 --- a/rootly_sdk/api/teams/list_teams.py +++ b/rootly_sdk/api/teams/list_teams.py @@ -12,49 +12,48 @@ def _get_kwargs( *, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -169,88 +168,88 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[TeamList]: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -311,88 +310,88 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> TeamList | None: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -448,88 +447,88 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[TeamList]: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -588,88 +587,88 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> TeamList | None: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/teams/update_team.py b/rootly_sdk/api/teams/update_team.py index b555e950..92f9645a 100644 --- a/rootly_sdk/api/teams/update_team.py +++ b/rootly_sdk/api/teams/update_team.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateTeam, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/teams/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}", } _kwargs["json"] = body.to_dict() @@ -66,7 +63,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, @@ -76,7 +73,7 @@ def sync_detailed( Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -100,7 +97,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, @@ -110,7 +107,7 @@ def sync( Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -129,7 +126,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, @@ -139,7 +136,7 @@ async def asyncio_detailed( Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -161,7 +158,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, @@ -171,7 +168,7 @@ async def asyncio( Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/create_user_email_address.py b/rootly_sdk/api/user_email_addresses/create_user_email_address.py index 74446851..6abb0a4f 100644 --- a/rootly_sdk/api/user_email_addresses/create_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/create_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/users/{user_id}/email_addresses".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/email_addresses", } _kwargs["json"] = body.to_dict() @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/delete_user_email_address.py b/rootly_sdk/api/user_email_addresses/delete_user_email_address.py index 48fb3366..b33ed180 100644 --- a/rootly_sdk/api/user_email_addresses/delete_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/delete_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/email_addresses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py b/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py index 1787502c..30837a61 100644 --- a/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py +++ b/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( user_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{user_id}/email_addresses".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/email_addresses", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressList] + Response[Union[ErrorsList, UserEmailAddressList]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressList + Union[ErrorsList, UserEmailAddressList] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressList] + Response[Union[ErrorsList, UserEmailAddressList]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressList + Union[ErrorsList, UserEmailAddressList] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py b/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py index f2cffd4b..b7d03cf9 100644 --- a/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py +++ b/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/email_addresses/{id}/resend_verification".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}/resend_verification", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/show_user_email_address.py b/rootly_sdk/api/user_email_addresses/show_user_email_address.py index 7d07adf5..f350ab94 100644 --- a/rootly_sdk/api/user_email_addresses/show_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/show_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/email_addresses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/update_user_email_address.py b/rootly_sdk/api/user_email_addresses/update_user_email_address.py index 2c5e414d..e2af7b2c 100644 --- a/rootly_sdk/api/user_email_addresses/update_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/update_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/email_addresses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}", } _kwargs["json"] = body.to_dict() @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/verify_user_email_address.py b/rootly_sdk/api/user_email_addresses/verify_user_email_address.py index 87d89043..92667c75 100644 --- a/rootly_sdk/api/user_email_addresses/verify_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/verify_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -16,7 +15,6 @@ def _get_kwargs( *, token: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["token"] = token @@ -25,9 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/email_addresses/{id}/verify".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}/verify", "params": params, } @@ -88,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -122,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -151,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -183,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py index 38aa6b53..d1400b94 100644 --- a/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/users/{user_id}/notification_rules".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/notification_rules", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py index 45a0a726..8e6643d7 100644 --- a/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/notification_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/notification_rules/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py index 1c214c69..3951c128 100644 --- a/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/notification_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/notification_rules/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py b/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py index 839b2ca9..15115e91 100644 --- a/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py +++ b/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,11 @@ def _get_kwargs( user_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{user_id}/notification_rules".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/notification_rules", "params": params, } @@ -71,10 +67,10 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -82,10 +78,10 @@ def sync_detailed( Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,10 +110,10 @@ def sync( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> UserNotificationRuleList | None: """List user notification rules @@ -125,10 +121,10 @@ def sync( Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,10 +148,10 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -163,10 +159,10 @@ async def asyncio_detailed( Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,10 +189,10 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> UserNotificationRuleList | None: """List user notification rules @@ -204,10 +200,10 @@ async def asyncio( Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py index 39e99b2b..267b399d 100644 --- a/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/notification_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/notification_rules/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py index 4e6fc622..8064bd89 100644 --- a/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/users/{user_id}/phone_numbers".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/phone_numbers", } _kwargs["json"] = body.to_dict() @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py index 0b556c98..a0afefd8 100644 --- a/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/phone_numbers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/phone_numbers/{id}", } return _kwargs @@ -82,7 +78,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -113,7 +109,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -139,7 +135,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py b/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py index 7e8d2f71..b31cba8f 100644 --- a/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py +++ b/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( user_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{user_id}/phone_numbers".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/phone_numbers", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberList] + Response[Union[ErrorsList, UserPhoneNumberList]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberList + Union[ErrorsList, UserPhoneNumberList] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberList] + Response[Union[ErrorsList, UserPhoneNumberList]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberList + Union[ErrorsList, UserPhoneNumberList] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py index 6cfafbed..462a38b1 100644 --- a/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/phone_numbers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/phone_numbers/{id}", } return _kwargs @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py index 6dcffd23..5fc8306a 100644 --- a/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/phone_numbers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/phone_numbers/{id}", } _kwargs["json"] = body.to_dict() @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/users/delete_user.py b/rootly_sdk/api/users/delete_user.py index e0be4b19..3aaeadb4 100644 --- a/rootly_sdk/api/users/delete_user.py +++ b/rootly_sdk/api/users/delete_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/users/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/users/get_current_user.py b/rootly_sdk/api/users/get_current_user.py index 054c8451..2a264abd 100644 --- a/rootly_sdk/api/users/get_current_user.py +++ b/rootly_sdk/api/users/get_current_user.py @@ -11,7 +11,6 @@ def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", "url": "/v1/users/me", @@ -63,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs() @@ -88,7 +87,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -109,7 +108,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs() @@ -132,7 +131,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/users/get_user.py b/rootly_sdk/api/users/get_user.py index 7000acf4..b07da7fd 100644 --- a/rootly_sdk/api/users/get_user.py +++ b/rootly_sdk/api/users/get_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetUserInclude | Unset = UNSET, + include: Unset | GetUserInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/users/{id}", "params": params, } @@ -73,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, + include: Unset | GetUserInclude = UNSET, ) -> Response[ErrorsList | UserResponse]: """Retrieves an user @@ -81,14 +77,14 @@ def sync_detailed( Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): 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[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -107,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, + include: Unset | GetUserInclude = UNSET, ) -> ErrorsList | UserResponse | None: """Retrieves an user @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): 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: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -136,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, + include: Unset | GetUserInclude = UNSET, ) -> Response[ErrorsList | UserResponse]: """Retrieves an user @@ -144,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): 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[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -168,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, + include: Unset | GetUserInclude = UNSET, ) -> ErrorsList | UserResponse | None: """Retrieves an user @@ -176,14 +172,14 @@ async def asyncio( Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): 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: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/users/list_users.py b/rootly_sdk/api/users/list_users.py index 7ef32a0b..0c8ec7b0 100644 --- a/rootly_sdk/api/users/list_users.py +++ b/rootly_sdk/api/users/list_users.py @@ -14,18 +14,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -44,13 +43,13 @@ def _get_kwargs( params["filter[created_at][lte]"] = filtercreated_atlte - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -98,39 +97,39 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, ) -> Response[ErrorsList | UserList]: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): 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[ErrorsList | UserList] + Response[Union[ErrorsList, UserList]] """ kwargs = _get_kwargs( @@ -156,39 +155,39 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, ) -> ErrorsList | UserList | None: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): 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: - ErrorsList | UserList + Union[ErrorsList, UserList] """ return sync_detailed( @@ -209,39 +208,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, ) -> Response[ErrorsList | UserList]: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): 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[ErrorsList | UserList] + Response[Union[ErrorsList, UserList]] """ kwargs = _get_kwargs( @@ -265,39 +264,39 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, ) -> ErrorsList | UserList | None: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): 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: - ErrorsList | UserList + Union[ErrorsList, UserList] """ return ( diff --git a/rootly_sdk/api/users/update_user.py b/rootly_sdk/api/users/update_user.py index 40ac5b44..c02f9635 100644 --- a/rootly_sdk/api/users/update_user.py +++ b/rootly_sdk/api/users/update_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -9,25 +8,22 @@ from ...models.errors_list import ErrorsList from ...models.update_user import UpdateUser from ...models.user_response import UserResponse -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateUser | Unset = UNSET, + body: UpdateUser, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/users/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, + body: UpdateUser, ) -> Response[ErrorsList | UserResponse]: """Update a user @@ -77,14 +73,14 @@ def sync_detailed( Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): 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[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, + body: UpdateUser, ) -> ErrorsList | UserResponse | None: """Update a user @@ -111,14 +107,14 @@ def sync( Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): 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: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, + body: UpdateUser, ) -> Response[ErrorsList | UserResponse]: """Update a user @@ -140,14 +136,14 @@ async def asyncio_detailed( Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): 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[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, + body: UpdateUser, ) -> ErrorsList | UserResponse | None: """Update a user @@ -172,14 +168,14 @@ async def asyncio( Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): 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: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/verified_domains/__init__.py b/rootly_sdk/api/verified_domains/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/verified_domains/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py new file mode 100644 index 00000000..26993025 --- /dev/null +++ b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py @@ -0,0 +1,149 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verified_domain_response import VerifiedDomainResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/verified_domains/{id}", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainResponse | None: + if response.status_code == 200: + response_200 = VerifiedDomainResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[VerifiedDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Delete a verified domain + + Args: + id (str): + + 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[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> VerifiedDomainResponse | None: + """Delete a verified domain + + Args: + id (str): + + 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: + VerifiedDomainResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Delete a verified domain + + Args: + id (str): + + 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[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> VerifiedDomainResponse | None: + """Delete a verified domain + + Args: + id (str): + + 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: + VerifiedDomainResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py new file mode 100644 index 00000000..895c23d9 --- /dev/null +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verified_domain_list import VerifiedDomainList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + 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": "/v1/verified_domains", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainList | None: + if response.status_code == 200: + response_200 = VerifiedDomainList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[VerifiedDomainList]: + 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, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[VerifiedDomainList]: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[VerifiedDomainList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> VerifiedDomainList | None: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + VerifiedDomainList + """ + + return sync_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[VerifiedDomainList]: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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[VerifiedDomainList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> VerifiedDomainList | None: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + 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: + VerifiedDomainList + """ + + return ( + await asyncio_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py new file mode 100644 index 00000000..bfeaf46e --- /dev/null +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py @@ -0,0 +1,149 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verified_domain_response import VerifiedDomainResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/verified_domains/{id}", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainResponse | None: + if response.status_code == 200: + response_200 = VerifiedDomainResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[VerifiedDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Show a verified domain + + Args: + id (str): + + 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[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> VerifiedDomainResponse | None: + """Show a verified domain + + Args: + id (str): + + 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: + VerifiedDomainResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Show a verified domain + + Args: + id (str): + + 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[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> VerifiedDomainResponse | None: + """Show a verified domain + + Args: + id (str): + + 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: + VerifiedDomainResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/verified_domains/post_v1_verified_domains.py b/rootly_sdk/api/verified_domains/post_v1_verified_domains.py new file mode 100644 index 00000000..ef9418fd --- /dev/null +++ b/rootly_sdk/api/verified_domains/post_v1_verified_domains.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.new_verified_domain import NewVerifiedDomain +from ...models.verified_domain_response import VerifiedDomainResponse +from ...types import Response + + +def _get_kwargs( + *, + body: NewVerifiedDomain, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/verified_domains", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainResponse | None: + if response.status_code == 201: + response_201 = VerifiedDomainResponse.from_dict(response.json()) + + return response_201 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[VerifiedDomainResponse]: + 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: NewVerifiedDomain, +) -> Response[VerifiedDomainResponse]: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + 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[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: NewVerifiedDomain, +) -> VerifiedDomainResponse | None: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + 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: + VerifiedDomainResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: NewVerifiedDomain, +) -> Response[VerifiedDomainResponse]: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + 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[VerifiedDomainResponse] + """ + + 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: NewVerifiedDomain, +) -> VerifiedDomainResponse | None: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + 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: + VerifiedDomainResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py index 4e61f403..668768b5 100644 --- a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,12 +12,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/webhooks/deliveries/{id}/deliver".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/deliveries/{id}/deliver", } return _kwargs diff --git a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py index 6bcff9b9..f2dd25c1 100644 --- a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/webhooks/deliveries/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/deliveries/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksDeliveryResponse] + Response[Union[ErrorsList, WebhooksDeliveryResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksDeliveryResponse + Union[ErrorsList, WebhooksDeliveryResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksDeliveryResponse] + Response[Union[ErrorsList, WebhooksDeliveryResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksDeliveryResponse + Union[ErrorsList, WebhooksDeliveryResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py index a333135e..406eb177 100644 --- a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py +++ b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py @@ -1,11 +1,12 @@ +import datetime from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx from ... import errors from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList from ...models.webhooks_delivery_list import WebhooksDeliveryList from ...types import UNSET, Response, Unset @@ -13,11 +14,19 @@ def _get_kwargs( endpoint_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -26,25 +35,72 @@ def _get_kwargs( params["page[size]"] = pagesize + params["filter[status]"] = filterstatus + + json_filtercreated_atgt: Unset | str = UNSET + if not isinstance(filtercreated_atgt, Unset): + json_filtercreated_atgt = filtercreated_atgt.isoformat() + params["filter[created_at][gt]"] = json_filtercreated_atgt + + json_filtercreated_atgte: Unset | str = UNSET + if not isinstance(filtercreated_atgte, Unset): + json_filtercreated_atgte = filtercreated_atgte.isoformat() + params["filter[created_at][gte]"] = json_filtercreated_atgte + + json_filtercreated_atlt: Unset | str = UNSET + if not isinstance(filtercreated_atlt, Unset): + json_filtercreated_atlt = filtercreated_atlt.isoformat() + params["filter[created_at][lt]"] = json_filtercreated_atlt + + json_filtercreated_atlte: Unset | str = UNSET + if not isinstance(filtercreated_atlte, Unset): + json_filtercreated_atlte = filtercreated_atlte.isoformat() + params["filter[created_at][lte]"] = json_filtercreated_atlte + + json_filterdelivered_atgt: Unset | str = UNSET + if not isinstance(filterdelivered_atgt, Unset): + json_filterdelivered_atgt = filterdelivered_atgt.isoformat() + params["filter[delivered_at][gt]"] = json_filterdelivered_atgt + + json_filterdelivered_atgte: Unset | str = UNSET + if not isinstance(filterdelivered_atgte, Unset): + json_filterdelivered_atgte = filterdelivered_atgte.isoformat() + params["filter[delivered_at][gte]"] = json_filterdelivered_atgte + + json_filterdelivered_atlt: Unset | str = UNSET + if not isinstance(filterdelivered_atlt, Unset): + json_filterdelivered_atlt = filterdelivered_atlt.isoformat() + params["filter[delivered_at][lt]"] = json_filterdelivered_atlt + + json_filterdelivered_atlte: Unset | str = UNSET + if not isinstance(filterdelivered_atlte, Unset): + json_filterdelivered_atlte = filterdelivered_atlte.isoformat() + params["filter[delivered_at][lte]"] = json_filterdelivered_atlte + 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": "/v1/webhooks/endpoints/{endpoint_id}/deliveries".format( - endpoint_id=quote(str(endpoint_id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{endpoint_id}/deliveries", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WebhooksDeliveryList | None: +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksDeliveryList | None: if response.status_code == 200: response_200 = WebhooksDeliveryList.from_dict(response.json()) return response_200 + if response.status_code == 400: + response_400 = ErrorsList.from_dict(response.json()) + + return response_400 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -53,7 +109,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[WebhooksDeliveryList]: +) -> Response[ErrorsList | WebhooksDeliveryList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,26 +122,44 @@ def sync_detailed( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[WebhooksDeliveryList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> Response[ErrorsList | WebhooksDeliveryList]: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): 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[WebhooksDeliveryList] + Response[Union[ErrorsList, WebhooksDeliveryList]] """ kwargs = _get_kwargs( @@ -93,6 +167,15 @@ def sync_detailed( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ) response = client.get_httpx_client().request( @@ -106,26 +189,44 @@ def sync( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WebhooksDeliveryList | None: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> ErrorsList | WebhooksDeliveryList | None: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): 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: - WebhooksDeliveryList + Union[ErrorsList, WebhooksDeliveryList] """ return sync_detailed( @@ -134,6 +235,15 @@ def sync( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ).parsed @@ -141,26 +251,44 @@ async def asyncio_detailed( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[WebhooksDeliveryList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> Response[ErrorsList | WebhooksDeliveryList]: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): 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[WebhooksDeliveryList] + Response[Union[ErrorsList, WebhooksDeliveryList]] """ kwargs = _get_kwargs( @@ -168,6 +296,15 @@ async def asyncio_detailed( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -179,26 +316,44 @@ async def asyncio( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WebhooksDeliveryList | None: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> ErrorsList | WebhooksDeliveryList | None: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): 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: - WebhooksDeliveryList + Union[ErrorsList, WebhooksDeliveryList] """ return ( @@ -208,5 +363,14 @@ async def asyncio( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ) ).parsed diff --git a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py index cbe5aec3..a17df666 100644 --- a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py index 080d170b..05ed1579 100644 --- a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/webhooks/endpoints/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py index 548a6545..9030cf93 100644 --- a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/webhooks/endpoints/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py index 6db925f4..b3665ca8 100644 --- a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py +++ b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py @@ -11,13 +11,12 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -67,22 +66,22 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -110,22 +109,22 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> WebhooksEndpointList | None: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,22 +147,22 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -189,22 +188,22 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> WebhooksEndpointList | None: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py index e1d1f110..daeca8b2 100644 --- a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/webhooks/endpoints/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py index 6f1732ff..716282fc 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any, cast -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/action_item_form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/action_item_form_field_conditions", } _kwargs["json"] = body.to_dict() @@ -92,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -126,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -155,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py index fac3f287..4e92ec96 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_action_item_form_field_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py index b9d2d505..c1e9e0cc 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_action_item_form_field_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py index f1e23abb..e5cbae29 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/action_item_form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/action_item_form_field_conditions", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -78,9 +74,9 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> WorkflowActionItemFormFieldConditionList | None: """List workflow action item form field conditions @@ -118,9 +114,9 @@ def sync( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> WorkflowActionItemFormFieldConditionList | None: """List workflow action item form field conditions @@ -191,9 +187,9 @@ async def asyncio( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py index d85c85c9..44851c12 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_action_item_form_field_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py index 66473fdd..6fd39430 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/form_field_conditions", } _kwargs["json"] = body.to_dict() @@ -47,6 +44,11 @@ def _parse_response( return response_401 + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -83,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -146,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py index c0bdb34a..d8a84656 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_form_field_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py index 9e3dbac4..a5e5f940 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_form_field_conditions/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py b/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py index 2bca4f9a..9b10918e 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py +++ b/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,11 +12,10 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/form_field_conditions", "params": params, } @@ -68,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -78,9 +74,9 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,9 +104,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> WorkflowFormFieldConditionList | None: """List workflow form field conditions @@ -118,9 +114,9 @@ def sync( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,9 +177,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> WorkflowFormFieldConditionList | None: """List workflow form field conditions @@ -191,9 +187,9 @@ async def asyncio( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py index 0ba30270..5c3f0de6 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_form_field_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -47,6 +44,11 @@ def _parse_response( return response_404 + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -83,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -117,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -146,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -178,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/create_workflow_group.py b/rootly_sdk/api/workflow_groups/create_workflow_group.py index 33784b56..75cea8c3 100644 --- a/rootly_sdk/api/workflow_groups/create_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/create_workflow_group.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/delete_workflow_group.py b/rootly_sdk/api/workflow_groups/delete_workflow_group.py index 46a16891..8537c97c 100644 --- a/rootly_sdk/api/workflow_groups/delete_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/delete_workflow_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_groups/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/get_workflow_group.py b/rootly_sdk/api/workflow_groups/get_workflow_group.py index 2484f46b..ef87b467 100644 --- a/rootly_sdk/api/workflow_groups/get_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/get_workflow_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_groups/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/list_workflow_groups.py b/rootly_sdk/api/workflow_groups/list_workflow_groups.py index 4a20aac8..26a08737 100644 --- a/rootly_sdk/api/workflow_groups/list_workflow_groups.py +++ b/rootly_sdk/api/workflow_groups/list_workflow_groups.py @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -77,30 +76,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> Response[WorkflowGroupList]: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +131,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> WorkflowGroupList | None: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +181,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> Response[WorkflowGroupList]: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +234,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> WorkflowGroupList | None: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_groups/update_workflow_group.py b/rootly_sdk/api/workflow_groups/update_workflow_group.py index f1922d9a..2338e429 100644 --- a/rootly_sdk/api/workflow_groups/update_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/update_workflow_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_groups/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_runs/create_workflow_run.py b/rootly_sdk/api/workflow_runs/create_workflow_run.py index 70d53a0f..8876080e 100644 --- a/rootly_sdk/api/workflow_runs/create_workflow_run.py +++ b/rootly_sdk/api/workflow_runs/create_workflow_run.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/workflow_runs".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_runs", } _kwargs["json"] = body.to_dict() @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowRunResponse] + Response[Union[ErrorsList, WorkflowRunResponse]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowRunResponse + Union[ErrorsList, WorkflowRunResponse] """ return sync_detailed( @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowRunResponse] + Response[Union[ErrorsList, WorkflowRunResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowRunResponse + Union[ErrorsList, WorkflowRunResponse] """ return ( diff --git a/rootly_sdk/api/workflow_runs/list_workflow_runs.py b/rootly_sdk/api/workflow_runs/list_workflow_runs.py index 236adc68..4c1bf17f 100644 --- a/rootly_sdk/api/workflow_runs/list_workflow_runs.py +++ b/rootly_sdk/api/workflow_runs/list_workflow_runs.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,18 +13,17 @@ def _get_kwargs( workflow_id: str, *, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -47,9 +45,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/workflow_runs".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_runs", "params": params, } @@ -81,13 +77,13 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -95,13 +91,13 @@ def sync_detailed( Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,13 +129,13 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> WorkflowRunsList | None: """List workflow runs @@ -147,13 +143,13 @@ def sync( Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -180,13 +176,13 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -194,13 +190,13 @@ async def asyncio_detailed( Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -230,13 +226,13 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> WorkflowRunsList | None: """List workflow runs @@ -244,13 +240,13 @@ async def asyncio( Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_tasks/create_workflow_task.py b/rootly_sdk/api/workflow_tasks/create_workflow_task.py index cc51608f..6a5588e5 100644 --- a/rootly_sdk/api/workflow_tasks/create_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/create_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/workflow_tasks".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_tasks", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py index 5c119fa1..b5db52c2 100644 --- a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_tasks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflow_tasks/get_workflow_task.py b/rootly_sdk/api/workflow_tasks/get_workflow_task.py index d2ceba25..1e2d3735 100644 --- a/rootly_sdk/api/workflow_tasks/get_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/get_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -14,12 +13,9 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_tasks/{id}", } return _kwargs @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py index cc404c3a..dedb18a3 100644 --- a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py +++ b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -13,22 +12,21 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -63,9 +61,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/workflow_tasks".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_tasks", "params": params, } @@ -97,20 +93,20 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -118,20 +114,20 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,20 +166,20 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> WorkflowTaskList | None: """List workflow tasks @@ -191,20 +187,20 @@ def sync( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -238,20 +234,20 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -259,20 +255,20 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -309,20 +305,20 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> WorkflowTaskList | None: """List workflow tasks @@ -330,20 +326,20 @@ async def asyncio( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_tasks/update_workflow_task.py b/rootly_sdk/api/workflow_tasks/update_workflow_task.py index 3b045b86..51e59bd2 100644 --- a/rootly_sdk/api/workflow_tasks/update_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/update_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_tasks/{id}", } _kwargs["json"] = body.to_dict() @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflows/create_workflow.py b/rootly_sdk/api/workflows/create_workflow.py index 2db8a745..df1267c7 100644 --- a/rootly_sdk/api/workflows/create_workflow.py +++ b/rootly_sdk/api/workflows/create_workflow.py @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/api/workflows/delete_workflow.py b/rootly_sdk/api/workflows/delete_workflow.py index c407da66..88b7e2a2 100644 --- a/rootly_sdk/api/workflows/delete_workflow.py +++ b/rootly_sdk/api/workflows/delete_workflow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -13,14 +12,11 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflows/{id}", } return _kwargs @@ -57,7 +53,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | WorkflowResponse]: @@ -66,14 +62,14 @@ def sync_detailed( Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | WorkflowResponse | None: @@ -97,14 +93,14 @@ def sync( Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[ErrorsList | WorkflowResponse]: @@ -123,14 +119,14 @@ async def asyncio_detailed( Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): 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[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, ) -> ErrorsList | WorkflowResponse | None: @@ -152,14 +148,14 @@ async def asyncio( Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): 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: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/api/workflows/get_workflow.py b/rootly_sdk/api/workflows/get_workflow.py index 905edf81..87dfb81a 100644 --- a/rootly_sdk/api/workflows/get_workflow.py +++ b/rootly_sdk/api/workflows/get_workflow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, - include: GetWorkflowInclude | Unset = UNSET, + include: Unset | GetWorkflowInclude = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflows/{id}", "params": params, } @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, + include: Unset | GetWorkflowInclude = UNSET, ) -> Response[ErrorsList | WorkflowResponse]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): 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[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, + include: Unset | GetWorkflowInclude = UNSET, ) -> ErrorsList | WorkflowResponse | None: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): 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: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, + include: Unset | GetWorkflowInclude = UNSET, ) -> Response[ErrorsList | WorkflowResponse]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): 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[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, + include: Unset | GetWorkflowInclude = UNSET, ) -> ErrorsList | WorkflowResponse | None: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): 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: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/api/workflows/list_workflows.py b/rootly_sdk/api/workflows/list_workflows.py index 8b9f0bb3..96900f54 100644 --- a/rootly_sdk/api/workflows/list_workflows.py +++ b/rootly_sdk/api/workflows/list_workflows.py @@ -13,36 +13,35 @@ def _get_kwargs( *, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -117,50 +116,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[WorkflowList]: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -202,50 +201,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> WorkflowList | None: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -282,50 +281,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[WorkflowList]: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -365,50 +364,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> WorkflowList | None: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflows/update_workflow.py b/rootly_sdk/api/workflows/update_workflow.py index aa48bba6..d2ac8854 100644 --- a/rootly_sdk/api/workflows/update_workflow.py +++ b/rootly_sdk/api/workflows/update_workflow.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: UUID | str, *, body: UpdateWorkflow, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflows/{id}", } _kwargs["json"] = body.to_dict() @@ -71,7 +68,7 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -81,7 +78,7 @@ def sync_detailed( Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -105,7 +102,7 @@ def sync_detailed( def sync( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -115,7 +112,7 @@ def sync( Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -134,7 +131,7 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -144,7 +141,7 @@ async def asyncio_detailed( Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -152,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -166,7 +163,7 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -176,7 +173,7 @@ async def asyncio( Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -184,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/client.py b/rootly_sdk/client.py index 1b7055ab..3f312fb1 100644 --- a/rootly_sdk/client.py +++ b/rootly_sdk/client.py @@ -62,7 +62,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 configuration""" + """Get a new client matching this one with a new timeout (in seconds)""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -101,7 +101,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 set the underlying httpx.AsyncClient + """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ @@ -196,7 +196,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 configuration""" + """Get a new client matching this one with a new timeout (in seconds)""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -236,7 +236,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) -> "AuthenticatedClient": - """Manually set the underlying httpx.AsyncClient + """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ diff --git a/rootly_sdk/models/__init__.py b/rootly_sdk/models/__init__.py index 52d5e241..171285a1 100644 --- a/rootly_sdk/models/__init__.py +++ b/rootly_sdk/models/__init__.py @@ -158,6 +158,17 @@ from .alert_response import AlertResponse from .alert_response_data import AlertResponseData from .alert_response_data_type import AlertResponseDataType +from .alert_retrigger_rule import AlertRetriggerRule +from .alert_retrigger_rule_conditions_item import AlertRetriggerRuleConditionsItem +from .alert_retrigger_rule_conditions_item_kind import AlertRetriggerRuleConditionsItemKind +from .alert_retrigger_rule_conditions_item_operator import AlertRetriggerRuleConditionsItemOperator +from .alert_retrigger_rule_list import AlertRetriggerRuleList +from .alert_retrigger_rule_list_data_item import AlertRetriggerRuleListDataItem +from .alert_retrigger_rule_list_data_item_type import AlertRetriggerRuleListDataItemType +from .alert_retrigger_rule_match_mode import AlertRetriggerRuleMatchMode +from .alert_retrigger_rule_response import AlertRetriggerRuleResponse +from .alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData +from .alert_retrigger_rule_response_data_type import AlertRetriggerRuleResponseDataType from .alert_route import AlertRoute from .alert_route_list import AlertRouteList from .alert_route_list_data_item import AlertRouteListDataItem @@ -330,6 +341,12 @@ AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem, ) from .attach_datadog_dashboards_task_params_task_type import AttachDatadogDashboardsTaskParamsTaskType +from .attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, +) +from .attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, +) from .attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from .attach_retrospective_pdf_to_jira_issue_task_params_integration import ( AttachRetrospectivePdfToJiraIssueTaskParamsIntegration, @@ -361,15 +378,15 @@ from .auto_assign_role_pagerduty_task_params_type_1_escalation_policy import ( AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy, ) -from .auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams -from .auto_assign_role_rootly_task_params_escalation_policy_target import ( - AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget, +from .auto_assign_role_rootly_task_params_type_0_escalation_policy_target import ( + AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget, +) +from .auto_assign_role_rootly_task_params_type_1_service_target import AutoAssignRoleRootlyTaskParamsType1ServiceTarget +from .auto_assign_role_rootly_task_params_type_2_user_target import AutoAssignRoleRootlyTaskParamsType2UserTarget +from .auto_assign_role_rootly_task_params_type_3_group_target import AutoAssignRoleRootlyTaskParamsType3GroupTarget +from .auto_assign_role_rootly_task_params_type_4_schedule_target import ( + AutoAssignRoleRootlyTaskParamsType4ScheduleTarget, ) -from .auto_assign_role_rootly_task_params_group_target import AutoAssignRoleRootlyTaskParamsGroupTarget -from .auto_assign_role_rootly_task_params_schedule_target import AutoAssignRoleRootlyTaskParamsScheduleTarget -from .auto_assign_role_rootly_task_params_service_target import AutoAssignRoleRootlyTaskParamsServiceTarget -from .auto_assign_role_rootly_task_params_task_type import AutoAssignRoleRootlyTaskParamsTaskType -from .auto_assign_role_rootly_task_params_user_target import AutoAssignRoleRootlyTaskParamsUserTarget from .auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from .auto_assign_role_victor_ops_task_params_task_type import AutoAssignRoleVictorOpsTaskParamsTaskType from .auto_assign_role_victor_ops_task_params_team import AutoAssignRoleVictorOpsTaskParamsTeam @@ -627,6 +644,7 @@ from .create_asana_task_task_params_task_type import CreateAsanaTaskTaskParamsTaskType from .create_asana_task_task_params_workspace import CreateAsanaTaskTaskParamsWorkspace from .create_clickup_task_task_params import CreateClickupTaskTaskParams +from .create_clickup_task_task_params_list import CreateClickupTaskTaskParamsList from .create_clickup_task_task_params_priority import CreateClickupTaskTaskParamsPriority from .create_clickup_task_task_params_task_type import CreateClickupTaskTaskParamsTaskType from .create_coda_page_task_params import CreateCodaPageTaskParams @@ -868,6 +886,7 @@ from .custom_field_option_response_data import CustomFieldOptionResponseData from .custom_field_option_response_data_type import CustomFieldOptionResponseDataType from .custom_field_required_type_0_item import CustomFieldRequiredType0Item +from .custom_field_resource_type import CustomFieldResourceType from .custom_field_response import CustomFieldResponse from .custom_field_response_data import CustomFieldResponseData from .custom_field_response_data_type import CustomFieldResponseDataType @@ -984,6 +1003,12 @@ from .escalation_policy_level_notification_target_params_item_type_0_type import ( EscalationPolicyLevelNotificationTargetParamsItemType0Type, ) +from .escalation_policy_level_paging_strategy_configuration_repeats_mode import ( + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, +) +from .escalation_policy_level_paging_strategy_configuration_rotation_scope import ( + EscalationPolicyLevelPagingStrategyConfigurationRotationScope, +) from .escalation_policy_level_paging_strategy_configuration_schedule_strategy import ( EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy, ) @@ -1121,6 +1146,7 @@ from .form_field_position_response import FormFieldPositionResponse from .form_field_position_response_data import FormFieldPositionResponseData from .form_field_position_response_data_type import FormFieldPositionResponseDataType +from .form_field_resource_type import FormFieldResourceType from .form_field_response import FormFieldResponse from .form_field_response_data import FormFieldResponseData from .form_field_response_data_type import FormFieldResponseDataType @@ -1338,6 +1364,10 @@ from .incident_status_page_event_response_data import IncidentStatusPageEventResponseData from .incident_status_page_event_response_data_type import IncidentStatusPageEventResponseDataType from .incident_status_page_event_status import IncidentStatusPageEventStatus +from .incident_status_page_event_status_page_components_item import IncidentStatusPageEventStatusPageComponentsItem +from .incident_status_page_event_status_page_components_item_status import ( + IncidentStatusPageEventStatusPageComponentsItemStatus, +) from .incident_sub_status import IncidentSubStatus from .incident_sub_status_list import IncidentSubStatusList from .incident_sub_status_list_data_item import IncidentSubStatusListDataItem @@ -1600,6 +1630,19 @@ from .new_alert_group_data_attributes_targets_item import NewAlertGroupDataAttributesTargetsItem from .new_alert_group_data_attributes_targets_item_target_type import NewAlertGroupDataAttributesTargetsItemTargetType from .new_alert_group_data_type import NewAlertGroupDataType +from .new_alert_retrigger_rule import NewAlertRetriggerRule +from .new_alert_retrigger_rule_data import NewAlertRetriggerRuleData +from .new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes +from .new_alert_retrigger_rule_data_attributes_conditions_item import NewAlertRetriggerRuleDataAttributesConditionsItem +from .new_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + NewAlertRetriggerRuleDataAttributesConditionsItemKind, +) +from .new_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + NewAlertRetriggerRuleDataAttributesConditionsItemOperator, +) +from .new_alert_retrigger_rule_data_attributes_match_mode import NewAlertRetriggerRuleDataAttributesMatchMode +from .new_alert_retrigger_rule_data_attributes_timeout_minutes import NewAlertRetriggerRuleDataAttributesTimeoutMinutes +from .new_alert_retrigger_rule_data_type import NewAlertRetriggerRuleDataType from .new_alert_route import NewAlertRoute from .new_alert_route_data import NewAlertRouteData from .new_alert_route_data_attributes import NewAlertRouteDataAttributes @@ -1914,6 +1957,12 @@ from .new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type import ( NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type, ) +from .new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, +) +from .new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, +) from .new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, ) @@ -2160,6 +2209,12 @@ from .new_incident_status_page_event_data import NewIncidentStatusPageEventData from .new_incident_status_page_event_data_attributes import NewIncidentStatusPageEventDataAttributes from .new_incident_status_page_event_data_attributes_status import NewIncidentStatusPageEventDataAttributesStatus +from .new_incident_status_page_event_data_attributes_status_page_components_type_0_item import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item, +) +from .new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus, +) from .new_incident_status_page_event_data_type import NewIncidentStatusPageEventDataType from .new_incident_sub_status import NewIncidentSubStatus from .new_incident_sub_status_data import NewIncidentSubStatusData @@ -2479,6 +2534,19 @@ ) from .new_sla_data_type import NewSlaDataType from .new_status_page import NewStatusPage +from .new_status_page_announcement import NewStatusPageAnnouncement +from .new_status_page_announcement_data import NewStatusPageAnnouncementData +from .new_status_page_announcement_data_attributes import NewStatusPageAnnouncementDataAttributes +from .new_status_page_announcement_data_type import NewStatusPageAnnouncementDataType +from .new_status_page_component import NewStatusPageComponent +from .new_status_page_component_data import NewStatusPageComponentData +from .new_status_page_component_data_attributes import NewStatusPageComponentDataAttributes +from .new_status_page_component_data_attributes_source_type import NewStatusPageComponentDataAttributesSourceType +from .new_status_page_component_data_type import NewStatusPageComponentDataType +from .new_status_page_component_group import NewStatusPageComponentGroup +from .new_status_page_component_group_data import NewStatusPageComponentGroupData +from .new_status_page_component_group_data_attributes import NewStatusPageComponentGroupDataAttributes +from .new_status_page_component_group_data_type import NewStatusPageComponentGroupDataType from .new_status_page_data import NewStatusPageData from .new_status_page_data_attributes import NewStatusPageDataAttributes from .new_status_page_data_attributes_authentication_method import NewStatusPageDataAttributesAuthenticationMethod @@ -2526,6 +2594,10 @@ from .new_user_phone_number_data import NewUserPhoneNumberData from .new_user_phone_number_data_attributes import NewUserPhoneNumberDataAttributes from .new_user_phone_number_data_type import NewUserPhoneNumberDataType +from .new_verified_domain import NewVerifiedDomain +from .new_verified_domain_data import NewVerifiedDomainData +from .new_verified_domain_data_attributes import NewVerifiedDomainDataAttributes +from .new_verified_domain_data_type import NewVerifiedDomainDataType from .new_webhooks_endpoint import NewWebhooksEndpoint from .new_webhooks_endpoint_data import NewWebhooksEndpointData from .new_webhooks_endpoint_data_attributes import NewWebhooksEndpointDataAttributes @@ -3157,8 +3229,30 @@ from .status_list_data_item import StatusListDataItem from .status_list_data_item_type import StatusListDataItemType from .status_page import StatusPage +from .status_page_announcement import StatusPageAnnouncement +from .status_page_announcement_list import StatusPageAnnouncementList +from .status_page_announcement_list_data_item import StatusPageAnnouncementListDataItem +from .status_page_announcement_list_data_item_type import StatusPageAnnouncementListDataItemType +from .status_page_announcement_response import StatusPageAnnouncementResponse +from .status_page_announcement_response_data import StatusPageAnnouncementResponseData +from .status_page_announcement_response_data_type import StatusPageAnnouncementResponseDataType from .status_page_authentication_method import StatusPageAuthenticationMethod from .status_page_cname_records_type_0 import StatusPageCnameRecordsType0 +from .status_page_component import StatusPageComponent +from .status_page_component_group import StatusPageComponentGroup +from .status_page_component_group_list import StatusPageComponentGroupList +from .status_page_component_group_list_data_item import StatusPageComponentGroupListDataItem +from .status_page_component_group_list_data_item_type import StatusPageComponentGroupListDataItemType +from .status_page_component_group_response import StatusPageComponentGroupResponse +from .status_page_component_group_response_data import StatusPageComponentGroupResponseData +from .status_page_component_group_response_data_type import StatusPageComponentGroupResponseDataType +from .status_page_component_list import StatusPageComponentList +from .status_page_component_list_data_item import StatusPageComponentListDataItem +from .status_page_component_list_data_item_type import StatusPageComponentListDataItemType +from .status_page_component_response import StatusPageComponentResponse +from .status_page_component_response_data import StatusPageComponentResponseData +from .status_page_component_response_data_type import StatusPageComponentResponseDataType +from .status_page_component_status import StatusPageComponentStatus from .status_page_list import StatusPageList from .status_page_list_data_item import StatusPageListDataItem from .status_page_list_data_item_type import StatusPageListDataItemType @@ -3265,6 +3359,23 @@ UpdateAlertGroupDataAttributesTargetsItemTargetType, ) from .update_alert_group_data_type import UpdateAlertGroupDataType +from .update_alert_retrigger_rule import UpdateAlertRetriggerRule +from .update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData +from .update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes +from .update_alert_retrigger_rule_data_attributes_conditions_item import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItem, +) +from .update_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemKind, +) +from .update_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator, +) +from .update_alert_retrigger_rule_data_attributes_match_mode import UpdateAlertRetriggerRuleDataAttributesMatchMode +from .update_alert_retrigger_rule_data_attributes_timeout_minutes import ( + UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes, +) +from .update_alert_retrigger_rule_data_type import UpdateAlertRetriggerRuleDataType from .update_alert_route import UpdateAlertRoute from .update_alert_route_data import UpdateAlertRouteData from .update_alert_route_data_attributes import UpdateAlertRouteDataAttributes @@ -3608,6 +3719,12 @@ from .update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type import ( UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type, ) +from .update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, +) +from .update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, +) from .update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, ) @@ -4436,6 +4553,18 @@ from .update_slack_channel_topic_task_params_channel import UpdateSlackChannelTopicTaskParamsChannel from .update_slack_channel_topic_task_params_task_type import UpdateSlackChannelTopicTaskParamsTaskType from .update_status_page import UpdateStatusPage +from .update_status_page_announcement import UpdateStatusPageAnnouncement +from .update_status_page_announcement_data import UpdateStatusPageAnnouncementData +from .update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes +from .update_status_page_announcement_data_type import UpdateStatusPageAnnouncementDataType +from .update_status_page_component import UpdateStatusPageComponent +from .update_status_page_component_data import UpdateStatusPageComponentData +from .update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes +from .update_status_page_component_data_type import UpdateStatusPageComponentDataType +from .update_status_page_component_group import UpdateStatusPageComponentGroup +from .update_status_page_component_group_data import UpdateStatusPageComponentGroupData +from .update_status_page_component_group_data_attributes import UpdateStatusPageComponentGroupDataAttributes +from .update_status_page_component_group_data_type import UpdateStatusPageComponentGroupDataType from .update_status_page_data import UpdateStatusPageData from .update_status_page_data_attributes import UpdateStatusPageDataAttributes from .update_status_page_data_attributes_authentication_method import UpdateStatusPageDataAttributesAuthenticationMethod @@ -4590,6 +4719,15 @@ from .user_response import UserResponse from .user_response_data import UserResponseData from .user_response_data_type import UserResponseDataType +from .verified_domain import VerifiedDomain +from .verified_domain_list import VerifiedDomainList +from .verified_domain_list_data_item import VerifiedDomainListDataItem +from .verified_domain_list_data_item_type import VerifiedDomainListDataItemType +from .verified_domain_response import VerifiedDomainResponse +from .verified_domain_response_data import VerifiedDomainResponseData +from .verified_domain_response_data_type import VerifiedDomainResponseDataType +from .verified_domain_source import VerifiedDomainSource +from .verified_domain_verification_status import VerifiedDomainVerificationStatus from .verify_phone_number_request import VerifyPhoneNumberRequest from .webhooks_delivery import WebhooksDelivery from .webhooks_delivery_list import WebhooksDeliveryList @@ -4598,6 +4736,7 @@ from .webhooks_delivery_response import WebhooksDeliveryResponse from .webhooks_delivery_response_data import WebhooksDeliveryResponseData from .webhooks_delivery_response_data_type import WebhooksDeliveryResponseDataType +from .webhooks_delivery_status import WebhooksDeliveryStatus from .webhooks_endpoint import WebhooksEndpoint from .webhooks_endpoint_custom_headers_item import WebhooksEndpointCustomHeadersItem from .webhooks_endpoint_event_types_item import WebhooksEndpointEventTypesItem @@ -4794,6 +4933,17 @@ "AlertResponse", "AlertResponseData", "AlertResponseDataType", + "AlertRetriggerRule", + "AlertRetriggerRuleConditionsItem", + "AlertRetriggerRuleConditionsItemKind", + "AlertRetriggerRuleConditionsItemOperator", + "AlertRetriggerRuleList", + "AlertRetriggerRuleListDataItem", + "AlertRetriggerRuleListDataItemType", + "AlertRetriggerRuleMatchMode", + "AlertRetriggerRuleResponse", + "AlertRetriggerRuleResponseData", + "AlertRetriggerRuleResponseDataType", "AlertRoute", "AlertRouteList", "AlertRouteListDataItem", @@ -4916,6 +5066,8 @@ "AttachDatadogDashboardsTaskParamsDashboardsItem", "AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem", "AttachDatadogDashboardsTaskParamsTaskType", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType", "AttachRetrospectivePdfToJiraIssueTaskParams", "AttachRetrospectivePdfToJiraIssueTaskParamsIntegration", "AttachRetrospectivePdfToJiraIssueTaskParamsTaskType", @@ -4941,13 +5093,11 @@ "AutoAssignRoleOpsgenieTaskParamsTaskType", "AutoAssignRolePagerdutyTaskParamsType0Schedule", "AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy", - "AutoAssignRoleRootlyTaskParams", - "AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget", - "AutoAssignRoleRootlyTaskParamsGroupTarget", - "AutoAssignRoleRootlyTaskParamsScheduleTarget", - "AutoAssignRoleRootlyTaskParamsServiceTarget", - "AutoAssignRoleRootlyTaskParamsTaskType", - "AutoAssignRoleRootlyTaskParamsUserTarget", + "AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget", + "AutoAssignRoleRootlyTaskParamsType1ServiceTarget", + "AutoAssignRoleRootlyTaskParamsType2UserTarget", + "AutoAssignRoleRootlyTaskParamsType3GroupTarget", + "AutoAssignRoleRootlyTaskParamsType4ScheduleTarget", "AutoAssignRoleVictorOpsTaskParams", "AutoAssignRoleVictorOpsTaskParamsTaskType", "AutoAssignRoleVictorOpsTaskParamsTeam", @@ -5171,6 +5321,7 @@ "CreateAsanaTaskTaskParamsTaskType", "CreateAsanaTaskTaskParamsWorkspace", "CreateClickupTaskTaskParams", + "CreateClickupTaskTaskParamsList", "CreateClickupTaskTaskParamsPriority", "CreateClickupTaskTaskParamsTaskType", "CreateCodaPageTaskParams", @@ -5382,6 +5533,7 @@ "CustomFieldOptionResponseData", "CustomFieldOptionResponseDataType", "CustomFieldRequiredType0Item", + "CustomFieldResourceType", "CustomFieldResponse", "CustomFieldResponseData", "CustomFieldResponseDataType", @@ -5474,6 +5626,8 @@ "EscalationPolicyLevelNotificationTargetParamsItemType0", "EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers", "EscalationPolicyLevelNotificationTargetParamsItemType0Type", + "EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode", + "EscalationPolicyLevelPagingStrategyConfigurationRotationScope", "EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy", "EscalationPolicyLevelPagingStrategyConfigurationStrategy", "EscalationPolicyLevelResponse", @@ -5603,6 +5757,7 @@ "FormFieldPositionResponse", "FormFieldPositionResponseData", "FormFieldPositionResponseDataType", + "FormFieldResourceType", "FormFieldResponse", "FormFieldResponseData", "FormFieldResponseDataType", @@ -5817,6 +5972,8 @@ "IncidentStatusPageEventResponseData", "IncidentStatusPageEventResponseDataType", "IncidentStatusPageEventStatus", + "IncidentStatusPageEventStatusPageComponentsItem", + "IncidentStatusPageEventStatusPageComponentsItemStatus", "IncidentSubStatus", "IncidentSubStatusList", "IncidentSubStatusListDataItem", @@ -6030,6 +6187,15 @@ "NewAlertGroupDataAttributesTargetsItem", "NewAlertGroupDataAttributesTargetsItemTargetType", "NewAlertGroupDataType", + "NewAlertRetriggerRule", + "NewAlertRetriggerRuleData", + "NewAlertRetriggerRuleDataAttributes", + "NewAlertRetriggerRuleDataAttributesConditionsItem", + "NewAlertRetriggerRuleDataAttributesConditionsItemKind", + "NewAlertRetriggerRuleDataAttributesConditionsItemOperator", + "NewAlertRetriggerRuleDataAttributesMatchMode", + "NewAlertRetriggerRuleDataAttributesTimeoutMinutes", + "NewAlertRetriggerRuleDataType", "NewAlertRoute", "NewAlertRouteData", "NewAlertRouteDataAttributes", @@ -6228,6 +6394,8 @@ "NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", "NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers", "NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type", + "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode", + "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope", "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy", "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy", "NewEscalationPolicyLevelDataType", @@ -6390,6 +6558,8 @@ "NewIncidentStatusPageEventData", "NewIncidentStatusPageEventDataAttributes", "NewIncidentStatusPageEventDataAttributesStatus", + "NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item", + "NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus", "NewIncidentStatusPageEventDataType", "NewIncidentSubStatus", "NewIncidentSubStatusData", @@ -6605,6 +6775,19 @@ "NewSlaDataAttributesNotificationConfigurationsItemOffsetType", "NewSlaDataType", "NewStatusPage", + "NewStatusPageAnnouncement", + "NewStatusPageAnnouncementData", + "NewStatusPageAnnouncementDataAttributes", + "NewStatusPageAnnouncementDataType", + "NewStatusPageComponent", + "NewStatusPageComponentData", + "NewStatusPageComponentDataAttributes", + "NewStatusPageComponentDataAttributesSourceType", + "NewStatusPageComponentDataType", + "NewStatusPageComponentGroup", + "NewStatusPageComponentGroupData", + "NewStatusPageComponentGroupDataAttributes", + "NewStatusPageComponentGroupDataType", "NewStatusPageData", "NewStatusPageDataAttributes", "NewStatusPageDataAttributesAuthenticationMethod", @@ -6646,6 +6829,10 @@ "NewUserPhoneNumberData", "NewUserPhoneNumberDataAttributes", "NewUserPhoneNumberDataType", + "NewVerifiedDomain", + "NewVerifiedDomainData", + "NewVerifiedDomainDataAttributes", + "NewVerifiedDomainDataType", "NewWebhooksEndpoint", "NewWebhooksEndpointData", "NewWebhooksEndpointDataAttributes", @@ -7177,8 +7364,30 @@ "StatusListDataItem", "StatusListDataItemType", "StatusPage", + "StatusPageAnnouncement", + "StatusPageAnnouncementList", + "StatusPageAnnouncementListDataItem", + "StatusPageAnnouncementListDataItemType", + "StatusPageAnnouncementResponse", + "StatusPageAnnouncementResponseData", + "StatusPageAnnouncementResponseDataType", "StatusPageAuthenticationMethod", "StatusPageCnameRecordsType0", + "StatusPageComponent", + "StatusPageComponentGroup", + "StatusPageComponentGroupList", + "StatusPageComponentGroupListDataItem", + "StatusPageComponentGroupListDataItemType", + "StatusPageComponentGroupResponse", + "StatusPageComponentGroupResponseData", + "StatusPageComponentGroupResponseDataType", + "StatusPageComponentList", + "StatusPageComponentListDataItem", + "StatusPageComponentListDataItemType", + "StatusPageComponentResponse", + "StatusPageComponentResponseData", + "StatusPageComponentResponseDataType", + "StatusPageComponentStatus", "StatusPageList", "StatusPageListDataItem", "StatusPageListDataItemType", @@ -7275,6 +7484,15 @@ "UpdateAlertGroupDataAttributesTargetsItem", "UpdateAlertGroupDataAttributesTargetsItemTargetType", "UpdateAlertGroupDataType", + "UpdateAlertRetriggerRule", + "UpdateAlertRetriggerRuleData", + "UpdateAlertRetriggerRuleDataAttributes", + "UpdateAlertRetriggerRuleDataAttributesConditionsItem", + "UpdateAlertRetriggerRuleDataAttributesConditionsItemKind", + "UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator", + "UpdateAlertRetriggerRuleDataAttributesMatchMode", + "UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes", + "UpdateAlertRetriggerRuleDataType", "UpdateAlertRoute", "UpdateAlertRouteData", "UpdateAlertRouteDataAttributes", @@ -7498,6 +7716,8 @@ "UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", "UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers", "UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type", + "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode", + "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope", "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy", "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy", "UpdateEscalationPolicyLevelDataType", @@ -8002,6 +8222,18 @@ "UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType", "UpdateSlaDataType", "UpdateStatusPage", + "UpdateStatusPageAnnouncement", + "UpdateStatusPageAnnouncementData", + "UpdateStatusPageAnnouncementDataAttributes", + "UpdateStatusPageAnnouncementDataType", + "UpdateStatusPageComponent", + "UpdateStatusPageComponentData", + "UpdateStatusPageComponentDataAttributes", + "UpdateStatusPageComponentDataType", + "UpdateStatusPageComponentGroup", + "UpdateStatusPageComponentGroupData", + "UpdateStatusPageComponentGroupDataAttributes", + "UpdateStatusPageComponentGroupDataType", "UpdateStatusPageData", "UpdateStatusPageDataAttributes", "UpdateStatusPageDataAttributesAuthenticationMethod", @@ -8130,6 +8362,15 @@ "UserResponse", "UserResponseData", "UserResponseDataType", + "VerifiedDomain", + "VerifiedDomainList", + "VerifiedDomainListDataItem", + "VerifiedDomainListDataItemType", + "VerifiedDomainResponse", + "VerifiedDomainResponseData", + "VerifiedDomainResponseDataType", + "VerifiedDomainSource", + "VerifiedDomainVerificationStatus", "VerifyPhoneNumberRequest", "WebhooksDelivery", "WebhooksDeliveryList", @@ -8138,6 +8379,7 @@ "WebhooksDeliveryResponse", "WebhooksDeliveryResponseData", "WebhooksDeliveryResponseDataType", + "WebhooksDeliveryStatus", "WebhooksEndpoint", "WebhooksEndpointCustomHeadersItem", "WebhooksEndpointEventTypesItem", diff --git a/rootly_sdk/models/action_item_trigger_params.py b/rootly_sdk/models/action_item_trigger_params.py index 21a6b5c3..fde80595 100644 --- a/rootly_sdk/models/action_item_trigger_params.py +++ b/rootly_sdk/models/action_item_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -140,249 +138,252 @@ class ActionItemTriggerParams: """ Attributes: trigger_type (ActionItemTriggerParamsTriggerType): - triggers (list[str] | Unset): - incident_visibilities (list[bool] | Unset): - incident_kinds (list[ActionItemTriggerParamsIncidentKindsItem] | Unset): - incident_statuses (list[ActionItemTriggerParamsIncidentStatusesItem] | Unset): - incident_inactivity_duration (None | str | Unset): ex. 10 min, 1h, 3 days, 2 weeks - incident_condition (ActionItemTriggerParamsIncidentCondition | Unset): Default: 'ALL'. - incident_condition_visibility (ActionItemTriggerParamsIncidentConditionVisibility | Unset): Default: 'ANY'. - incident_condition_kind (ActionItemTriggerParamsIncidentConditionKind | Unset): Default: 'IS'. - incident_condition_status (ActionItemTriggerParamsIncidentConditionStatus | Unset): Default: 'ANY'. - incident_condition_sub_status (ActionItemTriggerParamsIncidentConditionSubStatus | Unset): Default: 'ANY'. - incident_condition_environment (ActionItemTriggerParamsIncidentConditionEnvironment | Unset): Default: 'ANY'. - incident_condition_severity (ActionItemTriggerParamsIncidentConditionSeverity | Unset): Default: 'ANY'. - incident_condition_incident_type (ActionItemTriggerParamsIncidentConditionIncidentType | Unset): Default: + triggers (Union[Unset, list[str]]): + incident_visibilities (Union[Unset, list[bool]]): + incident_kinds (Union[Unset, list[ActionItemTriggerParamsIncidentKindsItem]]): + incident_statuses (Union[Unset, list[ActionItemTriggerParamsIncidentStatusesItem]]): + incident_inactivity_duration (Union[None, Unset, str]): ex. 10 min, 1h, 3 days, 2 weeks + incident_condition (Union[Unset, ActionItemTriggerParamsIncidentCondition]): Default: 'ALL'. + incident_condition_visibility (Union[Unset, ActionItemTriggerParamsIncidentConditionVisibility]): Default: 'ANY'. - incident_condition_incident_roles (ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset): Default: + incident_condition_kind (Union[Unset, ActionItemTriggerParamsIncidentConditionKind]): Default: 'IS'. + incident_condition_status (Union[Unset, ActionItemTriggerParamsIncidentConditionStatus]): Default: 'ANY'. + incident_condition_sub_status (Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus]): Default: 'ANY'. - incident_condition_service (ActionItemTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. - incident_condition_functionality (ActionItemTriggerParamsIncidentConditionFunctionality | Unset): Default: + incident_condition_environment (Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment]): Default: 'ANY'. - incident_condition_group (ActionItemTriggerParamsIncidentConditionGroup | Unset): Default: 'ANY'. - incident_condition_label (ActionItemTriggerParamsIncidentConditionLabel | Unset): Default: 'ANY'. - incident_condition_label_use_regexp (bool | Unset): Default: False. - incident_labels (list[str] | Unset): - incident_condition_summary (ActionItemTriggerParamsIncidentConditionSummary | Unset): - incident_condition_started_at (ActionItemTriggerParamsIncidentConditionStartedAt | Unset): - incident_condition_detected_at (ActionItemTriggerParamsIncidentConditionDetectedAt | Unset): - incident_condition_acknowledged_at (ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset): - incident_condition_mitigated_at (ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset): - incident_condition_resolved_at (ActionItemTriggerParamsIncidentConditionResolvedAt | Unset): - incident_conditional_inactivity (ActionItemTriggerParamsIncidentConditionalInactivity | Unset): - incident_action_item_condition (ActionItemTriggerParamsIncidentActionItemCondition | Unset): - incident_action_item_condition_kind (ActionItemTriggerParamsIncidentActionItemConditionKind | Unset): Default: + incident_condition_severity (Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. + incident_condition_incident_type (Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType]): Default: 'ANY'. - incident_action_item_kinds (list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset): - incident_action_item_condition_status (ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset): + incident_condition_incident_roles (Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles]): + Default: 'ANY'. + incident_condition_service (Union[Unset, ActionItemTriggerParamsIncidentConditionService]): Default: 'ANY'. + incident_condition_functionality (Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality]): + Default: 'ANY'. + incident_condition_group (Union[Unset, ActionItemTriggerParamsIncidentConditionGroup]): Default: 'ANY'. + incident_condition_label (Union[Unset, ActionItemTriggerParamsIncidentConditionLabel]): Default: 'ANY'. + incident_condition_label_use_regexp (Union[Unset, bool]): Default: False. + incident_labels (Union[Unset, list[str]]): + incident_condition_summary (Union[Unset, ActionItemTriggerParamsIncidentConditionSummary]): + incident_condition_started_at (Union[Unset, ActionItemTriggerParamsIncidentConditionStartedAt]): + incident_condition_detected_at (Union[Unset, ActionItemTriggerParamsIncidentConditionDetectedAt]): + incident_condition_acknowledged_at (Union[Unset, ActionItemTriggerParamsIncidentConditionAcknowledgedAt]): + incident_condition_mitigated_at (Union[Unset, ActionItemTriggerParamsIncidentConditionMitigatedAt]): + incident_condition_resolved_at (Union[Unset, ActionItemTriggerParamsIncidentConditionResolvedAt]): + incident_conditional_inactivity (Union[Unset, ActionItemTriggerParamsIncidentConditionalInactivity]): + incident_action_item_condition (Union[Unset, ActionItemTriggerParamsIncidentActionItemCondition]): + incident_action_item_condition_kind (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionKind]): Default: 'ANY'. - incident_action_item_statuses (list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset): - incident_action_item_condition_priority (ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset): + incident_action_item_kinds (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemKindsItem]]): + incident_action_item_condition_status (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus]): Default: 'ANY'. - incident_action_item_priorities (list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset): - incident_action_item_condition_group (ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset): + incident_action_item_statuses (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemStatusesItem]]): + incident_action_item_condition_priority (Union[Unset, + ActionItemTriggerParamsIncidentActionItemConditionPriority]): Default: 'ANY'. + incident_action_item_priorities (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem]]): + incident_action_item_condition_group (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionGroup]): Default: 'ANY'. - incident_action_item_group_ids (list[str] | Unset): + incident_action_item_group_ids (Union[Unset, list[str]]): """ trigger_type: ActionItemTriggerParamsTriggerType - triggers: list[str] | Unset = UNSET - incident_visibilities: list[bool] | Unset = UNSET - incident_kinds: list[ActionItemTriggerParamsIncidentKindsItem] | Unset = UNSET - incident_statuses: list[ActionItemTriggerParamsIncidentStatusesItem] | Unset = UNSET - incident_inactivity_duration: None | str | Unset = UNSET - incident_condition: ActionItemTriggerParamsIncidentCondition | Unset = "ALL" - incident_condition_visibility: ActionItemTriggerParamsIncidentConditionVisibility | Unset = "ANY" - incident_condition_kind: ActionItemTriggerParamsIncidentConditionKind | Unset = "IS" - incident_condition_status: ActionItemTriggerParamsIncidentConditionStatus | Unset = "ANY" - incident_condition_sub_status: ActionItemTriggerParamsIncidentConditionSubStatus | Unset = "ANY" - incident_condition_environment: ActionItemTriggerParamsIncidentConditionEnvironment | Unset = "ANY" - incident_condition_severity: ActionItemTriggerParamsIncidentConditionSeverity | Unset = "ANY" - incident_condition_incident_type: ActionItemTriggerParamsIncidentConditionIncidentType | Unset = "ANY" - incident_condition_incident_roles: ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset = "ANY" - incident_condition_service: ActionItemTriggerParamsIncidentConditionService | Unset = "ANY" - incident_condition_functionality: ActionItemTriggerParamsIncidentConditionFunctionality | Unset = "ANY" - incident_condition_group: ActionItemTriggerParamsIncidentConditionGroup | Unset = "ANY" - incident_condition_label: ActionItemTriggerParamsIncidentConditionLabel | Unset = "ANY" - incident_condition_label_use_regexp: bool | Unset = False - incident_labels: list[str] | Unset = UNSET - incident_condition_summary: ActionItemTriggerParamsIncidentConditionSummary | Unset = UNSET - incident_condition_started_at: ActionItemTriggerParamsIncidentConditionStartedAt | Unset = UNSET - incident_condition_detected_at: ActionItemTriggerParamsIncidentConditionDetectedAt | Unset = UNSET - incident_condition_acknowledged_at: ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset = UNSET - incident_condition_mitigated_at: ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset = UNSET - incident_condition_resolved_at: ActionItemTriggerParamsIncidentConditionResolvedAt | Unset = UNSET - incident_conditional_inactivity: ActionItemTriggerParamsIncidentConditionalInactivity | Unset = UNSET - incident_action_item_condition: ActionItemTriggerParamsIncidentActionItemCondition | Unset = UNSET - incident_action_item_condition_kind: ActionItemTriggerParamsIncidentActionItemConditionKind | Unset = "ANY" - incident_action_item_kinds: list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset = UNSET - incident_action_item_condition_status: ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset = "ANY" - incident_action_item_statuses: list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset = UNSET - incident_action_item_condition_priority: ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset = "ANY" - incident_action_item_priorities: list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset = UNSET - incident_action_item_condition_group: ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset = "ANY" - incident_action_item_group_ids: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET + incident_visibilities: Unset | list[bool] = UNSET + incident_kinds: Unset | list[ActionItemTriggerParamsIncidentKindsItem] = UNSET + incident_statuses: Unset | list[ActionItemTriggerParamsIncidentStatusesItem] = UNSET + incident_inactivity_duration: None | Unset | str = UNSET + incident_condition: Unset | ActionItemTriggerParamsIncidentCondition = "ALL" + incident_condition_visibility: Unset | ActionItemTriggerParamsIncidentConditionVisibility = "ANY" + incident_condition_kind: Unset | ActionItemTriggerParamsIncidentConditionKind = "IS" + incident_condition_status: Unset | ActionItemTriggerParamsIncidentConditionStatus = "ANY" + incident_condition_sub_status: Unset | ActionItemTriggerParamsIncidentConditionSubStatus = "ANY" + incident_condition_environment: Unset | ActionItemTriggerParamsIncidentConditionEnvironment = "ANY" + incident_condition_severity: Unset | ActionItemTriggerParamsIncidentConditionSeverity = "ANY" + incident_condition_incident_type: Unset | ActionItemTriggerParamsIncidentConditionIncidentType = "ANY" + incident_condition_incident_roles: Unset | ActionItemTriggerParamsIncidentConditionIncidentRoles = "ANY" + incident_condition_service: Unset | ActionItemTriggerParamsIncidentConditionService = "ANY" + incident_condition_functionality: Unset | ActionItemTriggerParamsIncidentConditionFunctionality = "ANY" + incident_condition_group: Unset | ActionItemTriggerParamsIncidentConditionGroup = "ANY" + incident_condition_label: Unset | ActionItemTriggerParamsIncidentConditionLabel = "ANY" + incident_condition_label_use_regexp: Unset | bool = False + incident_labels: Unset | list[str] = UNSET + incident_condition_summary: Unset | ActionItemTriggerParamsIncidentConditionSummary = UNSET + incident_condition_started_at: Unset | ActionItemTriggerParamsIncidentConditionStartedAt = UNSET + incident_condition_detected_at: Unset | ActionItemTriggerParamsIncidentConditionDetectedAt = UNSET + incident_condition_acknowledged_at: Unset | ActionItemTriggerParamsIncidentConditionAcknowledgedAt = UNSET + incident_condition_mitigated_at: Unset | ActionItemTriggerParamsIncidentConditionMitigatedAt = UNSET + incident_condition_resolved_at: Unset | ActionItemTriggerParamsIncidentConditionResolvedAt = UNSET + incident_conditional_inactivity: Unset | ActionItemTriggerParamsIncidentConditionalInactivity = UNSET + incident_action_item_condition: Unset | ActionItemTriggerParamsIncidentActionItemCondition = UNSET + incident_action_item_condition_kind: Unset | ActionItemTriggerParamsIncidentActionItemConditionKind = "ANY" + incident_action_item_kinds: Unset | list[ActionItemTriggerParamsIncidentActionItemKindsItem] = UNSET + incident_action_item_condition_status: Unset | ActionItemTriggerParamsIncidentActionItemConditionStatus = "ANY" + incident_action_item_statuses: Unset | list[ActionItemTriggerParamsIncidentActionItemStatusesItem] = UNSET + incident_action_item_condition_priority: Unset | ActionItemTriggerParamsIncidentActionItemConditionPriority = "ANY" + incident_action_item_priorities: Unset | list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] = UNSET + incident_action_item_condition_group: Unset | ActionItemTriggerParamsIncidentActionItemConditionGroup = "ANY" + incident_action_item_group_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: list[bool] | Unset = UNSET + incident_visibilities: Unset | list[bool] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: list[str] | Unset = UNSET + incident_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: list[str] | Unset = UNSET + incident_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: None | str | Unset + incident_inactivity_duration: None | Unset | str if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: str | Unset = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: str | Unset = UNSET + incident_condition_visibility: Unset | str = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: str | Unset = UNSET + incident_condition_kind: Unset | str = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: str | Unset = UNSET + incident_condition_status: Unset | str = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: str | Unset = UNSET + incident_condition_sub_status: Unset | str = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: str | Unset = UNSET + incident_condition_environment: Unset | str = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: str | Unset = UNSET + incident_condition_severity: Unset | str = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: str | Unset = UNSET + incident_condition_incident_type: Unset | str = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: str | Unset = UNSET + incident_condition_incident_roles: Unset | str = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: str | Unset = UNSET + incident_condition_service: Unset | str = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: str | Unset = UNSET + incident_condition_functionality: Unset | str = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: str | Unset = UNSET + incident_condition_group: Unset | str = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_label: str | Unset = UNSET + incident_condition_label: Unset | str = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: list[str] | Unset = UNSET + incident_labels: Unset | list[str] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_condition_summary: str | Unset = UNSET + incident_condition_summary: Unset | str = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: str | Unset = UNSET + incident_condition_started_at: Unset | str = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: str | Unset = UNSET + incident_condition_detected_at: Unset | str = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: str | Unset = UNSET + incident_condition_acknowledged_at: Unset | str = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: str | Unset = UNSET + incident_condition_mitigated_at: Unset | str = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: str | Unset = UNSET + incident_condition_resolved_at: Unset | str = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: str | Unset = UNSET + incident_conditional_inactivity: Unset | str = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_action_item_condition: str | Unset = UNSET + incident_action_item_condition: Unset | str = UNSET if not isinstance(self.incident_action_item_condition, Unset): incident_action_item_condition = self.incident_action_item_condition - incident_action_item_condition_kind: str | Unset = UNSET + incident_action_item_condition_kind: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = self.incident_action_item_condition_kind - incident_action_item_kinds: list[str] | Unset = UNSET + incident_action_item_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_kinds, Unset): incident_action_item_kinds = [] for incident_action_item_kinds_item_data in self.incident_action_item_kinds: incident_action_item_kinds_item: str = incident_action_item_kinds_item_data incident_action_item_kinds.append(incident_action_item_kinds_item) - incident_action_item_condition_status: str | Unset = UNSET + incident_action_item_condition_status: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_status, Unset): incident_action_item_condition_status = self.incident_action_item_condition_status - incident_action_item_statuses: list[str] | Unset = UNSET + incident_action_item_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_statuses, Unset): incident_action_item_statuses = [] for incident_action_item_statuses_item_data in self.incident_action_item_statuses: incident_action_item_statuses_item: str = incident_action_item_statuses_item_data incident_action_item_statuses.append(incident_action_item_statuses_item) - incident_action_item_condition_priority: str | Unset = UNSET + incident_action_item_condition_priority: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = self.incident_action_item_condition_priority - incident_action_item_priorities: list[str] | Unset = UNSET + incident_action_item_priorities: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_priorities, Unset): incident_action_item_priorities = [] for incident_action_item_priorities_item_data in self.incident_action_item_priorities: incident_action_item_priorities_item: str = incident_action_item_priorities_item_data incident_action_item_priorities.append(incident_action_item_priorities_item) - incident_action_item_condition_group: str | Unset = UNSET + incident_action_item_condition_group: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_group, Unset): incident_action_item_condition_group = self.incident_action_item_condition_group - incident_action_item_group_ids: list[str] | Unset = UNSET + incident_action_item_group_ids: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_group_ids, Unset): incident_action_item_group_ids = self.incident_action_item_group_ids @@ -477,44 +478,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_visibilities = cast(list[bool], d.pop("incident_visibilities", UNSET)) + incident_kinds = [] _incident_kinds = d.pop("incident_kinds", UNSET) - incident_kinds: list[ActionItemTriggerParamsIncidentKindsItem] | Unset = UNSET - if _incident_kinds is not UNSET: - incident_kinds = [] - for incident_kinds_item_data in _incident_kinds: - incident_kinds_item = check_action_item_trigger_params_incident_kinds_item(incident_kinds_item_data) + for incident_kinds_item_data in _incident_kinds or []: + incident_kinds_item = check_action_item_trigger_params_incident_kinds_item(incident_kinds_item_data) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) + incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - incident_statuses: list[ActionItemTriggerParamsIncidentStatusesItem] | Unset = UNSET - if _incident_statuses is not UNSET: - incident_statuses = [] - for incident_statuses_item_data in _incident_statuses: - incident_statuses_item = check_action_item_trigger_params_incident_statuses_item( - incident_statuses_item_data - ) + for incident_statuses_item_data in _incident_statuses or []: + incident_statuses_item = check_action_item_trigger_params_incident_statuses_item( + incident_statuses_item_data + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: + def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: ActionItemTriggerParamsIncidentCondition | Unset + incident_condition: Unset | ActionItemTriggerParamsIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_action_item_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: ActionItemTriggerParamsIncidentConditionVisibility | Unset + incident_condition_visibility: Unset | ActionItemTriggerParamsIncidentConditionVisibility if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -523,14 +520,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: ActionItemTriggerParamsIncidentConditionKind | Unset + incident_condition_kind: Unset | ActionItemTriggerParamsIncidentConditionKind if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_action_item_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: ActionItemTriggerParamsIncidentConditionStatus | Unset + incident_condition_status: Unset | ActionItemTriggerParamsIncidentConditionStatus if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -539,7 +536,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: ActionItemTriggerParamsIncidentConditionSubStatus | Unset + incident_condition_sub_status: Unset | ActionItemTriggerParamsIncidentConditionSubStatus if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -548,7 +545,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: ActionItemTriggerParamsIncidentConditionEnvironment | Unset + incident_condition_environment: Unset | ActionItemTriggerParamsIncidentConditionEnvironment if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -557,7 +554,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: ActionItemTriggerParamsIncidentConditionSeverity | Unset + incident_condition_severity: Unset | ActionItemTriggerParamsIncidentConditionSeverity if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -566,7 +563,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: ActionItemTriggerParamsIncidentConditionIncidentType | Unset + incident_condition_incident_type: Unset | ActionItemTriggerParamsIncidentConditionIncidentType if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -575,7 +572,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset + incident_condition_incident_roles: Unset | ActionItemTriggerParamsIncidentConditionIncidentRoles if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -584,7 +581,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: ActionItemTriggerParamsIncidentConditionService | Unset + incident_condition_service: Unset | ActionItemTriggerParamsIncidentConditionService if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -593,7 +590,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: ActionItemTriggerParamsIncidentConditionFunctionality | Unset + incident_condition_functionality: Unset | ActionItemTriggerParamsIncidentConditionFunctionality if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -602,7 +599,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: ActionItemTriggerParamsIncidentConditionGroup | Unset + incident_condition_group: Unset | ActionItemTriggerParamsIncidentConditionGroup if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -611,7 +608,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: ActionItemTriggerParamsIncidentConditionLabel | Unset + incident_condition_label: Unset | ActionItemTriggerParamsIncidentConditionLabel if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -624,7 +621,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: ActionItemTriggerParamsIncidentConditionSummary | Unset + incident_condition_summary: Unset | ActionItemTriggerParamsIncidentConditionSummary if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -633,7 +630,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: ActionItemTriggerParamsIncidentConditionStartedAt | Unset + incident_condition_started_at: Unset | ActionItemTriggerParamsIncidentConditionStartedAt if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -642,7 +639,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: ActionItemTriggerParamsIncidentConditionDetectedAt | Unset + incident_condition_detected_at: Unset | ActionItemTriggerParamsIncidentConditionDetectedAt if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -651,7 +648,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset + incident_condition_acknowledged_at: Unset | ActionItemTriggerParamsIncidentConditionAcknowledgedAt if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -660,7 +657,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset + incident_condition_mitigated_at: Unset | ActionItemTriggerParamsIncidentConditionMitigatedAt if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -669,7 +666,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: ActionItemTriggerParamsIncidentConditionResolvedAt | Unset + incident_condition_resolved_at: Unset | ActionItemTriggerParamsIncidentConditionResolvedAt if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -678,7 +675,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: ActionItemTriggerParamsIncidentConditionalInactivity | Unset + incident_conditional_inactivity: Unset | ActionItemTriggerParamsIncidentConditionalInactivity if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -687,7 +684,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_action_item_condition = d.pop("incident_action_item_condition", UNSET) - incident_action_item_condition: ActionItemTriggerParamsIncidentActionItemCondition | Unset + incident_action_item_condition: Unset | ActionItemTriggerParamsIncidentActionItemCondition if isinstance(_incident_action_item_condition, Unset): incident_action_item_condition = UNSET else: @@ -696,7 +693,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_action_item_condition_kind = d.pop("incident_action_item_condition_kind", UNSET) - incident_action_item_condition_kind: ActionItemTriggerParamsIncidentActionItemConditionKind | Unset + incident_action_item_condition_kind: Unset | ActionItemTriggerParamsIncidentActionItemConditionKind if isinstance(_incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = UNSET else: @@ -704,19 +701,17 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: _incident_action_item_condition_kind ) + incident_action_item_kinds = [] _incident_action_item_kinds = d.pop("incident_action_item_kinds", UNSET) - incident_action_item_kinds: list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset = UNSET - if _incident_action_item_kinds is not UNSET: - incident_action_item_kinds = [] - for incident_action_item_kinds_item_data in _incident_action_item_kinds: - incident_action_item_kinds_item = check_action_item_trigger_params_incident_action_item_kinds_item( - incident_action_item_kinds_item_data - ) + for incident_action_item_kinds_item_data in _incident_action_item_kinds or []: + incident_action_item_kinds_item = check_action_item_trigger_params_incident_action_item_kinds_item( + incident_action_item_kinds_item_data + ) - incident_action_item_kinds.append(incident_action_item_kinds_item) + incident_action_item_kinds.append(incident_action_item_kinds_item) _incident_action_item_condition_status = d.pop("incident_action_item_condition_status", UNSET) - incident_action_item_condition_status: ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset + incident_action_item_condition_status: Unset | ActionItemTriggerParamsIncidentActionItemConditionStatus if isinstance(_incident_action_item_condition_status, Unset): incident_action_item_condition_status = UNSET else: @@ -726,21 +721,17 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) ) + incident_action_item_statuses = [] _incident_action_item_statuses = d.pop("incident_action_item_statuses", UNSET) - incident_action_item_statuses: list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset = UNSET - if _incident_action_item_statuses is not UNSET: - incident_action_item_statuses = [] - for incident_action_item_statuses_item_data in _incident_action_item_statuses: - incident_action_item_statuses_item = ( - check_action_item_trigger_params_incident_action_item_statuses_item( - incident_action_item_statuses_item_data - ) - ) + for incident_action_item_statuses_item_data in _incident_action_item_statuses or []: + incident_action_item_statuses_item = check_action_item_trigger_params_incident_action_item_statuses_item( + incident_action_item_statuses_item_data + ) - incident_action_item_statuses.append(incident_action_item_statuses_item) + incident_action_item_statuses.append(incident_action_item_statuses_item) _incident_action_item_condition_priority = d.pop("incident_action_item_condition_priority", UNSET) - incident_action_item_condition_priority: ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset + incident_action_item_condition_priority: Unset | ActionItemTriggerParamsIncidentActionItemConditionPriority if isinstance(_incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = UNSET else: @@ -750,21 +741,19 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) ) + incident_action_item_priorities = [] _incident_action_item_priorities = d.pop("incident_action_item_priorities", UNSET) - incident_action_item_priorities: list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset = UNSET - if _incident_action_item_priorities is not UNSET: - incident_action_item_priorities = [] - for incident_action_item_priorities_item_data in _incident_action_item_priorities: - incident_action_item_priorities_item = ( - check_action_item_trigger_params_incident_action_item_priorities_item( - incident_action_item_priorities_item_data - ) + for incident_action_item_priorities_item_data in _incident_action_item_priorities or []: + incident_action_item_priorities_item = ( + check_action_item_trigger_params_incident_action_item_priorities_item( + incident_action_item_priorities_item_data ) + ) - incident_action_item_priorities.append(incident_action_item_priorities_item) + incident_action_item_priorities.append(incident_action_item_priorities_item) _incident_action_item_condition_group = d.pop("incident_action_item_condition_group", UNSET) - incident_action_item_condition_group: ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset + incident_action_item_condition_group: Unset | ActionItemTriggerParamsIncidentActionItemConditionGroup if isinstance(_incident_action_item_condition_group, Unset): incident_action_item_condition_group = UNSET else: diff --git a/rootly_sdk/models/add_action_item_task_params.py b/rootly_sdk/models/add_action_item_task_params.py index 5d141312..ce3f369c 100644 --- a/rootly_sdk/models/add_action_item_task_params.py +++ b/rootly_sdk/models/add_action_item_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,55 +39,55 @@ class AddActionItemTaskParams: priority (AddActionItemTaskParamsPriority): The action item priority summary (str): The action item summary status (AddActionItemTaskParamsStatus): The action item status - task_type (AddActionItemTaskParamsTaskType | Unset): - attribute_to_query_by (AddActionItemTaskParamsAttributeToQueryBy | Unset): Attribute of the Incident to match - against - query_value (None | str | Unset): Value that attribute_to_query_by to uses to match against - incident_role_id (str | Unset): The role id this action item is associated with - assigned_to_user_id (str | Unset): [DEPRECATED] Use assigned_to_user attribute instead. The user id this action - item is assigned to - assigned_to_user (AddActionItemTaskParamsAssignedToUser | Unset): The user this action item is assigned to - kind (str | Unset): The action item kind - description (str | Unset): The action item description - post_to_incident_timeline (bool | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, AddActionItemTaskParamsTaskType]): + attribute_to_query_by (Union[Unset, AddActionItemTaskParamsAttributeToQueryBy]): Attribute of the Incident to + match against + query_value (Union[None, Unset, str]): Value that attribute_to_query_by to uses to match against + incident_role_id (Union[Unset, str]): The role id this action item is associated with + assigned_to_user_id (Union[Unset, str]): [DEPRECATED] Use assigned_to_user attribute instead. The user id this + action item is assigned to + assigned_to_user (Union[Unset, AddActionItemTaskParamsAssignedToUser]): The user this action item is assigned + to + kind (Union[Unset, str]): The action item kind + description (Union[Unset, str]): The action item description + post_to_incident_timeline (Union[Unset, bool]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - post_to_slack_channels (list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset): + post_to_slack_channels (Union[Unset, list['AddActionItemTaskParamsPostToSlackChannelsItem']]): """ priority: AddActionItemTaskParamsPriority summary: str status: AddActionItemTaskParamsStatus - task_type: AddActionItemTaskParamsTaskType | Unset = UNSET - attribute_to_query_by: AddActionItemTaskParamsAttributeToQueryBy | Unset = UNSET - query_value: None | str | Unset = UNSET - incident_role_id: str | Unset = UNSET - assigned_to_user_id: str | Unset = UNSET - assigned_to_user: AddActionItemTaskParamsAssignedToUser | Unset = UNSET - kind: str | Unset = UNSET - description: str | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - post_to_slack_channels: list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | AddActionItemTaskParamsTaskType = UNSET + attribute_to_query_by: Unset | AddActionItemTaskParamsAttributeToQueryBy = UNSET + query_value: None | Unset | str = UNSET + incident_role_id: Unset | str = UNSET + assigned_to_user_id: Unset | str = UNSET + assigned_to_user: Union[Unset, "AddActionItemTaskParamsAssignedToUser"] = UNSET + kind: Unset | str = UNSET + description: Unset | str = UNSET + post_to_incident_timeline: Unset | bool = UNSET + custom_fields_mapping: None | Unset | str = UNSET + post_to_slack_channels: Unset | list["AddActionItemTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - priority: str = self.priority summary = self.summary status: str = self.status - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: str | Unset = UNSET + attribute_to_query_by: Unset | str = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - query_value: None | str | Unset + query_value: None | Unset | str if isinstance(self.query_value, Unset): query_value = UNSET else: @@ -99,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: dict[str, Any] | Unset = UNSET + assigned_to_user: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -109,13 +107,13 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -171,25 +169,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_add_action_item_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: AddActionItemTaskParamsTaskType | Unset + task_type: Unset | AddActionItemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_add_action_item_task_params_task_type(_task_type) _attribute_to_query_by = d.pop("attribute_to_query_by", UNSET) - attribute_to_query_by: AddActionItemTaskParamsAttributeToQueryBy | Unset + attribute_to_query_by: Unset | AddActionItemTaskParamsAttributeToQueryBy if isinstance(_attribute_to_query_by, Unset): attribute_to_query_by = UNSET else: attribute_to_query_by = check_add_action_item_task_params_attribute_to_query_by(_attribute_to_query_by) - def _parse_query_value(data: object) -> None | str | Unset: + def _parse_query_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) query_value = _parse_query_value(d.pop("query_value", UNSET)) @@ -198,7 +196,7 @@ def _parse_query_value(data: object) -> None | str | Unset: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: AddActionItemTaskParamsAssignedToUser | Unset + assigned_to_user: Unset | AddActionItemTaskParamsAssignedToUser if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: @@ -210,25 +208,23 @@ def _parse_query_value(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = AddActionItemTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = AddActionItemTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) add_action_item_task_params = cls( priority=priority, diff --git a/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py b/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py index 8d65de98..972a5720 100644 --- a/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py +++ b/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class AddActionItemTaskParamsAssignedToUser: """The user this action item is assigned to Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py index 2f32e287..0c500319 100644 --- a/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AddActionItemTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py index 97e5faf6..ae7c5c7b 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,24 +24,23 @@ class AddMicrosoftTeamsChatTabTaskParams: chat (AddMicrosoftTeamsChatTabTaskParamsChat): title (str): The tab title link (str): The tab link - task_type (AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset): + task_type (Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType]): """ - chat: AddMicrosoftTeamsChatTabTaskParamsChat + chat: "AddMicrosoftTeamsChatTabTaskParamsChat" title: str link: str - task_type: AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset = UNSET + task_type: Unset | AddMicrosoftTeamsChatTabTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - chat = self.chat.to_dict() title = self.title link = self.link - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: link = d.pop("link") _task_type = d.pop("task_type", UNSET) - task_type: AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset + task_type: Unset | AddMicrosoftTeamsChatTabTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py index 8d82e503..2d33f9ef 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AddMicrosoftTeamsChatTabTaskParamsChat: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py index b641221f..f7b9192a 100644 --- a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py +++ b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py index d3997e1b..d8eb83a4 100644 --- a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py +++ b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_role_task_params.py b/rootly_sdk/models/add_role_task_params.py index c00fb3ce..85e68e5a 100644 --- a/rootly_sdk/models/add_role_task_params.py +++ b/rootly_sdk/models/add_role_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,29 +19,28 @@ class AddRoleTaskParams: """ Attributes: incident_role_id (str): The role id to add to the incident - task_type (AddRoleTaskParamsTaskType | Unset): - assigned_to_user_id (str | Unset): [DEPRECATED] Use assigned_to_user attribute instead. The user id this role is - assigned to - assigned_to_user (AddRoleTaskParamsAssignedToUser | Unset): The user this role is assigned to + task_type (Union[Unset, AddRoleTaskParamsTaskType]): + assigned_to_user_id (Union[Unset, str]): [DEPRECATED] Use assigned_to_user attribute instead. The user id this + role is assigned to + assigned_to_user (Union[Unset, AddRoleTaskParamsAssignedToUser]): The user this role is assigned to """ incident_role_id: str - task_type: AddRoleTaskParamsTaskType | Unset = UNSET - assigned_to_user_id: str | Unset = UNSET - assigned_to_user: AddRoleTaskParamsAssignedToUser | Unset = UNSET + task_type: Unset | AddRoleTaskParamsTaskType = UNSET + assigned_to_user_id: Unset | str = UNSET + assigned_to_user: Union[Unset, "AddRoleTaskParamsAssignedToUser"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_role_id = self.incident_role_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: dict[str, Any] | Unset = UNSET + assigned_to_user: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -71,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id") _task_type = d.pop("task_type", UNSET) - task_type: AddRoleTaskParamsTaskType | Unset + task_type: Unset | AddRoleTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -80,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: AddRoleTaskParamsAssignedToUser | Unset + assigned_to_user: Unset | AddRoleTaskParamsAssignedToUser if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: diff --git a/rootly_sdk/models/add_role_task_params_assigned_to_user.py b/rootly_sdk/models/add_role_task_params_assigned_to_user.py index 2c165799..8e99caa9 100644 --- a/rootly_sdk/models/add_role_task_params_assigned_to_user.py +++ b/rootly_sdk/models/add_role_task_params_assigned_to_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class AddRoleTaskParamsAssignedToUser: """The user this role is assigned to Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py b/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py index e256010f..0f43cd35 100644 --- a/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py +++ b/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py b/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py index 051110dd..17fb508b 100644 --- a/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py +++ b/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_subscribers.py b/rootly_sdk/models/add_subscribers.py index 50590e8b..8c8f6c2d 100644 --- a/rootly_sdk/models/add_subscribers.py +++ b/rootly_sdk/models/add_subscribers.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AddSubscribers: data (AddSubscribersData): """ - data: AddSubscribersData + data: "AddSubscribersData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/add_subscribers_data.py b/rootly_sdk/models/add_subscribers_data.py index 07e1b77d..e3a5017b 100644 --- a/rootly_sdk/models/add_subscribers_data.py +++ b/rootly_sdk/models/add_subscribers_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class AddSubscribersData: """ type_: AddSubscribersDataType - attributes: AddSubscribersDataAttributes + attributes: "AddSubscribersDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/add_subscribers_data_attributes.py b/rootly_sdk/models/add_subscribers_data_attributes.py index 7f819592..b3543b07 100644 --- a/rootly_sdk/models/add_subscribers_data_attributes.py +++ b/rootly_sdk/models/add_subscribers_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,16 +12,16 @@ class AddSubscribersDataAttributes: """ Attributes: - user_ids (list[str] | None | Unset): IDs of users you wish to add to list of subscribers for this incident - remove_users_with_no_private_incident_access (bool | None | Unset): Users without read permissions for private - incidents will be removed from the subscriber list of this incident Default: False. + user_ids (Union[None, Unset, list[str]]): IDs of users you wish to add to list of subscribers for this incident + remove_users_with_no_private_incident_access (Union[None, Unset, bool]): Users without read permissions for + private incidents will be removed from the subscriber list of this incident Default: False. """ - user_ids: list[str] | None | Unset = UNSET - remove_users_with_no_private_incident_access: bool | None | Unset = False + user_ids: None | Unset | list[str] = UNSET + remove_users_with_no_private_incident_access: None | Unset | bool = False def to_dict(self) -> dict[str, Any]: - user_ids: list[str] | None | Unset + user_ids: None | Unset | list[str] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -32,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: bool | None | Unset + remove_users_with_no_private_incident_access: None | Unset | bool if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -52,7 +50,7 @@ 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_user_ids(data: object) -> list[str] | None | Unset: + def _parse_user_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -63,18 +61,18 @@ def _parse_user_ids(data: object) -> list[str] | None | Unset: user_ids_type_0 = cast(list[str], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> bool | None | Unset: + def _parse_remove_users_with_no_private_incident_access(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) remove_users_with_no_private_incident_access = _parse_remove_users_with_no_private_incident_access( d.pop("remove_users_with_no_private_incident_access", UNSET) diff --git a/rootly_sdk/models/add_team_task_params.py b/rootly_sdk/models/add_team_task_params.py index 20b40bd2..f1847b9a 100644 --- a/rootly_sdk/models/add_team_task_params.py +++ b/rootly_sdk/models/add_team_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,17 +15,17 @@ class AddTeamTaskParams: """ Attributes: group_id (str): The team id - task_type (AddTeamTaskParamsTaskType | Unset): + task_type (Union[Unset, AddTeamTaskParamsTaskType]): """ group_id: str - task_type: AddTeamTaskParamsTaskType | Unset = UNSET + task_type: Unset | AddTeamTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: group_id = self.group_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -49,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: group_id = d.pop("group_id") _task_type = d.pop("task_type", UNSET) - task_type: AddTeamTaskParamsTaskType | Unset + task_type: Unset | AddTeamTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_to_timeline_task_params.py b/rootly_sdk/models/add_to_timeline_task_params.py index d94652d3..d30f8943 100644 --- a/rootly_sdk/models/add_to_timeline_task_params.py +++ b/rootly_sdk/models/add_to_timeline_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,28 +24,27 @@ class AddToTimelineTaskParams: """ Attributes: event (str): The timeline event description - task_type (AddToTimelineTaskParamsTaskType | Unset): - url (str | Unset): A URL for the timeline event - post_to_slack_channels (list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, AddToTimelineTaskParamsTaskType]): + url (Union[Unset, str]): A URL for the timeline event + post_to_slack_channels (Union[Unset, list['AddToTimelineTaskParamsPostToSlackChannelsItem']]): """ event: str - task_type: AddToTimelineTaskParamsTaskType | Unset = UNSET - url: str | Unset = UNSET - post_to_slack_channels: list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | AddToTimelineTaskParamsTaskType = UNSET + url: Unset | str = UNSET + post_to_slack_channels: Unset | list["AddToTimelineTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - event = self.event - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type url = self.url - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -80,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _task_type = d.pop("task_type", UNSET) - task_type: AddToTimelineTaskParamsTaskType | Unset + task_type: Unset | AddToTimelineTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -88,16 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: url = d.pop("url", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = AddToTimelineTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = AddToTimelineTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) add_to_timeline_task_params = cls( event=event, diff --git a/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py index a0238cd6..bd3ec020 100644 --- a/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AddToTimelineTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/ai_chat_response.py b/rootly_sdk/models/ai_chat_response.py index d4a4d120..f2b4be4e 100644 --- a/rootly_sdk/models/ai_chat_response.py +++ b/rootly_sdk/models/ai_chat_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AiChatResponse: """ Attributes: data (AiChatResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AiChatResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AiChatResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AiChatResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) ai_chat_response = cls( data=data, diff --git a/rootly_sdk/models/ai_chat_response_data.py b/rootly_sdk/models/ai_chat_response_data.py index 9a4718a5..5b4dbe46 100644 --- a/rootly_sdk/models/ai_chat_response_data.py +++ b/rootly_sdk/models/ai_chat_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,11 +25,10 @@ class AiChatResponseData: id: UUID type_: AiChatResponseDataType - attributes: AiChatResponseDataAttributes + attributes: "AiChatResponseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = str(self.id) type_: str = self.type_ diff --git a/rootly_sdk/models/ai_chat_response_data_attributes.py b/rootly_sdk/models/ai_chat_response_data_attributes.py index 67c0577f..7c79d03d 100644 --- a/rootly_sdk/models/ai_chat_response_data_attributes.py +++ b/rootly_sdk/models/ai_chat_response_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -21,25 +19,25 @@ class AiChatResponseDataAttributes: """ Attributes: session_id (UUID): AI chat session UUID - reply (None | str | Unset): Assistant reply text - status (AiChatResponseDataAttributesStatus | Unset): Response status (present when user input is required) + reply (Union[None, Unset, str]): Assistant reply text + status (Union[Unset, AiChatResponseDataAttributesStatus]): Response status (present when user input is required) """ session_id: UUID - reply: None | str | Unset = UNSET - status: AiChatResponseDataAttributesStatus | Unset = UNSET + reply: None | Unset | str = UNSET + status: Unset | AiChatResponseDataAttributesStatus = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: session_id = str(self.session_id) - reply: None | str | Unset + reply: None | Unset | str if isinstance(self.reply, Unset): reply = UNSET else: reply = self.reply - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -62,17 +60,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) session_id = UUID(d.pop("session_id")) - def _parse_reply(data: object) -> None | str | Unset: + def _parse_reply(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) reply = _parse_reply(d.pop("reply", UNSET)) _status = d.pop("status", UNSET) - status: AiChatResponseDataAttributesStatus | Unset + status: Unset | AiChatResponseDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/ai_chat_session_message.py b/rootly_sdk/models/ai_chat_session_message.py index 272ca8ed..710a10ad 100644 --- a/rootly_sdk/models/ai_chat_session_message.py +++ b/rootly_sdk/models/ai_chat_session_message.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/ai_chat_session_message_list.py b/rootly_sdk/models/ai_chat_session_message_list.py index 7d5486bd..30301e4a 100644 --- a/rootly_sdk/models/ai_chat_session_message_list.py +++ b/rootly_sdk/models/ai_chat_session_message_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class AiChatSessionMessageList: """ Attributes: - messages (list[AiChatSessionMessage]): - meta (AiChatSessionMessageListMeta | Unset): + messages (list['AiChatSessionMessage']): + meta (Union[Unset, AiChatSessionMessageListMeta]): """ - messages: list[AiChatSessionMessage] - meta: AiChatSessionMessageListMeta | Unset = UNSET + messages: list["AiChatSessionMessage"] + meta: Union[Unset, "AiChatSessionMessageListMeta"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - messages = [] for messages_item_data in self.messages: messages_item = messages_item_data.to_dict() messages.append(messages_item) - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -65,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: messages.append(messages_item) _meta = d.pop("meta", UNSET) - meta: AiChatSessionMessageListMeta | Unset + meta: Unset | AiChatSessionMessageListMeta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/ai_chat_session_message_list_meta.py b/rootly_sdk/models/ai_chat_session_message_list_meta.py index 6d3a6dd3..c338c5d4 100644 --- a/rootly_sdk/models/ai_chat_session_message_list_meta.py +++ b/rootly_sdk/models/ai_chat_session_message_list_meta.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AiChatSessionMessageListMeta: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/alert.py b/rootly_sdk/models/alert.py index db843d35..c4303e8e 100644 --- a/rootly_sdk/models/alert.py +++ b/rootly_sdk/models/alert.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,44 +37,46 @@ class Alert: summary (str): The summary of the alert created_at (str): Date of creation updated_at (str): Date of last update - noise (AlertNoise | Unset): Whether the alert is marked as noise - status (AlertStatus | Unset): The status of the alert - description (None | str | Unset): The description of the alert - services (list[Service] | Unset): Services attached to the alert - groups (list[Team] | Unset): Groups attached to the alert - functionalities (list[Functionality] | Unset): Functionalities attached to the alert - environments (list[Environment] | Unset): Environments attached to the alert - service_ids (list[str] | None | Unset): The Service IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Service. This field will be automatically set for you. - group_ids (list[str] | None | Unset): The Group IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Group. This field will be automatically set for you. - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the alert - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the alert - external_id (None | str | Unset): External ID - external_url (None | str | Unset): External Url - alert_urgency_id (None | str | Unset): The ID of the alert urgency - alert_urgency (AlertUrgency | Unset): - group_leader_alert_id (None | str | Unset): The ID of the group leader alert - is_group_leader_alert (bool | None | Unset): Whether the alert is a group leader alert - labels (list[AlertLabelsItemType0 | None] | Unset): - data (AlertDataType0 | None | Unset): Additional data - notification_target_type (AlertNotificationTargetType | Unset): Only available for organizations with Rootly On- - Call enabled. Can be one of Group, Service, EscalationPolicy, Functionality, User. - notification_target_id (None | str | Unset): Only available for organizations with Rootly On-Call enabled. The - identifier of the notification target object. - deduplication_key (None | str | Unset): Alerts sharing the same deduplication key are treated as a single alert. - alert_field_values (list[AlertAlertFieldValuesType0Item] | None | Unset): Custom alert field values associated - with the alert. Only present when the enable_alert_fields feature flag is enabled for the team. - responders (list[UserFlatResponse] | None | Unset): Users who responded to the alert. Included on all non-list - responses (show, create, update, resolve, etc.); on list responses only when `include=responders` is requested. - notified_users (list[User] | None | Unset): Users who were notified about the alert. Included on all non-list - responses (show, create, update, resolve, etc.); on list responses only when `include=notified_users` is + noise (Union[Unset, AlertNoise]): Whether the alert is marked as noise + status (Union[Unset, AlertStatus]): The status of the alert + description (Union[None, Unset, str]): The description of the alert + services (Union[Unset, list['Service']]): Services attached to the alert + groups (Union[Unset, list['Team']]): Groups attached to the alert + functionalities (Union[Unset, list['Functionality']]): Functionalities attached to the alert + environments (Union[Unset, list['Environment']]): Environments attached to the alert + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the alert. If your organization has + On-Call enabled and your notification target is a Service. This field will be automatically set for you. + group_ids (Union[None, Unset, list[str]]): The Group IDs to attach to the alert. If your organization has On- + Call enabled and your notification target is a Group. This field will be automatically set for you. + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the alert + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the alert + external_id (Union[None, Unset, str]): External ID + external_url (Union[None, Unset, str]): External Url + alert_urgency_id (Union[None, Unset, str]): The ID of the alert urgency + alert_urgency (Union[Unset, AlertUrgency]): + group_leader_alert_id (Union[None, Unset, str]): The ID of the group leader alert + is_group_leader_alert (Union[None, Unset, bool]): Whether the alert is a group leader alert + labels (Union[Unset, list[Union['AlertLabelsItemType0', None]]]): + data (Union['AlertDataType0', None, Unset]): Additional data + notification_target_type (Union[Unset, AlertNotificationTargetType]): Only available for organizations with + Rootly On-Call enabled. Can be one of Group, Service, EscalationPolicy, Functionality, User. + notification_target_id (Union[None, Unset, str]): Only available for organizations with Rootly On-Call enabled. + The identifier of the notification target object. + deduplication_key (Union[None, Unset, str]): Alerts sharing the same deduplication key are treated as a single + alert. + alert_field_values (Union[None, Unset, list['AlertAlertFieldValuesType0Item']]): Custom alert field values + associated with the alert. Only present when the enable_alert_fields feature flag is enabled for the team. + responders (Union[None, Unset, list['UserFlatResponse']]): Users who responded to the alert. Included on all + non-list responses (show, create, update, resolve, etc.); on list responses only when `include=responders` is + requested. + notified_users (Union[None, Unset, list['User']]): Users who were notified about the alert. Included on all non- + list responses (show, create, update, resolve, etc.); on list responses only when `include=notified_users` is requested. - alerting_targets (list[AlertAlertingTargetsType0Item] | None | Unset): Alerting targets associated with the - alert. Only present when advanced routing is enabled for the team. - url (str | Unset): The Rootly dashboard URL for the alert - started_at (datetime.datetime | None | Unset): When the alert started - ended_at (datetime.datetime | None | Unset): When the alert ended + alerting_targets (Union[None, Unset, list['AlertAlertingTargetsType0Item']]): Alerting targets associated with + the alert. Only present when advanced routing is enabled for the team. + url (Union[Unset, str]): The Rootly dashboard URL for the alert + started_at (Union[None, Unset, datetime.datetime]): When the alert started + ended_at (Union[None, Unset, datetime.datetime]): When the alert ended """ short_id: str @@ -84,35 +84,35 @@ class Alert: summary: str created_at: str updated_at: str - noise: AlertNoise | Unset = UNSET - status: AlertStatus | Unset = UNSET - description: None | str | Unset = UNSET - services: list[Service] | Unset = UNSET - groups: list[Team] | Unset = UNSET - functionalities: list[Functionality] | Unset = UNSET - environments: list[Environment] | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - external_id: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - alert_urgency: AlertUrgency | Unset = UNSET - group_leader_alert_id: None | str | Unset = UNSET - is_group_leader_alert: bool | None | Unset = UNSET - labels: list[AlertLabelsItemType0 | None] | Unset = UNSET - data: AlertDataType0 | None | Unset = UNSET - notification_target_type: AlertNotificationTargetType | Unset = UNSET - notification_target_id: None | str | Unset = UNSET - deduplication_key: None | str | Unset = UNSET - alert_field_values: list[AlertAlertFieldValuesType0Item] | None | Unset = UNSET - responders: list[UserFlatResponse] | None | Unset = UNSET - notified_users: list[User] | None | Unset = UNSET - alerting_targets: list[AlertAlertingTargetsType0Item] | None | Unset = UNSET - url: str | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET + noise: Unset | AlertNoise = UNSET + status: Unset | AlertStatus = UNSET + description: None | Unset | str = UNSET + services: Unset | list["Service"] = UNSET + groups: Unset | list["Team"] = UNSET + functionalities: Unset | list["Functionality"] = UNSET + environments: Unset | list["Environment"] = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + external_id: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + alert_urgency: Union[Unset, "AlertUrgency"] = UNSET + group_leader_alert_id: None | Unset | str = UNSET + is_group_leader_alert: None | Unset | bool = UNSET + labels: Unset | list[Union["AlertLabelsItemType0", None]] = UNSET + data: Union["AlertDataType0", None, Unset] = UNSET + notification_target_type: Unset | AlertNotificationTargetType = UNSET + notification_target_id: None | Unset | str = UNSET + deduplication_key: None | Unset | str = UNSET + alert_field_values: None | Unset | list["AlertAlertFieldValuesType0Item"] = UNSET + responders: None | Unset | list["UserFlatResponse"] = UNSET + notified_users: None | Unset | list["User"] = UNSET + alerting_targets: None | Unset | list["AlertAlertingTargetsType0Item"] = UNSET + url: Unset | str = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -129,49 +129,49 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - noise: str | Unset = UNSET + noise: Unset | str = UNSET if not isinstance(self.noise, Unset): noise = self.noise - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - services: list[dict[str, Any]] | Unset = UNSET + services: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.services, Unset): services = [] for services_item_data in self.services: services_item = services_item_data.to_dict() services.append(services_item) - groups: list[dict[str, Any]] | Unset = UNSET + groups: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.groups, Unset): groups = [] for groups_item_data in self.groups: groups_item = groups_item_data.to_dict() groups.append(groups_item) - functionalities: list[dict[str, Any]] | Unset = UNSET + functionalities: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.functionalities, Unset): functionalities = [] for functionalities_item_data in self.functionalities: functionalities_item = functionalities_item_data.to_dict() functionalities.append(functionalities_item) - environments: list[dict[str, Any]] | Unset = UNSET + environments: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.environments, Unset): environments = [] for environments_item_data in self.environments: environments_item = environments_item_data.to_dict() environments.append(environments_item) - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -180,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -189,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -198,7 +198,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -207,52 +207,52 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - alert_urgency: dict[str, Any] | Unset = UNSET + alert_urgency: Unset | dict[str, Any] = UNSET if not isinstance(self.alert_urgency, Unset): alert_urgency = self.alert_urgency.to_dict() - group_leader_alert_id: None | str | Unset + group_leader_alert_id: None | Unset | str if isinstance(self.group_leader_alert_id, Unset): group_leader_alert_id = UNSET else: group_leader_alert_id = self.group_leader_alert_id - is_group_leader_alert: bool | None | Unset + is_group_leader_alert: None | Unset | bool if isinstance(self.is_group_leader_alert, Unset): is_group_leader_alert = UNSET else: is_group_leader_alert = self.is_group_leader_alert - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: None | dict[str, Any] if isinstance(labels_item_data, AlertLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, AlertDataType0): @@ -260,23 +260,23 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - notification_target_type: str | Unset = UNSET + notification_target_type: Unset | str = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: None | str | Unset + notification_target_id: None | Unset | str if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - deduplication_key: None | str | Unset + deduplication_key: None | Unset | str if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values: list[dict[str, Any]] | None | Unset + alert_field_values: None | Unset | list[dict[str, Any]] if isinstance(self.alert_field_values, Unset): alert_field_values = UNSET elif isinstance(self.alert_field_values, list): @@ -288,7 +288,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_field_values = self.alert_field_values - responders: list[dict[str, Any]] | None | Unset + responders: None | Unset | list[dict[str, Any]] if isinstance(self.responders, Unset): responders = UNSET elif isinstance(self.responders, list): @@ -300,7 +300,7 @@ def to_dict(self) -> dict[str, Any]: else: responders = self.responders - notified_users: list[dict[str, Any]] | None | Unset + notified_users: None | Unset | list[dict[str, Any]] if isinstance(self.notified_users, Unset): notified_users = UNSET elif isinstance(self.notified_users, list): @@ -312,7 +312,7 @@ def to_dict(self) -> dict[str, Any]: else: notified_users = self.notified_users - alerting_targets: list[dict[str, Any]] | None | Unset + alerting_targets: None | Unset | list[dict[str, Any]] if isinstance(self.alerting_targets, Unset): alerting_targets = UNSET elif isinstance(self.alerting_targets, list): @@ -326,7 +326,7 @@ def to_dict(self) -> dict[str, Any]: url = self.url - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -334,7 +334,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -440,65 +440,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _noise = d.pop("noise", UNSET) - noise: AlertNoise | Unset + noise: Unset | AlertNoise if isinstance(_noise, Unset): noise = UNSET else: noise = check_alert_noise(_noise) _status = d.pop("status", UNSET) - status: AlertStatus | Unset + status: Unset | AlertStatus if isinstance(_status, Unset): status = UNSET else: status = check_alert_status(_status) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + services = [] _services = d.pop("services", UNSET) - services: list[Service] | Unset = UNSET - if _services is not UNSET: - services = [] - for services_item_data in _services: - services_item = Service.from_dict(services_item_data) + for services_item_data in _services or []: + services_item = Service.from_dict(services_item_data) - services.append(services_item) + services.append(services_item) + groups = [] _groups = d.pop("groups", UNSET) - groups: list[Team] | Unset = UNSET - if _groups is not UNSET: - groups = [] - for groups_item_data in _groups: - groups_item = Team.from_dict(groups_item_data) + for groups_item_data in _groups or []: + groups_item = Team.from_dict(groups_item_data) - groups.append(groups_item) + groups.append(groups_item) + functionalities = [] _functionalities = d.pop("functionalities", UNSET) - functionalities: list[Functionality] | Unset = UNSET - if _functionalities is not UNSET: - functionalities = [] - for functionalities_item_data in _functionalities: - functionalities_item = Functionality.from_dict(functionalities_item_data) + for functionalities_item_data in _functionalities or []: + functionalities_item = Functionality.from_dict(functionalities_item_data) - functionalities.append(functionalities_item) + functionalities.append(functionalities_item) + environments = [] _environments = d.pop("environments", UNSET) - environments: list[Environment] | Unset = UNSET - if _environments is not UNSET: - environments = [] - for environments_item_data in _environments: - environments_item = Environment.from_dict(environments_item_data) + for environments_item_data in _environments or []: + environments_item = Environment.from_dict(environments_item_data) - environments.append(environments_item) + environments.append(environments_item) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -509,13 +501,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -526,13 +518,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -543,13 +535,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -560,88 +552,86 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _alert_urgency = d.pop("alert_urgency", UNSET) - alert_urgency: AlertUrgency | Unset + alert_urgency: Unset | AlertUrgency if isinstance(_alert_urgency, Unset): alert_urgency = UNSET else: alert_urgency = AlertUrgency.from_dict(_alert_urgency) - def _parse_group_leader_alert_id(data: object) -> None | str | Unset: + def _parse_group_leader_alert_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) group_leader_alert_id = _parse_group_leader_alert_id(d.pop("group_leader_alert_id", UNSET)) - def _parse_is_group_leader_alert(data: object) -> bool | None | Unset: + def _parse_is_group_leader_alert(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) is_group_leader_alert = _parse_is_group_leader_alert(d.pop("is_group_leader_alert", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[AlertLabelsItemType0 | None] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> AlertLabelsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = AlertLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["AlertLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = AlertLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AlertLabelsItemType0 | None, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["AlertLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) - def _parse_data(data: object) -> AlertDataType0 | None | Unset: + def _parse_data(data: object) -> Union["AlertDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -652,38 +642,38 @@ def _parse_data(data: object) -> AlertDataType0 | None | Unset: data_type_0 = AlertDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertDataType0 | None | Unset, data) + return cast(Union["AlertDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: AlertNotificationTargetType | Unset + notification_target_type: Unset | AlertNotificationTargetType if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: notification_target_type = check_alert_notification_target_type(_notification_target_type) - def _parse_notification_target_id(data: object) -> None | str | Unset: + def _parse_notification_target_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) - def _parse_deduplication_key(data: object) -> None | str | Unset: + def _parse_deduplication_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) - def _parse_alert_field_values(data: object) -> list[AlertAlertFieldValuesType0Item] | None | Unset: + def _parse_alert_field_values(data: object) -> None | Unset | list["AlertAlertFieldValuesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -701,13 +691,13 @@ def _parse_alert_field_values(data: object) -> list[AlertAlertFieldValuesType0It alert_field_values_type_0.append(alert_field_values_type_0_item) return alert_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[AlertAlertFieldValuesType0Item] | None | Unset, data) + return cast(None | Unset | list["AlertAlertFieldValuesType0Item"], data) alert_field_values = _parse_alert_field_values(d.pop("alert_field_values", UNSET)) - def _parse_responders(data: object) -> list[UserFlatResponse] | None | Unset: + def _parse_responders(data: object) -> None | Unset | list["UserFlatResponse"]: if data is None: return data if isinstance(data, Unset): @@ -723,13 +713,13 @@ def _parse_responders(data: object) -> list[UserFlatResponse] | None | Unset: responders_type_0.append(responders_type_0_item) return responders_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UserFlatResponse] | None | Unset, data) + return cast(None | Unset | list["UserFlatResponse"], data) responders = _parse_responders(d.pop("responders", UNSET)) - def _parse_notified_users(data: object) -> list[User] | None | Unset: + def _parse_notified_users(data: object) -> None | Unset | list["User"]: if data is None: return data if isinstance(data, Unset): @@ -745,13 +735,13 @@ def _parse_notified_users(data: object) -> list[User] | None | Unset: notified_users_type_0.append(notified_users_type_0_item) return notified_users_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[User] | None | Unset, data) + return cast(None | Unset | list["User"], data) notified_users = _parse_notified_users(d.pop("notified_users", UNSET)) - def _parse_alerting_targets(data: object) -> list[AlertAlertingTargetsType0Item] | None | Unset: + def _parse_alerting_targets(data: object) -> None | Unset | list["AlertAlertingTargetsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -769,15 +759,15 @@ def _parse_alerting_targets(data: object) -> list[AlertAlertingTargetsType0Item] alerting_targets_type_0.append(alerting_targets_type_0_item) return alerting_targets_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[AlertAlertingTargetsType0Item] | None | Unset, data) + return cast(None | Unset | list["AlertAlertingTargetsType0Item"], data) alerting_targets = _parse_alerting_targets(d.pop("alerting_targets", UNSET)) url = d.pop("url", UNSET) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -788,13 +778,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -805,9 +795,9 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) diff --git a/rootly_sdk/models/alert_alert_field_values_type_0_item.py b/rootly_sdk/models/alert_alert_field_values_type_0_item.py index 2be2c603..1e14bd36 100644 --- a/rootly_sdk/models/alert_alert_field_values_type_0_item.py +++ b/rootly_sdk/models/alert_alert_field_values_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_alerting_targets_type_0_item.py b/rootly_sdk/models/alert_alerting_targets_type_0_item.py index 2ed599cc..056c6203 100644 --- a/rootly_sdk/models/alert_alerting_targets_type_0_item.py +++ b/rootly_sdk/models/alert_alerting_targets_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_data_type_0.py b/rootly_sdk/models/alert_data_type_0.py index ce1e2630..a1daf88d 100644 --- a/rootly_sdk/models/alert_data_type_0.py +++ b/rootly_sdk/models/alert_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AlertDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/alert_event.py b/rootly_sdk/models/alert_event.py index 66639594..035387e9 100644 --- a/rootly_sdk/models/alert_event.py +++ b/rootly_sdk/models/alert_event.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,17 +29,17 @@ class AlertEvent: source (str): created_at (str): updated_at (str): - user_id (int | None | Unset): Author of the note. - details (None | str | Unset): Note message. - user (AlertEventUser | Unset): - incident (AlertEventIncidentType0 | None | Unset): - schedule (AlertEventScheduleType0 | None | Unset): - escalation_level (int | None | Unset): - escalation_target_type (None | str | Unset): e.g. EscalationPolicy, User. - escalation_target (AlertEventEscalationTargetType0 | None | Unset): JSON:API-wrapped escalation target (User or - EscalationPolicy). - slack_channel (SlackChannel | Unset): - incident_ids (list[str] | None | Unset): + user_id (Union[None, Unset, int]): Author of the note. + details (Union[None, Unset, str]): Note message. + user (Union[Unset, AlertEventUser]): + incident (Union['AlertEventIncidentType0', None, Unset]): + schedule (Union['AlertEventScheduleType0', None, Unset]): + escalation_level (Union[None, Unset, int]): + escalation_target_type (Union[None, Unset, str]): e.g. EscalationPolicy, User. + escalation_target (Union['AlertEventEscalationTargetType0', None, Unset]): JSON:API-wrapped escalation target + (User or EscalationPolicy). + slack_channel (Union[Unset, SlackChannel]): + incident_ids (Union[None, Unset, list[str]]): """ alert_id: str @@ -50,16 +48,16 @@ class AlertEvent: source: str created_at: str updated_at: str - user_id: int | None | Unset = UNSET - details: None | str | Unset = UNSET - user: AlertEventUser | Unset = UNSET - incident: AlertEventIncidentType0 | None | Unset = UNSET - schedule: AlertEventScheduleType0 | None | Unset = UNSET - escalation_level: int | None | Unset = UNSET - escalation_target_type: None | str | Unset = UNSET - escalation_target: AlertEventEscalationTargetType0 | None | Unset = UNSET - slack_channel: SlackChannel | Unset = UNSET - incident_ids: list[str] | None | Unset = UNSET + user_id: None | Unset | int = UNSET + details: None | Unset | str = UNSET + user: Union[Unset, "AlertEventUser"] = UNSET + incident: Union["AlertEventIncidentType0", None, Unset] = UNSET + schedule: Union["AlertEventScheduleType0", None, Unset] = UNSET + escalation_level: None | Unset | int = UNSET + escalation_target_type: None | Unset | str = UNSET + escalation_target: Union["AlertEventEscalationTargetType0", None, Unset] = UNSET + slack_channel: Union[Unset, "SlackChannel"] = UNSET + incident_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -79,23 +77,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - user_id: int | None | Unset + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - details: None | str | Unset + details: None | Unset | str if isinstance(self.details, Unset): details = UNSET else: details = self.details - user: dict[str, Any] | Unset = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - incident: dict[str, Any] | None | Unset + incident: None | Unset | dict[str, Any] if isinstance(self.incident, Unset): incident = UNSET elif isinstance(self.incident, AlertEventIncidentType0): @@ -103,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: incident = self.incident - schedule: dict[str, Any] | None | Unset + schedule: None | Unset | dict[str, Any] if isinstance(self.schedule, Unset): schedule = UNSET elif isinstance(self.schedule, AlertEventScheduleType0): @@ -111,19 +109,19 @@ def to_dict(self) -> dict[str, Any]: else: schedule = self.schedule - escalation_level: int | None | Unset + escalation_level: None | Unset | int if isinstance(self.escalation_level, Unset): escalation_level = UNSET else: escalation_level = self.escalation_level - escalation_target_type: None | str | Unset + escalation_target_type: None | Unset | str if isinstance(self.escalation_target_type, Unset): escalation_target_type = UNSET else: escalation_target_type = self.escalation_target_type - escalation_target: dict[str, Any] | None | Unset + escalation_target: None | Unset | dict[str, Any] if isinstance(self.escalation_target, Unset): escalation_target = UNSET elif isinstance(self.escalation_target, AlertEventEscalationTargetType0): @@ -131,11 +129,11 @@ def to_dict(self) -> dict[str, Any]: else: escalation_target = self.escalation_target - slack_channel: dict[str, Any] | Unset = UNSET + slack_channel: Unset | dict[str, Any] = UNSET if not isinstance(self.slack_channel, Unset): slack_channel = self.slack_channel.to_dict() - incident_ids: list[str] | None | Unset + incident_ids: None | Unset | list[str] if isinstance(self.incident_ids, Unset): incident_ids = UNSET elif isinstance(self.incident_ids, list): @@ -200,32 +198,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_details(data: object) -> None | str | Unset: + def _parse_details(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) details = _parse_details(d.pop("details", UNSET)) _user = d.pop("user", UNSET) - user: AlertEventUser | Unset + user: Unset | AlertEventUser if isinstance(_user, Unset): user = UNSET else: user = AlertEventUser.from_dict(_user) - def _parse_incident(data: object) -> AlertEventIncidentType0 | None | Unset: + def _parse_incident(data: object) -> Union["AlertEventIncidentType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -236,13 +234,13 @@ def _parse_incident(data: object) -> AlertEventIncidentType0 | None | Unset: incident_type_0 = AlertEventIncidentType0.from_dict(data) return incident_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertEventIncidentType0 | None | Unset, data) + return cast(Union["AlertEventIncidentType0", None, Unset], data) incident = _parse_incident(d.pop("incident", UNSET)) - def _parse_schedule(data: object) -> AlertEventScheduleType0 | None | Unset: + def _parse_schedule(data: object) -> Union["AlertEventScheduleType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -253,31 +251,31 @@ def _parse_schedule(data: object) -> AlertEventScheduleType0 | None | Unset: schedule_type_0 = AlertEventScheduleType0.from_dict(data) return schedule_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertEventScheduleType0 | None | Unset, data) + return cast(Union["AlertEventScheduleType0", None, Unset], data) schedule = _parse_schedule(d.pop("schedule", UNSET)) - def _parse_escalation_level(data: object) -> int | None | Unset: + def _parse_escalation_level(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) escalation_level = _parse_escalation_level(d.pop("escalation_level", UNSET)) - def _parse_escalation_target_type(data: object) -> None | str | Unset: + def _parse_escalation_target_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_target_type = _parse_escalation_target_type(d.pop("escalation_target_type", UNSET)) - def _parse_escalation_target(data: object) -> AlertEventEscalationTargetType0 | None | Unset: + def _parse_escalation_target(data: object) -> Union["AlertEventEscalationTargetType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -288,20 +286,20 @@ def _parse_escalation_target(data: object) -> AlertEventEscalationTargetType0 | escalation_target_type_0 = AlertEventEscalationTargetType0.from_dict(data) return escalation_target_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertEventEscalationTargetType0 | None | Unset, data) + return cast(Union["AlertEventEscalationTargetType0", None, Unset], data) escalation_target = _parse_escalation_target(d.pop("escalation_target", UNSET)) _slack_channel = d.pop("slack_channel", UNSET) - slack_channel: SlackChannel | Unset + slack_channel: Unset | SlackChannel if isinstance(_slack_channel, Unset): slack_channel = UNSET else: slack_channel = SlackChannel.from_dict(_slack_channel) - def _parse_incident_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -312,9 +310,9 @@ def _parse_incident_ids(data: object) -> list[str] | None | Unset: incident_ids_type_0 = cast(list[str], data) return incident_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_ids = _parse_incident_ids(d.pop("incident_ids", UNSET)) diff --git a/rootly_sdk/models/alert_event_action.py b/rootly_sdk/models/alert_event_action.py index ed9276ab..4bd1983e 100644 --- a/rootly_sdk/models/alert_event_action.py +++ b/rootly_sdk/models/alert_event_action.py @@ -1,12 +1,14 @@ from typing import Literal, cast AlertEventAction = Literal[ + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -25,6 +27,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", @@ -35,12 +38,14 @@ ] ALERT_EVENT_ACTION_VALUES: set[AlertEventAction] = { + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -59,6 +64,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0.py b/rootly_sdk/models/alert_event_escalation_target_type_0.py index 5d706e96..d6c59111 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,15 +18,14 @@ class AlertEventEscalationTargetType0: """JSON:API-wrapped escalation target (User or EscalationPolicy). Attributes: - data (AlertEventEscalationTargetType0Data | Unset): + data (Union[Unset, AlertEventEscalationTargetType0Data]): """ - data: AlertEventEscalationTargetType0Data | Unset = UNSET + data: Union[Unset, "AlertEventEscalationTargetType0Data"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +43,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: AlertEventEscalationTargetType0Data | Unset + data: Unset | AlertEventEscalationTargetType0Data if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0_data.py b/rootly_sdk/models/alert_event_escalation_target_type_0_data.py index 70c7da0d..75d6a66f 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0_data.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,23 +19,22 @@ class AlertEventEscalationTargetType0Data: """ Attributes: - id (str | Unset): - type_ (str | Unset): e.g. users, escalation_policies. - attributes (AlertEventEscalationTargetType0DataAttributes | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, str]): e.g. users, escalation_policies. + attributes (Union[Unset, AlertEventEscalationTargetType0DataAttributes]): """ - id: str | Unset = UNSET - type_: str | Unset = UNSET - attributes: AlertEventEscalationTargetType0DataAttributes | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | str = UNSET + attributes: Union[Unset, "AlertEventEscalationTargetType0DataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: AlertEventEscalationTargetType0DataAttributes | Unset + attributes: Unset | AlertEventEscalationTargetType0DataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py b/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py index dc65c652..26c8be3a 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AlertEventEscalationTargetType0DataAttributes: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/alert_event_feed_list.py b/rootly_sdk/models/alert_event_feed_list.py index bf831ccd..726b2d24 100644 --- a/rootly_sdk/models/alert_event_feed_list.py +++ b/rootly_sdk/models/alert_event_feed_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,21 +20,20 @@ class AlertEventFeedList: """ Attributes: - data (list[AlertEventFeedListDataItem]): + data (list['AlertEventFeedListDataItem']): meta (AlertEventFeedMeta): Cursor-pagination meta. `total_count` and `total_pages` are nullable because the feed does not run a COUNT query. - links (Links | Unset): - included (list[JsonapiIncludedResource] | Unset): + links (Union[Unset, Links]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertEventFeedListDataItem] - meta: AlertEventFeedMeta - links: Links | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertEventFeedListDataItem"] + meta: "AlertEventFeedMeta" + links: Union[Unset, "Links"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -44,11 +41,11 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,20 +85,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = AlertEventFeedMeta.from_dict(d.pop("meta")) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_event_feed_list = cls( data=data, diff --git a/rootly_sdk/models/alert_event_feed_list_data_item.py b/rootly_sdk/models/alert_event_feed_list_data_item.py index acf7a370..7016830c 100644 --- a/rootly_sdk/models/alert_event_feed_list_data_item.py +++ b/rootly_sdk/models/alert_event_feed_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertEventFeedListDataItem: id: str type_: AlertEventFeedListDataItemType - attributes: AlertEvent + attributes: "AlertEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_event_feed_meta.py b/rootly_sdk/models/alert_event_feed_meta.py index cde271b6..9c99a935 100644 --- a/rootly_sdk/models/alert_event_feed_meta.py +++ b/rootly_sdk/models/alert_event_feed_meta.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,51 +14,51 @@ class AlertEventFeedMeta: """Cursor-pagination meta. `total_count` and `total_pages` are nullable because the feed does not run a COUNT query. Attributes: - next_cursor (None | str): Pass as `page[after]` on the next request to fetch the following page. - current_page (int | None | Unset): - next_page (int | None | Unset): - prev_page (int | None | Unset): - total_count (int | None | Unset): - total_pages (int | None | Unset): + next_cursor (Union[None, str]): Pass as `page[after]` on the next request to fetch the following page. + current_page (Union[None, Unset, int]): + next_page (Union[None, Unset, int]): + prev_page (Union[None, Unset, int]): + total_count (Union[None, Unset, int]): + total_pages (Union[None, Unset, int]): """ next_cursor: None | str - current_page: int | None | Unset = UNSET - next_page: int | None | Unset = UNSET - prev_page: int | None | Unset = UNSET - total_count: int | None | Unset = UNSET - total_pages: int | None | Unset = UNSET + current_page: None | Unset | int = UNSET + next_page: None | Unset | int = UNSET + prev_page: None | Unset | int = UNSET + total_count: None | Unset | int = UNSET + total_pages: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: next_cursor: None | str next_cursor = self.next_cursor - current_page: int | None | Unset + current_page: None | Unset | int if isinstance(self.current_page, Unset): current_page = UNSET else: current_page = self.current_page - next_page: int | None | Unset + next_page: None | Unset | int if isinstance(self.next_page, Unset): next_page = UNSET else: next_page = self.next_page - prev_page: int | None | Unset + prev_page: None | Unset | int if isinstance(self.prev_page, Unset): prev_page = UNSET else: prev_page = self.prev_page - total_count: int | None | Unset + total_count: None | Unset | int if isinstance(self.total_count, Unset): total_count = UNSET else: total_count = self.total_count - total_pages: int | None | Unset + total_pages: None | Unset | int if isinstance(self.total_pages, Unset): total_pages = UNSET else: @@ -97,48 +95,48 @@ def _parse_next_cursor(data: object) -> None | str: next_cursor = _parse_next_cursor(d.pop("next_cursor")) - def _parse_current_page(data: object) -> int | None | Unset: + def _parse_current_page(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) current_page = _parse_current_page(d.pop("current_page", UNSET)) - def _parse_next_page(data: object) -> int | None | Unset: + def _parse_next_page(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) next_page = _parse_next_page(d.pop("next_page", UNSET)) - def _parse_prev_page(data: object) -> int | None | Unset: + def _parse_prev_page(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) prev_page = _parse_prev_page(d.pop("prev_page", UNSET)) - def _parse_total_count(data: object) -> int | None | Unset: + def _parse_total_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) total_count = _parse_total_count(d.pop("total_count", UNSET)) - def _parse_total_pages(data: object) -> int | None | Unset: + def _parse_total_pages(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) total_pages = _parse_total_pages(d.pop("total_pages", UNSET)) diff --git a/rootly_sdk/models/alert_event_incident_type_0.py b/rootly_sdk/models/alert_event_incident_type_0.py index 902f09f6..13c40982 100644 --- a/rootly_sdk/models/alert_event_incident_type_0.py +++ b/rootly_sdk/models/alert_event_incident_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,40 +13,40 @@ class AlertEventIncidentType0: """ Attributes: - id (str | Unset): - sequential_id (int | None | Unset): - title (str | Unset): - slug (str | Unset): - kind (str | Unset): - status (str | Unset): - private (bool | Unset): - description (None | str | Unset): - started_at (None | str | Unset): - duration (int | None | Unset): Duration in seconds. - url (str | Unset): - created_at (str | Unset): - updated_at (str | Unset): + id (Union[Unset, str]): + sequential_id (Union[None, Unset, int]): + title (Union[Unset, str]): + slug (Union[Unset, str]): + kind (Union[Unset, str]): + status (Union[Unset, str]): + private (Union[Unset, bool]): + description (Union[None, Unset, str]): + started_at (Union[None, Unset, str]): + duration (Union[None, Unset, int]): Duration in seconds. + url (Union[Unset, str]): + created_at (Union[Unset, str]): + updated_at (Union[Unset, str]): """ - id: str | Unset = UNSET - sequential_id: int | None | Unset = UNSET - title: str | Unset = UNSET - slug: str | Unset = UNSET - kind: str | Unset = UNSET - status: str | Unset = UNSET - private: bool | Unset = UNSET - description: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - duration: int | None | Unset = UNSET - url: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | str = UNSET + sequential_id: None | Unset | int = UNSET + title: Unset | str = UNSET + slug: Unset | str = UNSET + kind: Unset | str = UNSET + status: Unset | str = UNSET + private: Unset | bool = UNSET + description: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + duration: None | Unset | int = UNSET + url: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - sequential_id: int | None | Unset + sequential_id: None | Unset | int if isinstance(self.sequential_id, Unset): sequential_id = UNSET else: @@ -64,19 +62,19 @@ def to_dict(self) -> dict[str, Any]: private = self.private - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - duration: int | None | Unset + duration: None | Unset | int if isinstance(self.duration, Unset): duration = UNSET else: @@ -125,12 +123,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id", UNSET) - def _parse_sequential_id(data: object) -> int | None | Unset: + def _parse_sequential_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) sequential_id = _parse_sequential_id(d.pop("sequential_id", UNSET)) @@ -144,30 +142,30 @@ def _parse_sequential_id(data: object) -> int | None | Unset: private = d.pop("private", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_duration(data: object) -> int | None | Unset: + def _parse_duration(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) duration = _parse_duration(d.pop("duration", UNSET)) diff --git a/rootly_sdk/models/alert_event_list.py b/rootly_sdk/models/alert_event_list.py index 796c0bfd..db503596 100644 --- a/rootly_sdk/models/alert_event_list.py +++ b/rootly_sdk/models/alert_event_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AlertEventList: """ Attributes: - data (list[AlertEventListDataItem]): + data (list['AlertEventListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertEventListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertEventListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_event_list = cls( data=data, diff --git a/rootly_sdk/models/alert_event_list_data_item.py b/rootly_sdk/models/alert_event_list_data_item.py index 3691da9b..9228289f 100644 --- a/rootly_sdk/models/alert_event_list_data_item.py +++ b/rootly_sdk/models/alert_event_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertEventListDataItem: id: str type_: AlertEventListDataItemType - attributes: AlertEvent + attributes: "AlertEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_event_response.py b/rootly_sdk/models/alert_event_response.py index 95a9e35b..c929be5d 100644 --- a/rootly_sdk/models/alert_event_response.py +++ b/rootly_sdk/models/alert_event_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertEventResponse: """ Attributes: data (AlertEventResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertEventResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertEventResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertEventResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_event_response = cls( data=data, diff --git a/rootly_sdk/models/alert_event_response_data.py b/rootly_sdk/models/alert_event_response_data.py index 5fddf97f..7bb109dc 100644 --- a/rootly_sdk/models/alert_event_response_data.py +++ b/rootly_sdk/models/alert_event_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertEventResponseData: id: str type_: AlertEventResponseDataType - attributes: AlertEvent + attributes: "AlertEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_event_schedule_type_0.py b/rootly_sdk/models/alert_event_schedule_type_0.py index fb8c5b4c..d18aab86 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0.py +++ b/rootly_sdk/models/alert_event_schedule_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -21,35 +19,34 @@ class AlertEventScheduleType0: """ Attributes: - id (str | Unset): - name (str | Unset): - description (None | str | Unset): - escalation_policies (list[AlertEventScheduleType0EscalationPoliciesItem] | Unset): - created_at (str | Unset): - updated_at (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): + description (Union[None, Unset, str]): + escalation_policies (Union[Unset, list['AlertEventScheduleType0EscalationPoliciesItem']]): + created_at (Union[Unset, str]): + updated_at (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET - description: None | str | Unset = UNSET - escalation_policies: list[AlertEventScheduleType0EscalationPoliciesItem] | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + escalation_policies: Unset | list["AlertEventScheduleType0EscalationPoliciesItem"] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - escalation_policies: list[dict[str, Any]] | Unset = UNSET + escalation_policies: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: @@ -89,25 +86,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + escalation_policies = [] _escalation_policies = d.pop("escalation_policies", UNSET) - escalation_policies: list[AlertEventScheduleType0EscalationPoliciesItem] | Unset = UNSET - if _escalation_policies is not UNSET: - escalation_policies = [] - for escalation_policies_item_data in _escalation_policies: - escalation_policies_item = AlertEventScheduleType0EscalationPoliciesItem.from_dict( - escalation_policies_item_data - ) + for escalation_policies_item_data in _escalation_policies or []: + escalation_policies_item = AlertEventScheduleType0EscalationPoliciesItem.from_dict( + escalation_policies_item_data + ) - escalation_policies.append(escalation_policies_item) + escalation_policies.append(escalation_policies_item) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py b/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py index 3f33fcf9..aea276ce 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py +++ b/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,16 +13,16 @@ class AlertEventScheduleType0EscalationPoliciesItem: """ Attributes: - id (str | Unset): - name (str | Unset): - created_at (str | Unset): - updated_at (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): + created_at (Union[Unset, str]): + updated_at (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_event_user.py b/rootly_sdk/models/alert_event_user.py index d299cff7..961ceb22 100644 --- a/rootly_sdk/models/alert_event_user.py +++ b/rootly_sdk/models/alert_event_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,11 +18,11 @@ class AlertEventUser: email (str): created_at (str): updated_at (str): - first_name (None | str | Unset): - last_name (None | str | Unset): - preferred_name (None | str | Unset): - full_name (None | str | Unset): - time_zone (None | str | Unset): + first_name (Union[None, Unset, str]): + last_name (Union[None, Unset, str]): + preferred_name (Union[None, Unset, str]): + full_name (Union[None, Unset, str]): + time_zone (Union[None, Unset, str]): """ id: int @@ -32,11 +30,11 @@ class AlertEventUser: email: str created_at: str updated_at: str - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - preferred_name: None | str | Unset = UNSET - full_name: None | str | Unset = UNSET - time_zone: None | str | Unset = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + preferred_name: None | Unset | str = UNSET + full_name: None | Unset | str = UNSET + time_zone: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,31 +48,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: None | str | Unset + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: None | str | Unset + preferred_name: None | Unset | str if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: None | str | Unset + full_name: None | Unset | str if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -117,48 +115,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> None | str | Unset: + def _parse_preferred_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> None | str | Unset: + def _parse_full_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/alert_field.py b/rootly_sdk/models/alert_field.py index 57d6df37..1796e3d9 100644 --- a/rootly_sdk/models/alert_field.py +++ b/rootly_sdk/models/alert_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,14 +17,14 @@ class AlertField: kind (str): The kind of alert field created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the alert field + slug (Union[Unset, str]): The slug of the alert field """ name: str kind: str created_at: str updated_at: str - slug: str | Unset = UNSET + slug: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_field_list.py b/rootly_sdk/models/alert_field_list.py index 24964325..d0fb658d 100644 --- a/rootly_sdk/models/alert_field_list.py +++ b/rootly_sdk/models/alert_field_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AlertFieldList: """ Attributes: - data (list[AlertFieldListDataItem]): + data (list['AlertFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_field_list = cls( data=data, diff --git a/rootly_sdk/models/alert_field_list_data_item.py b/rootly_sdk/models/alert_field_list_data_item.py index 86f5e2a0..f1b8c603 100644 --- a/rootly_sdk/models/alert_field_list_data_item.py +++ b/rootly_sdk/models/alert_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertFieldListDataItem: id: str type_: AlertFieldListDataItemType - attributes: AlertField + attributes: "AlertField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_field_response.py b/rootly_sdk/models/alert_field_response.py index 17f1725b..e6197c98 100644 --- a/rootly_sdk/models/alert_field_response.py +++ b/rootly_sdk/models/alert_field_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertFieldResponse: """ Attributes: data (AlertFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertFieldResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_field_response = cls( data=data, diff --git a/rootly_sdk/models/alert_field_response_data.py b/rootly_sdk/models/alert_field_response_data.py index ab7e7923..45c54724 100644 --- a/rootly_sdk/models/alert_field_response_data.py +++ b/rootly_sdk/models/alert_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,16 +20,15 @@ class AlertFieldResponseData: Attributes: type_ (AlertFieldResponseDataType): attributes (AlertField): - id (str | Unset): The ID of the alert field + id (Union[Unset, str]): The ID of the alert field """ type_: AlertFieldResponseDataType - attributes: AlertField - id: str | Unset = UNSET + attributes: "AlertField" + id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/alert_group.py b/rootly_sdk/models/alert_group.py index 9a198b9c..f9913184 100644 --- a/rootly_sdk/models/alert_group.py +++ b/rootly_sdk/models/alert_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,21 +20,21 @@ class AlertGroup: """ Attributes: name (str): The name of the alert group - description (None | str): The description of the alert group + description (Union[None, str]): The description of the alert group condition_type (str): Grouping condition for the alert group time_window (int): Time window for the alert grouping created_at (str): Date of creation updated_at (str): Date of last update - deleted_at (None | str): Date or deletion - slug (str | Unset): The slug of the alert group - group_by_alert_title (bool | Unset): [DEPRECATED] Whether the alerts are grouped by title or not. This field is - deprecated. Please use the `conditions` field with advanced alert grouping instead. - group_by_alert_urgency (bool | Unset): [DEPRECATED] Whether the alerts are grouped by urgency or not. This field - is deprecated. Please use the `conditions` field with advanced alert grouping instead. - targets (list[AlertGroupTargetsItem] | Unset): - attributes (list[AlertGroupAttributesItem] | Unset): This field is deprecated. Please use the `conditions` field - instead, `attributes` will be removed in the future. - conditions (list[AlertGroupConditionsItem] | Unset): The conditions for the alert group + deleted_at (Union[None, str]): Date or deletion + slug (Union[Unset, str]): The slug of the alert group + group_by_alert_title (Union[Unset, bool]): [DEPRECATED] Whether the alerts are grouped by title or not. This + field is deprecated. Please use the `conditions` field with advanced alert grouping instead. + group_by_alert_urgency (Union[Unset, bool]): [DEPRECATED] Whether the alerts are grouped by urgency or not. This + field is deprecated. Please use the `conditions` field with advanced alert grouping instead. + targets (Union[Unset, list['AlertGroupTargetsItem']]): + attributes (Union[Unset, list['AlertGroupAttributesItem']]): This field is deprecated. Please use the + `conditions` field instead, `attributes` will be removed in the future. + conditions (Union[Unset, list['AlertGroupConditionsItem']]): The conditions for the alert group """ name: str @@ -46,16 +44,15 @@ class AlertGroup: created_at: str updated_at: str deleted_at: None | str - slug: str | Unset = UNSET - group_by_alert_title: bool | Unset = UNSET - group_by_alert_urgency: bool | Unset = UNSET - targets: list[AlertGroupTargetsItem] | Unset = UNSET - attributes: list[AlertGroupAttributesItem] | Unset = UNSET - conditions: list[AlertGroupConditionsItem] | Unset = UNSET + slug: Unset | str = UNSET + group_by_alert_title: Unset | bool = UNSET + group_by_alert_urgency: Unset | bool = UNSET + targets: Unset | list["AlertGroupTargetsItem"] = UNSET + attributes: Unset | list["AlertGroupAttributesItem"] = UNSET + conditions: Unset | list["AlertGroupConditionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name description: None | str @@ -78,21 +75,21 @@ def to_dict(self) -> dict[str, Any]: group_by_alert_urgency = self.group_by_alert_urgency - targets: list[dict[str, Any]] | Unset = UNSET + targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: list[dict[str, Any]] | Unset = UNSET + attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -164,32 +161,26 @@ def _parse_deleted_at(data: object) -> None | str: group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) + targets = [] _targets = d.pop("targets", UNSET) - targets: list[AlertGroupTargetsItem] | Unset = UNSET - if _targets is not UNSET: - targets = [] - for targets_item_data in _targets: - targets_item = AlertGroupTargetsItem.from_dict(targets_item_data) + for targets_item_data in _targets or []: + targets_item = AlertGroupTargetsItem.from_dict(targets_item_data) - targets.append(targets_item) + targets.append(targets_item) + attributes = [] _attributes = d.pop("attributes", UNSET) - attributes: list[AlertGroupAttributesItem] | Unset = UNSET - if _attributes is not UNSET: - attributes = [] - for attributes_item_data in _attributes: - attributes_item = AlertGroupAttributesItem.from_dict(attributes_item_data) + for attributes_item_data in _attributes or []: + attributes_item = AlertGroupAttributesItem.from_dict(attributes_item_data) - attributes.append(attributes_item) + attributes.append(attributes_item) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertGroupConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertGroupConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertGroupConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) alert_group = cls( name=name, diff --git a/rootly_sdk/models/alert_group_attributes_item.py b/rootly_sdk/models/alert_group_attributes_item.py index 574f2129..120ba12a 100644 --- a/rootly_sdk/models/alert_group_attributes_item.py +++ b/rootly_sdk/models/alert_group_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class AlertGroupAttributesItem: """ Attributes: - json_path (str | Unset): The JSON path to the value to group by. + json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: str | Unset = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_group_conditions_item.py b/rootly_sdk/models/alert_group_conditions_item.py index 7a2c80f7..c521f354 100644 --- a/rootly_sdk/models/alert_group_conditions_item.py +++ b/rootly_sdk/models/alert_group_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,32 +32,32 @@ class AlertGroupConditionsItem: property_field_type (AlertGroupConditionsItemPropertyFieldType): The type of the property field property_field_condition_type (AlertGroupConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_name (None | str | Unset): The name of the property field. If the property field type is selected - as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' - and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the - property field name should be supplied in JSON Path syntax. - property_field_value (None | str | Unset): The value of the property field. Can be null if the property field - condition type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Used if the property field + property_field_name (Union[None, Unset, str]): The name of the property field. If the property field type is + selected as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', + 'alert_urgency' and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', + then the property field name should be supplied in JSON Path syntax. + property_field_value (Union[None, Unset, str]): The value of the property field. Can be null if the property + field condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Used if the property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - values (list[AlertGroupConditionsItemValuesItemType0 | None] | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition. Only need to be - set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property + values (Union[Unset, list[Union['AlertGroupConditionsItemValuesItemType0', None]]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition. Only need to + be set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (AlertGroupConditionsItemConditionableType | Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. + conditionable_type (Union[Unset, AlertGroupConditionsItemConditionableType]): The type of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. """ property_field_type: AlertGroupConditionsItemPropertyFieldType property_field_condition_type: AlertGroupConditionsItemPropertyFieldConditionType - property_field_name: None | str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET - values: list[AlertGroupConditionsItemValuesItemType0 | None] | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: AlertGroupConditionsItemConditionableType | Unset = UNSET - conditionable_id: None | str | Unset = UNSET + property_field_name: None | Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET + values: Unset | list[Union["AlertGroupConditionsItemValuesItemType0", None]] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | AlertGroupConditionsItemConditionableType = UNSET + conditionable_id: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -69,34 +67,34 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_name: None | str | Unset + property_field_name: None | Unset | str if isinstance(self.property_field_name, Unset): property_field_name = UNSET else: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - values: list[dict[str, Any] | None] | Unset = UNSET + values: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.values, Unset): values = [] for values_item_data in self.values: - values_item: dict[str, Any] | None + values_item: None | dict[str, Any] if isinstance(values_item_data, AlertGroupConditionsItemValuesItemType0): values_item = values_item_data.to_dict() else: values_item = values_item_data values.append(values_item) - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -105,11 +103,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: @@ -151,50 +149,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("property_field_condition_type") ) - def _parse_property_field_name(data: object) -> None | str | Unset: + def _parse_property_field_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_name = _parse_property_field_name(d.pop("property_field_name", UNSET)) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) + values = [] _values = d.pop("values", UNSET) - values: list[AlertGroupConditionsItemValuesItemType0 | None] | Unset = UNSET - if _values is not UNSET: - values = [] - for values_item_data in _values: + for values_item_data in _values or []: - def _parse_values_item(data: object) -> AlertGroupConditionsItemValuesItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - values_item_type_0 = AlertGroupConditionsItemValuesItemType0.from_dict(data) + def _parse_values_item(data: object) -> Union["AlertGroupConditionsItemValuesItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + values_item_type_0 = AlertGroupConditionsItemValuesItemType0.from_dict(data) - return values_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AlertGroupConditionsItemValuesItemType0 | None, data) + return values_item_type_0 + except: # noqa: E722 + pass + return cast(Union["AlertGroupConditionsItemValuesItemType0", None], data) - values_item = _parse_values_item(values_item_data) + values_item = _parse_values_item(values_item_data) - values.append(values_item) + values.append(values_item) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -205,25 +201,25 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertGroupConditionsItemConditionableType | Unset + conditionable_type: Unset | AlertGroupConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: conditionable_type = check_alert_group_conditions_item_conditionable_type(_conditionable_type) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py b/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py index a2bb4948..23ed1e3a 100644 --- a/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py +++ b/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_group_list.py b/rootly_sdk/models/alert_group_list.py index bbf287d9..311a2215 100644 --- a/rootly_sdk/models/alert_group_list.py +++ b/rootly_sdk/models/alert_group_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,22 +18,21 @@ class AlertGroupList: """ Attributes: - data (list[AlertGroupListDataItem]): - included (list[JsonapiIncludedResource] | Unset): + data (list['AlertGroupListDataItem']): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertGroupListDataItem] - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertGroupListDataItem"] + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -67,14 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_group_list = cls( data=data, diff --git a/rootly_sdk/models/alert_group_list_data_item.py b/rootly_sdk/models/alert_group_list_data_item.py index 47de586a..f526ed60 100644 --- a/rootly_sdk/models/alert_group_list_data_item.py +++ b/rootly_sdk/models/alert_group_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertGroupListDataItem: id: str type_: AlertGroupListDataItemType - attributes: AlertGroup + attributes: "AlertGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_group_response.py b/rootly_sdk/models/alert_group_response.py index 5c9c2520..5977b2ad 100644 --- a/rootly_sdk/models/alert_group_response.py +++ b/rootly_sdk/models/alert_group_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertGroupResponse: """ Attributes: data (AlertGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertGroupResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_group_response = cls( data=data, diff --git a/rootly_sdk/models/alert_group_response_data.py b/rootly_sdk/models/alert_group_response_data.py index 8d3b3d49..96a04949 100644 --- a/rootly_sdk/models/alert_group_response_data.py +++ b/rootly_sdk/models/alert_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertGroupResponseData: id: str type_: AlertGroupResponseDataType - attributes: AlertGroup + attributes: "AlertGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_group_targets_item.py b/rootly_sdk/models/alert_group_targets_item.py index 1d7557d3..8083603f 100644 --- a/rootly_sdk/models/alert_group_targets_item.py +++ b/rootly_sdk/models/alert_group_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_labels_item_type_0.py b/rootly_sdk/models/alert_labels_item_type_0.py index 432ad1f0..cf7bf716 100644 --- a/rootly_sdk/models/alert_labels_item_type_0.py +++ b/rootly_sdk/models/alert_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,7 +12,7 @@ class AlertLabelsItemType0: """ Attributes: key (str): Key of the tag - value (bool | float | str): Value of the tag + value (Union[bool, float, str]): Value of the tag """ key: str diff --git a/rootly_sdk/models/alert_list.py b/rootly_sdk/models/alert_list.py index e56e45f3..504318ac 100644 --- a/rootly_sdk/models/alert_list.py +++ b/rootly_sdk/models/alert_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AlertList: """ Attributes: - data (list[AlertListDataItem]): + data (list['AlertListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_list = cls( data=data, diff --git a/rootly_sdk/models/alert_list_data_item.py b/rootly_sdk/models/alert_list_data_item.py index 4f9d74d7..9cdca68b 100644 --- a/rootly_sdk/models/alert_list_data_item.py +++ b/rootly_sdk/models/alert_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,17 +21,16 @@ class AlertListDataItem: id (str): Unique ID of the alert type_ (AlertListDataItemType): attributes (Alert): - source (str | Unset): The source of the alert + source (Union[Unset, str]): The source of the alert """ id: str type_: AlertListDataItemType - attributes: Alert - source: str | Unset = UNSET + attributes: "Alert" + source: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_response.py b/rootly_sdk/models/alert_response.py index f165c1b4..3dec4951 100644 --- a/rootly_sdk/models/alert_response.py +++ b/rootly_sdk/models/alert_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertResponse: """ Attributes: data (AlertResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_response = cls( data=data, diff --git a/rootly_sdk/models/alert_response_data.py b/rootly_sdk/models/alert_response_data.py index c5700bfe..c0eb05a2 100644 --- a/rootly_sdk/models/alert_response_data.py +++ b/rootly_sdk/models/alert_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,17 +21,16 @@ class AlertResponseData: id (str): Unique ID of the alert type_ (AlertResponseDataType): attributes (Alert): - source (str | Unset): The source of the alert + source (Union[Unset, str]): The source of the alert """ id: str type_: AlertResponseDataType - attributes: Alert - source: str | Unset = UNSET + attributes: "Alert" + source: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_retrigger_rule.py b/rootly_sdk/models/alert_retrigger_rule.py new file mode 100644 index 00000000..eea8cf77 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule.py @@ -0,0 +1,165 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.alert_retrigger_rule_match_mode import AlertRetriggerRuleMatchMode, check_alert_retrigger_rule_match_mode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule_conditions_item import AlertRetriggerRuleConditionsItem + + +T = TypeVar("T", bound="AlertRetriggerRule") + + +@_attrs_define +class AlertRetriggerRule: + """ + Attributes: + name (Union[Unset, str]): A human-readable name for the rule + match_mode (Union[Unset, AlertRetriggerRuleMatchMode]): Whether all or any of the conditions must match + timeout_minutes (Union[None, Unset, int]): Minutes after acknowledgment to re-trigger. Null means never re- + trigger. + position (Union[Unset, int]): The position of the rule for ordering evaluation + conditions (Union[Unset, list['AlertRetriggerRuleConditionsItem']]): The conditions for the rule + created_at (Union[Unset, datetime.datetime]): + updated_at (Union[Unset, datetime.datetime]): + """ + + name: Unset | str = UNSET + match_mode: Unset | AlertRetriggerRuleMatchMode = UNSET + timeout_minutes: None | Unset | int = UNSET + position: Unset | int = UNSET + conditions: Unset | list["AlertRetriggerRuleConditionsItem"] = UNSET + created_at: Unset | datetime.datetime = UNSET + updated_at: Unset | datetime.datetime = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + match_mode: Unset | str = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + timeout_minutes: None | Unset | int + if isinstance(self.timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = self.timeout_minutes + + position = self.position + + conditions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.conditions, Unset): + conditions = [] + for conditions_item_data in self.conditions: + conditions_item = conditions_item_data.to_dict() + conditions.append(conditions_item) + + created_at: Unset | str = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: Unset | str = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if position is not UNSET: + field_dict["position"] = position + if conditions is not UNSET: + field_dict["conditions"] = conditions + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule_conditions_item import AlertRetriggerRuleConditionsItem + + d = dict(src_dict) + name = d.pop("name", UNSET) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: Unset | AlertRetriggerRuleMatchMode + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_alert_retrigger_rule_match_mode(_match_mode) + + def _parse_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + timeout_minutes = _parse_timeout_minutes(d.pop("timeout_minutes", UNSET)) + + position = d.pop("position", UNSET) + + conditions = [] + _conditions = d.pop("conditions", UNSET) + for conditions_item_data in _conditions or []: + conditions_item = AlertRetriggerRuleConditionsItem.from_dict(conditions_item_data) + + conditions.append(conditions_item) + + _created_at = d.pop("created_at", UNSET) + created_at: Unset | datetime.datetime + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = isoparse(_created_at) + + _updated_at = d.pop("updated_at", UNSET) + updated_at: Unset | datetime.datetime + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = isoparse(_updated_at) + + alert_retrigger_rule = cls( + name=name, + match_mode=match_mode, + timeout_minutes=timeout_minutes, + position=position, + conditions=conditions, + created_at=created_at, + updated_at=updated_at, + ) + + alert_retrigger_rule.additional_properties = d + return alert_retrigger_rule + + @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/rootly_sdk/models/alert_retrigger_rule_conditions_item.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item.py new file mode 100644 index 00000000..9a0ba8cf --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item.py @@ -0,0 +1,130 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_retrigger_rule_conditions_item_kind import ( + AlertRetriggerRuleConditionsItemKind, + check_alert_retrigger_rule_conditions_item_kind, +) +from ..models.alert_retrigger_rule_conditions_item_operator import ( + AlertRetriggerRuleConditionsItemOperator, + check_alert_retrigger_rule_conditions_item_operator, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AlertRetriggerRuleConditionsItem") + + +@_attrs_define +class AlertRetriggerRuleConditionsItem: + """ + Attributes: + id (UUID): Unique ID of the condition + kind (AlertRetriggerRuleConditionsItemKind): The operand the condition matches on. Native operands (urgency, + source, service, group) match by record; alert_field/payload match a field value. + operator (AlertRetriggerRuleConditionsItemOperator): How the operand is compared. Native operands support + is_one_of/is_not_one_of/is_set/is_not_set; alert_field/payload additionally support the string/regex operators. + record_ids (Union[Unset, list[UUID]]): For urgency/service/group/source conditions: the IDs of the matched + records (AlertUrgency, Service, Group, or Alerts::Source). + values (Union[Unset, list[str]]): For source conditions: non-integration source aliases (e.g. manual, api). For + alert_field/payload conditions: the values to compare against. + property_field_name (Union[Unset, str]): For alert_field conditions: the alert field id. For payload conditions: + a JSON Path (e.g. $.priority). + """ + + id: UUID + kind: AlertRetriggerRuleConditionsItemKind + operator: AlertRetriggerRuleConditionsItemOperator + record_ids: Unset | list[UUID] = UNSET + values: Unset | list[str] = UNSET + property_field_name: Unset | str = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + kind: str = self.kind + + operator: str = self.operator + + record_ids: Unset | list[str] = UNSET + if not isinstance(self.record_ids, Unset): + record_ids = [] + for record_ids_item_data in self.record_ids: + record_ids_item = str(record_ids_item_data) + record_ids.append(record_ids_item) + + values: Unset | list[str] = UNSET + if not isinstance(self.values, Unset): + values = self.values + + property_field_name = self.property_field_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "kind": kind, + "operator": operator, + } + ) + if record_ids is not UNSET: + field_dict["record_ids"] = record_ids + if values is not UNSET: + field_dict["values"] = values + if property_field_name is not UNSET: + field_dict["property_field_name"] = property_field_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + kind = check_alert_retrigger_rule_conditions_item_kind(d.pop("kind")) + + operator = check_alert_retrigger_rule_conditions_item_operator(d.pop("operator")) + + record_ids = [] + _record_ids = d.pop("record_ids", UNSET) + for record_ids_item_data in _record_ids or []: + record_ids_item = UUID(record_ids_item_data) + + record_ids.append(record_ids_item) + + values = cast(list[str], d.pop("values", UNSET)) + + property_field_name = d.pop("property_field_name", UNSET) + + alert_retrigger_rule_conditions_item = cls( + id=id, + kind=kind, + operator=operator, + record_ids=record_ids, + values=values, + property_field_name=property_field_name, + ) + + alert_retrigger_rule_conditions_item.additional_properties = d + return alert_retrigger_rule_conditions_item + + @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/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py new file mode 100644 index 00000000..825d2d16 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +AlertRetriggerRuleConditionsItemKind = Literal["alert_field", "group", "payload", "service", "source", "urgency"] + +ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_KIND_VALUES: set[AlertRetriggerRuleConditionsItemKind] = { + "alert_field", + "group", + "payload", + "service", + "source", + "urgency", +} + + +def check_alert_retrigger_rule_conditions_item_kind(value: str | None) -> AlertRetriggerRuleConditionsItemKind | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_KIND_VALUES: + return cast(AlertRetriggerRuleConditionsItemKind, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_KIND_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py new file mode 100644 index 00000000..a51de929 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py @@ -0,0 +1,37 @@ +from typing import Literal, cast + +AlertRetriggerRuleConditionsItemOperator = Literal[ + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +] + +ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_OPERATOR_VALUES: set[AlertRetriggerRuleConditionsItemOperator] = { + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +} + + +def check_alert_retrigger_rule_conditions_item_operator( + value: str | None, +) -> AlertRetriggerRuleConditionsItemOperator | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_OPERATOR_VALUES: + return cast(AlertRetriggerRuleConditionsItemOperator, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/alert_retrigger_rule_list.py b/rootly_sdk/models/alert_retrigger_rule_list.py new file mode 100644 index 00000000..e1137b96 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule_list_data_item import AlertRetriggerRuleListDataItem + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + + +T = TypeVar("T", bound="AlertRetriggerRuleList") + + +@_attrs_define +class AlertRetriggerRuleList: + """ + Attributes: + data (list['AlertRetriggerRuleListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["AlertRetriggerRuleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule_list_data_item import AlertRetriggerRuleListDataItem + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = AlertRetriggerRuleListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + alert_retrigger_rule_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + alert_retrigger_rule_list.additional_properties = d + return alert_retrigger_rule_list + + @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/rootly_sdk/models/alert_retrigger_rule_list_data_item.py b/rootly_sdk/models/alert_retrigger_rule_list_data_item.py new file mode 100644 index 00000000..b20f69d9 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_retrigger_rule_list_data_item_type import ( + AlertRetriggerRuleListDataItemType, + check_alert_retrigger_rule_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + +T = TypeVar("T", bound="AlertRetriggerRuleListDataItem") + + +@_attrs_define +class AlertRetriggerRuleListDataItem: + """ + Attributes: + id (str): Unique ID of the alert_retrigger_rule + type_ (AlertRetriggerRuleListDataItemType): + attributes (AlertRetriggerRule): + """ + + id: str + type_: AlertRetriggerRuleListDataItemType + attributes: "AlertRetriggerRule" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_alert_retrigger_rule_list_data_item_type(d.pop("type")) + + attributes = AlertRetriggerRule.from_dict(d.pop("attributes")) + + alert_retrigger_rule_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + alert_retrigger_rule_list_data_item.additional_properties = d + return alert_retrigger_rule_list_data_item + + @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/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py b/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py new file mode 100644 index 00000000..805d51ee --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +AlertRetriggerRuleListDataItemType = Literal["alert_retrigger_rules"] + +ALERT_RETRIGGER_RULE_LIST_DATA_ITEM_TYPE_VALUES: set[AlertRetriggerRuleListDataItemType] = { + "alert_retrigger_rules", +} + + +def check_alert_retrigger_rule_list_data_item_type(value: str | None) -> AlertRetriggerRuleListDataItemType | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_LIST_DATA_ITEM_TYPE_VALUES: + return cast(AlertRetriggerRuleListDataItemType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_match_mode.py b/rootly_sdk/models/alert_retrigger_rule_match_mode.py new file mode 100644 index 00000000..8ffc5c25 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_match_mode.py @@ -0,0 +1,16 @@ +from typing import Literal, cast + +AlertRetriggerRuleMatchMode = Literal["match-all-rules", "match-any-rule"] + +ALERT_RETRIGGER_RULE_MATCH_MODE_VALUES: set[AlertRetriggerRuleMatchMode] = { + "match-all-rules", + "match-any-rule", +} + + +def check_alert_retrigger_rule_match_mode(value: str | None) -> AlertRetriggerRuleMatchMode | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_MATCH_MODE_VALUES: + return cast(AlertRetriggerRuleMatchMode, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_MATCH_MODE_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_response.py b/rootly_sdk/models/alert_retrigger_rule_response.py new file mode 100644 index 00000000..78cd47eb --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData + from ..models.jsonapi_included_resource import JsonapiIncludedResource + + +T = TypeVar("T", bound="AlertRetriggerRuleResponse") + + +@_attrs_define +class AlertRetriggerRuleResponse: + """ + Attributes: + data (AlertRetriggerRuleResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "AlertRetriggerRuleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData + from ..models.jsonapi_included_resource import JsonapiIncludedResource + + d = dict(src_dict) + data = AlertRetriggerRuleResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + alert_retrigger_rule_response = cls( + data=data, + included=included, + ) + + alert_retrigger_rule_response.additional_properties = d + return alert_retrigger_rule_response + + @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/rootly_sdk/models/alert_retrigger_rule_response_data.py b/rootly_sdk/models/alert_retrigger_rule_response_data.py new file mode 100644 index 00000000..64c9f063 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_retrigger_rule_response_data_type import ( + AlertRetriggerRuleResponseDataType, + check_alert_retrigger_rule_response_data_type, +) + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + +T = TypeVar("T", bound="AlertRetriggerRuleResponseData") + + +@_attrs_define +class AlertRetriggerRuleResponseData: + """ + Attributes: + id (str): Unique ID of the alert_retrigger_rule + type_ (AlertRetriggerRuleResponseDataType): + attributes (AlertRetriggerRule): + """ + + id: str + type_: AlertRetriggerRuleResponseDataType + attributes: "AlertRetriggerRule" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_alert_retrigger_rule_response_data_type(d.pop("type")) + + attributes = AlertRetriggerRule.from_dict(d.pop("attributes")) + + alert_retrigger_rule_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + alert_retrigger_rule_response_data.additional_properties = d + return alert_retrigger_rule_response_data + + @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/rootly_sdk/models/alert_retrigger_rule_response_data_type.py b/rootly_sdk/models/alert_retrigger_rule_response_data_type.py new file mode 100644 index 00000000..83e34750 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +AlertRetriggerRuleResponseDataType = Literal["alert_retrigger_rules"] + +ALERT_RETRIGGER_RULE_RESPONSE_DATA_TYPE_VALUES: set[AlertRetriggerRuleResponseDataType] = { + "alert_retrigger_rules", +} + + +def check_alert_retrigger_rule_response_data_type(value: str | None) -> AlertRetriggerRuleResponseDataType | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_RESPONSE_DATA_TYPE_VALUES: + return cast(AlertRetriggerRuleResponseDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_route.py b/rootly_sdk/models/alert_route.py index abfbd781..d8f701e4 100644 --- a/rootly_sdk/models/alert_route.py +++ b/rootly_sdk/models/alert_route.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -22,20 +20,19 @@ class AlertRoute: Attributes: name (str): The name of the alert route alerts_source_ids (list[UUID]): - enabled (bool | Unset): Whether the alert route is enabled - owning_team_ids (list[UUID] | Unset): - rules (list[AlertRouteRulesItem] | Unset): + enabled (Union[Unset, bool]): Whether the alert route is enabled + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['AlertRouteRulesItem']]): """ name: str alerts_source_ids: list[UUID] - enabled: bool | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[AlertRouteRulesItem] | Unset = UNSET + enabled: Unset | bool = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["AlertRouteRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name alerts_source_ids = [] @@ -45,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -92,23 +89,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[AlertRouteRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = AlertRouteRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = AlertRouteRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) alert_route = cls( name=name, diff --git a/rootly_sdk/models/alert_route_list.py b/rootly_sdk/models/alert_route_list.py index c6276ba7..ccae9fd3 100644 --- a/rootly_sdk/models/alert_route_list.py +++ b/rootly_sdk/models/alert_route_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,18 +17,17 @@ class AlertRouteList: """ Attributes: - data (list[AlertRouteListDataItem]): + data (list['AlertRouteListDataItem']): links (Links): meta (Meta): """ - data: list[AlertRouteListDataItem] - links: Links - meta: Meta + data: list["AlertRouteListDataItem"] + links: "Links" + meta: "Meta" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() diff --git a/rootly_sdk/models/alert_route_list_data_item.py b/rootly_sdk/models/alert_route_list_data_item.py index 4ec22e8a..ba77f29a 100644 --- a/rootly_sdk/models/alert_route_list_data_item.py +++ b/rootly_sdk/models/alert_route_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertRouteListDataItem: id: str type_: AlertRouteListDataItemType - attributes: AlertRoute + attributes: "AlertRoute" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_route_response.py b/rootly_sdk/models/alert_route_response.py index 53657a71..21c9cd2d 100644 --- a/rootly_sdk/models/alert_route_response.py +++ b/rootly_sdk/models/alert_route_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AlertRouteResponse: data (AlertRouteResponseData): """ - data: AlertRouteResponseData + data: "AlertRouteResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/alert_route_response_data.py b/rootly_sdk/models/alert_route_response_data.py index 4bf1cb69..b94232f9 100644 --- a/rootly_sdk/models/alert_route_response_data.py +++ b/rootly_sdk/models/alert_route_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertRouteResponseData: id: str type_: AlertRouteResponseDataType - attributes: AlertRoute + attributes: "AlertRoute" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_route_rules_item.py b/rootly_sdk/models/alert_route_rules_item.py index 7764fdcb..697ee425 100644 --- a/rootly_sdk/models/alert_route_rules_item.py +++ b/rootly_sdk/models/alert_route_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,21 +19,20 @@ class AlertRouteRulesItem: """ Attributes: name (str): The name of the alert routing rule - destinations (list[AlertRouteRulesItemDestinationsItem]): - condition_groups (list[AlertRouteRulesItemConditionGroupsItem]): - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. + destinations (list['AlertRouteRulesItemDestinationsItem']): + condition_groups (list['AlertRouteRulesItemConditionGroupsItem']): + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. """ name: str - destinations: list[AlertRouteRulesItemDestinationsItem] - condition_groups: list[AlertRouteRulesItemConditionGroupsItem] - position: int | Unset = UNSET - fallback_rule: bool | Unset = False + destinations: list["AlertRouteRulesItemDestinationsItem"] + condition_groups: list["AlertRouteRulesItemConditionGroupsItem"] + position: Unset | int = UNSET + fallback_rule: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name destinations = [] diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py index 45faaf7b..94f139fc 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,16 +19,15 @@ class AlertRouteRulesItemConditionGroupsItem: """ Attributes: - conditions (list[AlertRouteRulesItemConditionGroupsItemConditionsItem]): - position (int | Unset): The position of the condition group + conditions (list['AlertRouteRulesItemConditionGroupsItemConditionsItem']): + position (Union[Unset, int]): The position of the condition group """ - conditions: list[AlertRouteRulesItemConditionGroupsItemConditionsItem] - position: int | Unset = UNSET + conditions: list["AlertRouteRulesItemConditionGroupsItemConditionsItem"] + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py index 413dfacc..91f1fba8 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -30,23 +28,23 @@ class AlertRouteRulesItemConditionGroupsItemConditionsItem: Attributes: property_field_condition_type (AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - property_field_name (str | Unset): The name of the property field - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType | Unset): The type of - the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + property_field_name (Union[Unset, str]): The name of the property field + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType]): The + type of the conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ property_field_condition_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType property_field_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType | Unset = UNSET - conditionable_id: None | Unset | UUID = UNSET + property_field_name: Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,13 +54,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -71,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -80,11 +78,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -130,16 +128,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -150,13 +148,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -167,14 +165,14 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + conditionable_type: Unset | AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -182,7 +180,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -193,9 +191,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_route_rules_item_destinations_item.py b/rootly_sdk/models/alert_route_rules_item_destinations_item.py index 303e9070..58e62a68 100644 --- a/rootly_sdk/models/alert_route_rules_item_destinations_item.py +++ b/rootly_sdk/models/alert_route_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_routing_rule.py b/rootly_sdk/models/alert_routing_rule.py index 1ca607b9..d6c36741 100644 --- a/rootly_sdk/models/alert_routing_rule.py +++ b/rootly_sdk/models/alert_routing_rule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -33,10 +31,11 @@ class AlertRoutingRule: condition_type (AlertRoutingRuleConditionType): The type of condition for the alert routing rule created_at (str): Date of creation updated_at (str): Date of last update - conditions (list[AlertRoutingRuleConditionsItem] | Unset): The conditions for the alert routing rule - destination (AlertRoutingRuleDestinationType0 | None | Unset): The destinations for the alert routing rule - condition_groups (list[AlertRoutingRuleConditionGroupsItem] | Unset): The condition groups for the alert routing + conditions (Union[Unset, list['AlertRoutingRuleConditionsItem']]): The conditions for the alert routing rule + destination (Union['AlertRoutingRuleDestinationType0', None, Unset]): The destinations for the alert routing rule + condition_groups (Union[Unset, list['AlertRoutingRuleConditionGroupsItem']]): The condition groups for the alert + routing rule """ name: str @@ -46,9 +45,9 @@ class AlertRoutingRule: condition_type: AlertRoutingRuleConditionType created_at: str updated_at: str - conditions: list[AlertRoutingRuleConditionsItem] | Unset = UNSET - destination: AlertRoutingRuleDestinationType0 | None | Unset = UNSET - condition_groups: list[AlertRoutingRuleConditionGroupsItem] | Unset = UNSET + conditions: Unset | list["AlertRoutingRuleConditionsItem"] = UNSET + destination: Union["AlertRoutingRuleDestinationType0", None, Unset] = UNSET + condition_groups: Unset | list["AlertRoutingRuleConditionGroupsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,14 +67,14 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - destination: dict[str, Any] | None | Unset + destination: None | Unset | dict[str, Any] if isinstance(self.destination, Unset): destination = UNSET elif isinstance(self.destination, AlertRoutingRuleDestinationType0): @@ -83,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: destination = self.destination - condition_groups: list[dict[str, Any]] | Unset = UNSET + condition_groups: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -133,16 +132,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertRoutingRuleConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertRoutingRuleConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertRoutingRuleConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) - def _parse_destination(data: object) -> AlertRoutingRuleDestinationType0 | None | Unset: + def _parse_destination(data: object) -> Union["AlertRoutingRuleDestinationType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -153,20 +150,18 @@ def _parse_destination(data: object) -> AlertRoutingRuleDestinationType0 | None destination_type_0 = AlertRoutingRuleDestinationType0.from_dict(data) return destination_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertRoutingRuleDestinationType0 | None | Unset, data) + return cast(Union["AlertRoutingRuleDestinationType0", None, Unset], data) destination = _parse_destination(d.pop("destination", UNSET)) + condition_groups = [] _condition_groups = d.pop("condition_groups", UNSET) - condition_groups: list[AlertRoutingRuleConditionGroupsItem] | Unset = UNSET - if _condition_groups is not UNSET: - condition_groups = [] - for condition_groups_item_data in _condition_groups: - condition_groups_item = AlertRoutingRuleConditionGroupsItem.from_dict(condition_groups_item_data) + for condition_groups_item_data in _condition_groups or []: + condition_groups_item = AlertRoutingRuleConditionGroupsItem.from_dict(condition_groups_item_data) - condition_groups.append(condition_groups_item) + condition_groups.append(condition_groups_item) alert_routing_rule = cls( name=name, diff --git a/rootly_sdk/models/alert_routing_rule_condition.py b/rootly_sdk/models/alert_routing_rule_condition.py index 0ab961a3..90aa12ea 100644 --- a/rootly_sdk/models/alert_routing_rule_condition.py +++ b/rootly_sdk/models/alert_routing_rule_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -29,25 +27,25 @@ class AlertRoutingRuleCondition: property_field_name (str): The name of the property field property_field_condition_type (AlertRoutingRuleConditionPropertyFieldConditionType): The condition type of the property field - id (UUID | Unset): Unique ID of the condition - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): The values of the property field - conditionable_id (None | Unset | UUID): The ID of the conditionable object - conditionable_type (None | str | Unset): The type of the conditionable object - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): The values of the property field + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable object + conditionable_type (Union[None, Unset, str]): The type of the conditionable object + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ property_field_type: AlertRoutingRuleConditionPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionPropertyFieldConditionType - id: UUID | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - conditionable_id: None | Unset | UUID = UNSET - conditionable_type: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | UUID = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + conditionable_id: None | UUID | Unset = UNSET + conditionable_type: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: None | str | Unset + conditionable_type: None | Unset | str if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -132,22 +130,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -158,13 +156,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -175,18 +173,18 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> None | str | Unset: + def _parse_conditionable_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_condition_group.py b/rootly_sdk/models/alert_routing_rule_condition_group.py index 56abd818..bc3441dc 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_group.py +++ b/rootly_sdk/models/alert_routing_rule_condition_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -22,28 +20,27 @@ class AlertRoutingRuleConditionGroup: Attributes: position (int): The position of the condition group for ordering - id (UUID | Unset): Unique ID of the condition group - conditions (list[AlertRoutingRuleCondition] | Unset): The conditions within this group - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition group + conditions (Union[Unset, list['AlertRoutingRuleCondition']]): The conditions within this group + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ position: int - id: UUID | Unset = UNSET - conditions: list[AlertRoutingRuleCondition] | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | UUID = UNSET + conditions: Unset | list["AlertRoutingRuleCondition"] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - position = self.position - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -80,20 +77,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertRoutingRuleCondition] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertRoutingRuleCondition.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertRoutingRuleCondition.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py index 72ea94ca..e16fffa5 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -23,28 +21,28 @@ class AlertRoutingRuleConditionGroupsItem: """ Attributes: position (int): The position of the condition group for ordering - id (UUID | Unset): Unique ID of the condition group - conditions (list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset): The conditions within this group - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition group + conditions (Union[Unset, list['AlertRoutingRuleConditionGroupsItemConditionsItem']]): The conditions within this + group + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ position: int - id: UUID | Unset = UNSET - conditions: list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | UUID = UNSET + conditions: Unset | list["AlertRoutingRuleConditionGroupsItemConditionsItem"] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - position = self.position - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -83,20 +81,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertRoutingRuleConditionGroupsItemConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertRoutingRuleConditionGroupsItemConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py index 93399246..8958ac1b 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -29,25 +27,25 @@ class AlertRoutingRuleConditionGroupsItemConditionsItem: property_field_name (str): The name of the property field property_field_condition_type (AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType): The condition type of the property field - id (UUID | Unset): Unique ID of the condition - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): The values of the property field - conditionable_id (None | Unset | UUID): The ID of the conditionable object - conditionable_type (None | str | Unset): The type of the conditionable object - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): The values of the property field + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable object + conditionable_type (Union[None, Unset, str]): The type of the conditionable object + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ property_field_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType - id: UUID | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - conditionable_id: None | Unset | UUID = UNSET - conditionable_type: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | UUID = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + conditionable_id: None | UUID | Unset = UNSET + conditionable_type: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: None | str | Unset + conditionable_type: None | Unset | str if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -136,22 +134,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -162,13 +160,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -179,18 +177,18 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> None | str | Unset: + def _parse_conditionable_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_conditions_item.py b/rootly_sdk/models/alert_routing_rule_conditions_item.py index 7d65f2f1..88f1a77f 100644 --- a/rootly_sdk/models/alert_routing_rule_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -30,17 +28,17 @@ class AlertRoutingRuleConditionsItem: field name should be supplied in JSON Path syntax. property_field_condition_type (AlertRoutingRuleConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_value (None | str | Unset): The value of the property field. Can be null if the property field - condition type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Used if the property field + property_field_value (Union[None, Unset, str]): The value of the property field. Can be null if the property + field condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Used if the property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' """ property_field_type: AlertRoutingRuleConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionsItemPropertyFieldConditionType - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -87,12 +85,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("property_field_condition_type") ) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_destination_type_0.py b/rootly_sdk/models/alert_routing_rule_destination_type_0.py index e628187c..80f5de82 100644 --- a/rootly_sdk/models/alert_routing_rule_destination_type_0.py +++ b/rootly_sdk/models/alert_routing_rule_destination_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_routing_rule_list.py b/rootly_sdk/models/alert_routing_rule_list.py index 3c3aaa42..ffd3bf29 100644 --- a/rootly_sdk/models/alert_routing_rule_list.py +++ b/rootly_sdk/models/alert_routing_rule_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AlertRoutingRuleList: """ Attributes: - data (list[AlertRoutingRuleListDataItem]): + data (list['AlertRoutingRuleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertRoutingRuleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertRoutingRuleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_routing_rule_list = cls( data=data, diff --git a/rootly_sdk/models/alert_routing_rule_list_data_item.py b/rootly_sdk/models/alert_routing_rule_list_data_item.py index 7245f458..343f7c40 100644 --- a/rootly_sdk/models/alert_routing_rule_list_data_item.py +++ b/rootly_sdk/models/alert_routing_rule_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertRoutingRuleListDataItem: id: str type_: AlertRoutingRuleListDataItemType - attributes: AlertRoutingRule + attributes: "AlertRoutingRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_routing_rule_response.py b/rootly_sdk/models/alert_routing_rule_response.py index f10281d6..ac519419 100644 --- a/rootly_sdk/models/alert_routing_rule_response.py +++ b/rootly_sdk/models/alert_routing_rule_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertRoutingRuleResponse: """ Attributes: data (AlertRoutingRuleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertRoutingRuleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertRoutingRuleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertRoutingRuleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_routing_rule_response = cls( data=data, diff --git a/rootly_sdk/models/alert_routing_rule_response_data.py b/rootly_sdk/models/alert_routing_rule_response_data.py index bf0c7fc4..87bc9619 100644 --- a/rootly_sdk/models/alert_routing_rule_response_data.py +++ b/rootly_sdk/models/alert_routing_rule_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertRoutingRuleResponseData: id: str type_: AlertRoutingRuleResponseDataType - attributes: AlertRoutingRule + attributes: "AlertRoutingRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_routing_rule_target_type_0.py b/rootly_sdk/models/alert_routing_rule_target_type_0.py index 2c3c2e4a..62218fda 100644 --- a/rootly_sdk/models/alert_routing_rule_target_type_0.py +++ b/rootly_sdk/models/alert_routing_rule_target_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_trigger_params.py b/rootly_sdk/models/alert_trigger_params.py index 6d99afd0..0a7cb339 100644 --- a/rootly_sdk/models/alert_trigger_params.py +++ b/rootly_sdk/models/alert_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -54,129 +52,128 @@ class AlertTriggerParams: """ Attributes: trigger_type (AlertTriggerParamsTriggerType): - triggers (list[AlertTriggerParamsTriggersItem] | Unset): - alert_condition (AlertTriggerParamsAlertCondition | Unset): - alert_condition_source (AlertTriggerParamsAlertConditionSource | Unset): Default: 'ANY'. - alert_condition_source_use_regexp (bool | Unset): Default: False. - alert_sources (list[str] | Unset): - alert_condition_label (AlertTriggerParamsAlertConditionLabel | Unset): Default: 'ANY'. - alert_condition_label_use_regexp (bool | Unset): Default: False. - alert_condition_status (AlertTriggerParamsAlertConditionStatus | Unset): Default: 'ANY'. - alert_condition_status_use_regexp (bool | Unset): Default: False. - alert_statuses (list[str] | Unset): - alert_labels (list[str] | Unset): - alert_condition_urgency (AlertTriggerParamsAlertConditionUrgency | Unset): Default: 'ANY'. - alert_urgency_ids (list[UUID] | Unset): - alert_condition_payload (AlertTriggerParamsAlertConditionPayload | Unset): Default: 'ANY'. - alert_condition_payload_use_regexp (bool | Unset): Default: False. - alert_payload (list[str] | Unset): - alert_query_payload (None | str | Unset): You can use jsonpath syntax. eg: $.incident.teams[*] - alert_field_conditions (list[AlertTriggerParamsAlertFieldConditionsItem] | Unset): - alert_payload_conditions (AlertTriggerParamsAlertPayloadConditions | Unset): + triggers (Union[Unset, list[AlertTriggerParamsTriggersItem]]): + alert_condition (Union[Unset, AlertTriggerParamsAlertCondition]): + alert_condition_source (Union[Unset, AlertTriggerParamsAlertConditionSource]): Default: 'ANY'. + alert_condition_source_use_regexp (Union[Unset, bool]): Default: False. + alert_sources (Union[Unset, list[str]]): + alert_condition_label (Union[Unset, AlertTriggerParamsAlertConditionLabel]): Default: 'ANY'. + alert_condition_label_use_regexp (Union[Unset, bool]): Default: False. + alert_condition_status (Union[Unset, AlertTriggerParamsAlertConditionStatus]): Default: 'ANY'. + alert_condition_status_use_regexp (Union[Unset, bool]): Default: False. + alert_statuses (Union[Unset, list[str]]): + alert_labels (Union[Unset, list[str]]): + alert_condition_urgency (Union[Unset, AlertTriggerParamsAlertConditionUrgency]): Default: 'ANY'. + alert_urgency_ids (Union[Unset, list[UUID]]): + alert_condition_payload (Union[Unset, AlertTriggerParamsAlertConditionPayload]): Default: 'ANY'. + alert_condition_payload_use_regexp (Union[Unset, bool]): Default: False. + alert_payload (Union[Unset, list[str]]): + alert_query_payload (Union[None, Unset, str]): You can use jsonpath syntax. eg: $.incident.teams[*] + alert_field_conditions (Union[Unset, list['AlertTriggerParamsAlertFieldConditionsItem']]): + alert_payload_conditions (Union[Unset, AlertTriggerParamsAlertPayloadConditions]): """ trigger_type: AlertTriggerParamsTriggerType - triggers: list[AlertTriggerParamsTriggersItem] | Unset = UNSET - alert_condition: AlertTriggerParamsAlertCondition | Unset = UNSET - alert_condition_source: AlertTriggerParamsAlertConditionSource | Unset = "ANY" - alert_condition_source_use_regexp: bool | Unset = False - alert_sources: list[str] | Unset = UNSET - alert_condition_label: AlertTriggerParamsAlertConditionLabel | Unset = "ANY" - alert_condition_label_use_regexp: bool | Unset = False - alert_condition_status: AlertTriggerParamsAlertConditionStatus | Unset = "ANY" - alert_condition_status_use_regexp: bool | Unset = False - alert_statuses: list[str] | Unset = UNSET - alert_labels: list[str] | Unset = UNSET - alert_condition_urgency: AlertTriggerParamsAlertConditionUrgency | Unset = "ANY" - alert_urgency_ids: list[UUID] | Unset = UNSET - alert_condition_payload: AlertTriggerParamsAlertConditionPayload | Unset = "ANY" - alert_condition_payload_use_regexp: bool | Unset = False - alert_payload: list[str] | Unset = UNSET - alert_query_payload: None | str | Unset = UNSET - alert_field_conditions: list[AlertTriggerParamsAlertFieldConditionsItem] | Unset = UNSET - alert_payload_conditions: AlertTriggerParamsAlertPayloadConditions | Unset = UNSET + triggers: Unset | list[AlertTriggerParamsTriggersItem] = UNSET + alert_condition: Unset | AlertTriggerParamsAlertCondition = UNSET + alert_condition_source: Unset | AlertTriggerParamsAlertConditionSource = "ANY" + alert_condition_source_use_regexp: Unset | bool = False + alert_sources: Unset | list[str] = UNSET + alert_condition_label: Unset | AlertTriggerParamsAlertConditionLabel = "ANY" + alert_condition_label_use_regexp: Unset | bool = False + alert_condition_status: Unset | AlertTriggerParamsAlertConditionStatus = "ANY" + alert_condition_status_use_regexp: Unset | bool = False + alert_statuses: Unset | list[str] = UNSET + alert_labels: Unset | list[str] = UNSET + alert_condition_urgency: Unset | AlertTriggerParamsAlertConditionUrgency = "ANY" + alert_urgency_ids: Unset | list[UUID] = UNSET + alert_condition_payload: Unset | AlertTriggerParamsAlertConditionPayload = "ANY" + alert_condition_payload_use_regexp: Unset | bool = False + alert_payload: Unset | list[str] = UNSET + alert_query_payload: None | Unset | str = UNSET + alert_field_conditions: Unset | list["AlertTriggerParamsAlertFieldConditionsItem"] = UNSET + alert_payload_conditions: Union[Unset, "AlertTriggerParamsAlertPayloadConditions"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: triggers_item: str = triggers_item_data triggers.append(triggers_item) - alert_condition: str | Unset = UNSET + alert_condition: Unset | str = UNSET if not isinstance(self.alert_condition, Unset): alert_condition = self.alert_condition - alert_condition_source: str | Unset = UNSET + alert_condition_source: Unset | str = UNSET if not isinstance(self.alert_condition_source, Unset): alert_condition_source = self.alert_condition_source alert_condition_source_use_regexp = self.alert_condition_source_use_regexp - alert_sources: list[str] | Unset = UNSET + alert_sources: Unset | list[str] = UNSET if not isinstance(self.alert_sources, Unset): alert_sources = self.alert_sources - alert_condition_label: str | Unset = UNSET + alert_condition_label: Unset | str = UNSET if not isinstance(self.alert_condition_label, Unset): alert_condition_label = self.alert_condition_label alert_condition_label_use_regexp = self.alert_condition_label_use_regexp - alert_condition_status: str | Unset = UNSET + alert_condition_status: Unset | str = UNSET if not isinstance(self.alert_condition_status, Unset): alert_condition_status = self.alert_condition_status alert_condition_status_use_regexp = self.alert_condition_status_use_regexp - alert_statuses: list[str] | Unset = UNSET + alert_statuses: Unset | list[str] = UNSET if not isinstance(self.alert_statuses, Unset): alert_statuses = self.alert_statuses - alert_labels: list[str] | Unset = UNSET + alert_labels: Unset | list[str] = UNSET if not isinstance(self.alert_labels, Unset): alert_labels = self.alert_labels - alert_condition_urgency: str | Unset = UNSET + alert_condition_urgency: Unset | str = UNSET if not isinstance(self.alert_condition_urgency, Unset): alert_condition_urgency = self.alert_condition_urgency - alert_urgency_ids: list[str] | Unset = UNSET + alert_urgency_ids: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = [] for alert_urgency_ids_item_data in self.alert_urgency_ids: alert_urgency_ids_item = str(alert_urgency_ids_item_data) alert_urgency_ids.append(alert_urgency_ids_item) - alert_condition_payload: str | Unset = UNSET + alert_condition_payload: Unset | str = UNSET if not isinstance(self.alert_condition_payload, Unset): alert_condition_payload = self.alert_condition_payload alert_condition_payload_use_regexp = self.alert_condition_payload_use_regexp - alert_payload: list[str] | Unset = UNSET + alert_payload: Unset | list[str] = UNSET if not isinstance(self.alert_payload, Unset): alert_payload = self.alert_payload - alert_query_payload: None | str | Unset + alert_query_payload: None | Unset | str if isinstance(self.alert_query_payload, Unset): alert_query_payload = UNSET else: alert_query_payload = self.alert_query_payload - alert_field_conditions: list[dict[str, Any]] | Unset = UNSET + alert_field_conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_field_conditions, Unset): alert_field_conditions = [] for alert_field_conditions_item_data in self.alert_field_conditions: alert_field_conditions_item = alert_field_conditions_item_data.to_dict() alert_field_conditions.append(alert_field_conditions_item) - alert_payload_conditions: dict[str, Any] | Unset = UNSET + alert_payload_conditions: Unset | dict[str, Any] = UNSET if not isinstance(self.alert_payload_conditions, Unset): alert_payload_conditions = self.alert_payload_conditions.to_dict() @@ -236,24 +233,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) trigger_type = check_alert_trigger_params_trigger_type(d.pop("trigger_type")) + triggers = [] _triggers = d.pop("triggers", UNSET) - triggers: list[AlertTriggerParamsTriggersItem] | Unset = UNSET - if _triggers is not UNSET: - triggers = [] - for triggers_item_data in _triggers: - triggers_item = check_alert_trigger_params_triggers_item(triggers_item_data) + for triggers_item_data in _triggers or []: + triggers_item = check_alert_trigger_params_triggers_item(triggers_item_data) - triggers.append(triggers_item) + triggers.append(triggers_item) _alert_condition = d.pop("alert_condition", UNSET) - alert_condition: AlertTriggerParamsAlertCondition | Unset + alert_condition: Unset | AlertTriggerParamsAlertCondition if isinstance(_alert_condition, Unset): alert_condition = UNSET else: alert_condition = check_alert_trigger_params_alert_condition(_alert_condition) _alert_condition_source = d.pop("alert_condition_source", UNSET) - alert_condition_source: AlertTriggerParamsAlertConditionSource | Unset + alert_condition_source: Unset | AlertTriggerParamsAlertConditionSource if isinstance(_alert_condition_source, Unset): alert_condition_source = UNSET else: @@ -264,7 +259,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_sources = cast(list[str], d.pop("alert_sources", UNSET)) _alert_condition_label = d.pop("alert_condition_label", UNSET) - alert_condition_label: AlertTriggerParamsAlertConditionLabel | Unset + alert_condition_label: Unset | AlertTriggerParamsAlertConditionLabel if isinstance(_alert_condition_label, Unset): alert_condition_label = UNSET else: @@ -273,7 +268,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_condition_label_use_regexp = d.pop("alert_condition_label_use_regexp", UNSET) _alert_condition_status = d.pop("alert_condition_status", UNSET) - alert_condition_status: AlertTriggerParamsAlertConditionStatus | Unset + alert_condition_status: Unset | AlertTriggerParamsAlertConditionStatus if isinstance(_alert_condition_status, Unset): alert_condition_status = UNSET else: @@ -286,23 +281,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_labels = cast(list[str], d.pop("alert_labels", UNSET)) _alert_condition_urgency = d.pop("alert_condition_urgency", UNSET) - alert_condition_urgency: AlertTriggerParamsAlertConditionUrgency | Unset + alert_condition_urgency: Unset | AlertTriggerParamsAlertConditionUrgency if isinstance(_alert_condition_urgency, Unset): alert_condition_urgency = UNSET else: alert_condition_urgency = check_alert_trigger_params_alert_condition_urgency(_alert_condition_urgency) + alert_urgency_ids = [] _alert_urgency_ids = d.pop("alert_urgency_ids", UNSET) - alert_urgency_ids: list[UUID] | Unset = UNSET - if _alert_urgency_ids is not UNSET: - alert_urgency_ids = [] - for alert_urgency_ids_item_data in _alert_urgency_ids: - alert_urgency_ids_item = UUID(alert_urgency_ids_item_data) + for alert_urgency_ids_item_data in _alert_urgency_ids or []: + alert_urgency_ids_item = UUID(alert_urgency_ids_item_data) - alert_urgency_ids.append(alert_urgency_ids_item) + alert_urgency_ids.append(alert_urgency_ids_item) _alert_condition_payload = d.pop("alert_condition_payload", UNSET) - alert_condition_payload: AlertTriggerParamsAlertConditionPayload | Unset + alert_condition_payload: Unset | AlertTriggerParamsAlertConditionPayload if isinstance(_alert_condition_payload, Unset): alert_condition_payload = UNSET else: @@ -312,28 +305,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_payload = cast(list[str], d.pop("alert_payload", UNSET)) - def _parse_alert_query_payload(data: object) -> None | str | Unset: + def _parse_alert_query_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_query_payload = _parse_alert_query_payload(d.pop("alert_query_payload", UNSET)) + alert_field_conditions = [] _alert_field_conditions = d.pop("alert_field_conditions", UNSET) - alert_field_conditions: list[AlertTriggerParamsAlertFieldConditionsItem] | Unset = UNSET - if _alert_field_conditions is not UNSET: - alert_field_conditions = [] - for alert_field_conditions_item_data in _alert_field_conditions: - alert_field_conditions_item = AlertTriggerParamsAlertFieldConditionsItem.from_dict( - alert_field_conditions_item_data - ) + for alert_field_conditions_item_data in _alert_field_conditions or []: + alert_field_conditions_item = AlertTriggerParamsAlertFieldConditionsItem.from_dict( + alert_field_conditions_item_data + ) - alert_field_conditions.append(alert_field_conditions_item) + alert_field_conditions.append(alert_field_conditions_item) _alert_payload_conditions = d.pop("alert_payload_conditions", UNSET) - alert_payload_conditions: AlertTriggerParamsAlertPayloadConditions | Unset + alert_payload_conditions: Unset | AlertTriggerParamsAlertPayloadConditions if isinstance(_alert_payload_conditions, Unset): alert_payload_conditions = UNSET else: diff --git a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py index 56455b09..d4463fd9 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py +++ b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,12 +19,12 @@ class AlertTriggerParamsAlertFieldConditionsItem: Attributes: alert_field_id (str): condition_type (AlertTriggerParamsAlertFieldConditionsItemConditionType): - values (list[str] | Unset): + values (Union[Unset, list[str]]): """ alert_field_id: str condition_type: AlertTriggerParamsAlertFieldConditionsItemConditionType - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: condition_type: str = self.condition_type - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py index a8a3fc50..c037c6b6 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class AlertTriggerParamsAlertPayloadConditions: """ Attributes: - logic (AlertTriggerParamsAlertPayloadConditionsLogic | Unset): - conditions (list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset): + logic (Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic]): + conditions (Union[Unset, list['AlertTriggerParamsAlertPayloadConditionsConditionsItem']]): """ - logic: AlertTriggerParamsAlertPayloadConditionsLogic | Unset = UNSET - conditions: list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset = UNSET + logic: Unset | AlertTriggerParamsAlertPayloadConditionsLogic = UNSET + conditions: Unset | list["AlertTriggerParamsAlertPayloadConditionsConditionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - logic: str | Unset = UNSET + logic: Unset | str = UNSET if not isinstance(self.logic, Unset): logic = self.logic - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -64,20 +61,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _logic = d.pop("logic", UNSET) - logic: AlertTriggerParamsAlertPayloadConditionsLogic | Unset + logic: Unset | AlertTriggerParamsAlertPayloadConditionsLogic if isinstance(_logic, Unset): logic = UNSET else: logic = check_alert_trigger_params_alert_payload_conditions_logic(_logic) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertTriggerParamsAlertPayloadConditionsConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertTriggerParamsAlertPayloadConditionsConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) alert_trigger_params_alert_payload_conditions = cls( logic=logic, diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py index 6a9ea7fd..d00a6cc6 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,14 +19,14 @@ class AlertTriggerParamsAlertPayloadConditionsConditionsItem: Attributes: query (str): operator (AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator): - values (list[str] | Unset): - use_regexp (bool | Unset): + values (Union[Unset, list[str]]): + use_regexp (Union[Unset, bool]): """ query: str operator: AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator - values: list[str] | Unset = UNSET - use_regexp: bool | Unset = UNSET + values: Unset | list[str] = UNSET + use_regexp: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_urgency.py b/rootly_sdk/models/alert_urgency.py index 3921a818..d9ae5f2d 100644 --- a/rootly_sdk/models/alert_urgency.py +++ b/rootly_sdk/models/alert_urgency.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,11 +18,13 @@ class AlertUrgency: position (int): Position of the alert urgency created_at (str): Date of creation updated_at (str): Date of last update - id (str | Unset): Unique ID of the alert urgency - urgency (None | str | Unset): The urgency level - color (None | str | Unset): The color associated with this urgency level - team_id (int | Unset): The ID of the team this urgency belongs to - deleted_at (None | str | Unset): Date of deletion + id (Union[Unset, str]): Unique ID of the alert urgency + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts of this urgency after N + minutes; null inherits the workspace default, negative = never. + urgency (Union[None, Unset, str]): The urgency level + color (Union[None, Unset, str]): The color associated with this urgency level + team_id (Union[Unset, int]): The ID of the team this urgency belongs to + deleted_at (Union[None, Unset, str]): Date of deletion """ name: str @@ -32,11 +32,12 @@ class AlertUrgency: position: int created_at: str updated_at: str - id: str | Unset = UNSET - urgency: None | str | Unset = UNSET - color: None | str | Unset = UNSET - team_id: int | Unset = UNSET - deleted_at: None | str | Unset = UNSET + id: Unset | str = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET + urgency: None | Unset | str = UNSET + color: None | Unset | str = UNSET + team_id: Unset | int = UNSET + deleted_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,13 +53,19 @@ def to_dict(self) -> dict[str, Any]: id = self.id - urgency: None | str | Unset + retrigger_timeout_minutes: None | Unset | int + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + + urgency: None | Unset | str if isinstance(self.urgency, Unset): urgency = UNSET else: urgency = self.urgency - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: @@ -66,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - deleted_at: None | str | Unset + deleted_at: None | Unset | str if isinstance(self.deleted_at, Unset): deleted_at = UNSET else: @@ -85,6 +92,8 @@ def to_dict(self) -> dict[str, Any]: ) if id is not UNSET: field_dict["id"] = id + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if urgency is not UNSET: field_dict["urgency"] = urgency if color is not UNSET: @@ -111,32 +120,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_urgency(data: object) -> None | str | Unset: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + + def _parse_urgency(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) urgency = _parse_urgency(d.pop("urgency", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) team_id = d.pop("team_id", UNSET) - def _parse_deleted_at(data: object) -> None | str | Unset: + def _parse_deleted_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deleted_at = _parse_deleted_at(d.pop("deleted_at", UNSET)) @@ -147,6 +165,7 @@ def _parse_deleted_at(data: object) -> None | str | Unset: created_at=created_at, updated_at=updated_at, id=id, + retrigger_timeout_minutes=retrigger_timeout_minutes, urgency=urgency, color=color, team_id=team_id, diff --git a/rootly_sdk/models/alert_urgency_list.py b/rootly_sdk/models/alert_urgency_list.py index 385c12fd..ba752c31 100644 --- a/rootly_sdk/models/alert_urgency_list.py +++ b/rootly_sdk/models/alert_urgency_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AlertUrgencyList: """ Attributes: - data (list[AlertUrgencyListDataItem]): + data (list['AlertUrgencyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertUrgencyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertUrgencyListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_urgency_list = cls( data=data, diff --git a/rootly_sdk/models/alert_urgency_list_data_item.py b/rootly_sdk/models/alert_urgency_list_data_item.py index 9fd99c3a..aa0ff94f 100644 --- a/rootly_sdk/models/alert_urgency_list_data_item.py +++ b/rootly_sdk/models/alert_urgency_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertUrgencyListDataItem: id: str type_: AlertUrgencyListDataItemType - attributes: AlertUrgency + attributes: "AlertUrgency" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_urgency_response.py b/rootly_sdk/models/alert_urgency_response.py index 6e59691a..c3fafb51 100644 --- a/rootly_sdk/models/alert_urgency_response.py +++ b/rootly_sdk/models/alert_urgency_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertUrgencyResponse: """ Attributes: data (AlertUrgencyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertUrgencyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertUrgencyResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertUrgencyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_urgency_response = cls( data=data, diff --git a/rootly_sdk/models/alert_urgency_response_data.py b/rootly_sdk/models/alert_urgency_response_data.py index e2a938c7..c013d891 100644 --- a/rootly_sdk/models/alert_urgency_response_data.py +++ b/rootly_sdk/models/alert_urgency_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertUrgencyResponseData: id: str type_: AlertUrgencyResponseDataType - attributes: AlertUrgency + attributes: "AlertUrgency" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alerts_source.py b/rootly_sdk/models/alerts_source.py index 13b79b88..3cc27deb 100644 --- a/rootly_sdk/models/alerts_source.py +++ b/rootly_sdk/models/alerts_source.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,30 +34,32 @@ class AlertsSource: secret (str): The secret used to authenticate non-email alert sources created_at (str): Date of creation updated_at (str): Date of last update - enabled (bool | Unset): Whether the alert source is enabled. Disabled sources do not create alerts from incoming - events. - source_type (AlertsSourceSourceType | Unset): The alert source type - alert_urgency_id (str | Unset): ID for the default alert urgency assigned to this alert source - deduplicate_alerts_by_key (bool | Unset): Toggle alert deduplication using deduplication key. If enabled, + enabled (Union[Unset, bool]): Whether the alert source is enabled. Disabled sources do not create alerts from + incoming events. + source_type (Union[Unset, AlertsSourceSourceType]): The alert source type + alert_urgency_id (Union[Unset, str]): ID for the default alert urgency assigned to this alert source + deduplicate_alerts_by_key (Union[Unset, bool]): Toggle alert deduplication using deduplication key. If enabled, deduplication_key_kind and deduplication_key_path are required. - deduplication_key_kind (AlertsSourceDeduplicationKeyKind | Unset): Kind of deduplication key. - deduplication_key_path (None | str | Unset): Path to deduplication key. This is a JSON Path to extract the + deduplication_key_kind (Union[Unset, AlertsSourceDeduplicationKeyKind]): Kind of deduplication key. + deduplication_key_path (Union[None, Unset, str]): Path to deduplication key. This is a JSON Path to extract the deduplication key from the request body. - deduplication_key_regexp (None | str | Unset): Regular expression to extract key from value found at key path. - owner_group_ids (list[str] | Unset): List of team IDs that will own the alert source - alert_template_attributes (AlertsSourceAlertTemplateAttributesType0 | None | Unset): - alert_source_urgency_rules_attributes (list[AlertsSourceAlertSourceUrgencyRulesAttributesItem] | Unset): List of - rules that define the conditions under which the alert urgency will be set automatically based on the alert - payload - sourceable_attributes (AlertsSourceSourceableAttributesType0 | None | Unset): Provide additional attributes for - generic_webhook alerts source - resolution_rule_attributes (AlertsSourceResolutionRuleAttributesType0 | None | Unset): Provide additional + deduplication_key_regexp (Union[None, Unset, str]): Regular expression to extract key from value found at key + path. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that will own the alert source + alert_template_attributes (Union['AlertsSourceAlertTemplateAttributesType0', None, Unset]): + alert_source_urgency_rules_attributes (Union[Unset, list['AlertsSourceAlertSourceUrgencyRulesAttributesItem']]): + List of rules that define the conditions under which the alert urgency will be set automatically based on the + alert payload + sourceable_attributes (Union['AlertsSourceSourceableAttributesType0', None, Unset]): Provide additional + attributes for the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` apply to + generic_webhook sources; `accept_threaded_emails` applies to email sources. + resolution_rule_attributes (Union['AlertsSourceResolutionRuleAttributesType0', None, Unset]): Provide additional attributes for email alerts source - alert_source_fields_attributes (list[AlertsSourceAlertSourceFieldsAttributesItem] | Unset): List of alert fields - to be added to the alert source. Note: This attribute requires the alert field feature to be enabled on your - account. Contact Rootly customer support if you need assistance with this feature. - email (None | str | Unset): The email generated for email alert sources - webhook_endpoint (None | str | Unset): The webhook URL generated for non-email alert sources + alert_source_fields_attributes (Union[Unset, list['AlertsSourceAlertSourceFieldsAttributesItem']]): List of + alert fields to be added to the alert source. Note: This attribute requires the alert field feature to be + enabled on your account. Contact Rootly customer support if you need assistance with this feature. + email (Union[None, Unset, str]): The email generated for email alert sources + webhook_endpoint (Union[None, Unset, str]): The webhook URL generated for non-email alert sources """ name: str @@ -67,21 +67,21 @@ class AlertsSource: secret: str created_at: str updated_at: str - enabled: bool | Unset = UNSET - source_type: AlertsSourceSourceType | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - deduplicate_alerts_by_key: bool | Unset = UNSET - deduplication_key_kind: AlertsSourceDeduplicationKeyKind | Unset = UNSET - deduplication_key_path: None | str | Unset = UNSET - deduplication_key_regexp: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - alert_template_attributes: AlertsSourceAlertTemplateAttributesType0 | None | Unset = UNSET - alert_source_urgency_rules_attributes: list[AlertsSourceAlertSourceUrgencyRulesAttributesItem] | Unset = UNSET - sourceable_attributes: AlertsSourceSourceableAttributesType0 | None | Unset = UNSET - resolution_rule_attributes: AlertsSourceResolutionRuleAttributesType0 | None | Unset = UNSET - alert_source_fields_attributes: list[AlertsSourceAlertSourceFieldsAttributesItem] | Unset = UNSET - email: None | str | Unset = UNSET - webhook_endpoint: None | str | Unset = UNSET + enabled: Unset | bool = UNSET + source_type: Unset | AlertsSourceSourceType = UNSET + alert_urgency_id: Unset | str = UNSET + deduplicate_alerts_by_key: Unset | bool = UNSET + deduplication_key_kind: Unset | AlertsSourceDeduplicationKeyKind = UNSET + deduplication_key_path: None | Unset | str = UNSET + deduplication_key_regexp: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + alert_template_attributes: Union["AlertsSourceAlertTemplateAttributesType0", None, Unset] = UNSET + alert_source_urgency_rules_attributes: Unset | list["AlertsSourceAlertSourceUrgencyRulesAttributesItem"] = UNSET + sourceable_attributes: Union["AlertsSourceSourceableAttributesType0", None, Unset] = UNSET + resolution_rule_attributes: Union["AlertsSourceResolutionRuleAttributesType0", None, Unset] = UNSET + alert_source_fields_attributes: Unset | list["AlertsSourceAlertSourceFieldsAttributesItem"] = UNSET + email: None | Unset | str = UNSET + webhook_endpoint: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: str | Unset = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -109,27 +109,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: str | Unset = UNSET + deduplication_key_kind: Unset | str = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | str | Unset + deduplication_key_path: None | Unset | str if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | str | Unset + deduplication_key_regexp: None | Unset | str if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: dict[str, Any] | None | Unset + alert_template_attributes: None | Unset | dict[str, Any] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, AlertsSourceAlertTemplateAttributesType0): @@ -137,14 +137,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: dict[str, Any] | None | Unset + sourceable_attributes: None | Unset | dict[str, Any] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, AlertsSourceSourceableAttributesType0): @@ -152,7 +152,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: dict[str, Any] | None | Unset + resolution_rule_attributes: None | Unset | dict[str, Any] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, AlertsSourceResolutionRuleAttributesType0): @@ -160,20 +160,20 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: alert_source_fields_attributes_item = alert_source_fields_attributes_item_data.to_dict() alert_source_fields_attributes.append(alert_source_fields_attributes_item) - email: None | str | Unset + email: None | Unset | str if isinstance(self.email, Unset): email = UNSET else: email = self.email - webhook_endpoint: None | str | Unset + webhook_endpoint: None | Unset | str if isinstance(self.webhook_endpoint, Unset): webhook_endpoint = UNSET else: @@ -249,7 +249,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: AlertsSourceSourceType | Unset + source_type: Unset | AlertsSourceSourceType if isinstance(_source_type, Unset): source_type = UNSET else: @@ -260,33 +260,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: AlertsSourceDeduplicationKeyKind | Unset + deduplication_key_kind: Unset | AlertsSourceDeduplicationKeyKind if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: deduplication_key_kind = check_alerts_source_deduplication_key_kind(_deduplication_key_kind) - def _parse_deduplication_key_path(data: object) -> None | str | Unset: + def _parse_deduplication_key_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: + def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_alert_template_attributes(data: object) -> AlertsSourceAlertTemplateAttributesType0 | None | Unset: + def _parse_alert_template_attributes( + data: object, + ) -> Union["AlertsSourceAlertTemplateAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -297,26 +299,22 @@ def _parse_alert_template_attributes(data: object) -> AlertsSourceAlertTemplateA alert_template_attributes_type_0 = AlertsSourceAlertTemplateAttributesType0.from_dict(data) return alert_template_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertsSourceAlertTemplateAttributesType0 | None | Unset, data) + return cast(Union["AlertsSourceAlertTemplateAttributesType0", None, Unset], data) alert_template_attributes = _parse_alert_template_attributes(d.pop("alert_template_attributes", UNSET)) + alert_source_urgency_rules_attributes = [] _alert_source_urgency_rules_attributes = d.pop("alert_source_urgency_rules_attributes", UNSET) - alert_source_urgency_rules_attributes: list[AlertsSourceAlertSourceUrgencyRulesAttributesItem] | Unset = UNSET - if _alert_source_urgency_rules_attributes is not UNSET: - alert_source_urgency_rules_attributes = [] - for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes: - alert_source_urgency_rules_attributes_item = ( - AlertsSourceAlertSourceUrgencyRulesAttributesItem.from_dict( - alert_source_urgency_rules_attributes_item_data - ) - ) + for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes or []: + alert_source_urgency_rules_attributes_item = AlertsSourceAlertSourceUrgencyRulesAttributesItem.from_dict( + alert_source_urgency_rules_attributes_item_data + ) - alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) + alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - def _parse_sourceable_attributes(data: object) -> AlertsSourceSourceableAttributesType0 | None | Unset: + def _parse_sourceable_attributes(data: object) -> Union["AlertsSourceSourceableAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -327,13 +325,15 @@ def _parse_sourceable_attributes(data: object) -> AlertsSourceSourceableAttribut sourceable_attributes_type_0 = AlertsSourceSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertsSourceSourceableAttributesType0 | None | Unset, data) + return cast(Union["AlertsSourceSourceableAttributesType0", None, Unset], data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) - def _parse_resolution_rule_attributes(data: object) -> AlertsSourceResolutionRuleAttributesType0 | None | Unset: + def _parse_resolution_rule_attributes( + data: object, + ) -> Union["AlertsSourceResolutionRuleAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -344,38 +344,36 @@ def _parse_resolution_rule_attributes(data: object) -> AlertsSourceResolutionRul resolution_rule_attributes_type_0 = AlertsSourceResolutionRuleAttributesType0.from_dict(data) return resolution_rule_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertsSourceResolutionRuleAttributesType0 | None | Unset, data) + return cast(Union["AlertsSourceResolutionRuleAttributesType0", None, Unset], data) resolution_rule_attributes = _parse_resolution_rule_attributes(d.pop("resolution_rule_attributes", UNSET)) + alert_source_fields_attributes = [] _alert_source_fields_attributes = d.pop("alert_source_fields_attributes", UNSET) - alert_source_fields_attributes: list[AlertsSourceAlertSourceFieldsAttributesItem] | Unset = UNSET - if _alert_source_fields_attributes is not UNSET: - alert_source_fields_attributes = [] - for alert_source_fields_attributes_item_data in _alert_source_fields_attributes: - alert_source_fields_attributes_item = AlertsSourceAlertSourceFieldsAttributesItem.from_dict( - alert_source_fields_attributes_item_data - ) + for alert_source_fields_attributes_item_data in _alert_source_fields_attributes or []: + alert_source_fields_attributes_item = AlertsSourceAlertSourceFieldsAttributesItem.from_dict( + alert_source_fields_attributes_item_data + ) - alert_source_fields_attributes.append(alert_source_fields_attributes_item) + alert_source_fields_attributes.append(alert_source_fields_attributes_item) - def _parse_email(data: object) -> None | str | Unset: + def _parse_email(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email = _parse_email(d.pop("email", UNSET)) - def _parse_webhook_endpoint(data: object) -> None | str | Unset: + def _parse_webhook_endpoint(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) webhook_endpoint = _parse_webhook_endpoint(d.pop("webhook_endpoint", UNSET)) diff --git a/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py b/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py index a9f3276f..4c60c844 100644 --- a/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,19 +13,19 @@ class AlertsSourceAlertSourceFieldsAttributesItem: """ Attributes: - alert_field_id (str | Unset): The ID of the alert field - template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for - evaluation + alert_field_id (Union[Unset, str]): The ID of the alert field + template_body (Union[None, Unset, str]): Liquid expression to extract a specific value from the alert's payload + for evaluation """ - alert_field_id: str | Unset = UNSET - template_body: None | str | Unset = UNSET + alert_field_id: Unset | str = UNSET + template_body: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | str | Unset + template_body: None | Unset | str if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -48,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> None | str | Unset: + def _parse_template_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py index f3cb5e0c..a462d04a 100644 --- a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,53 +25,53 @@ class AlertsSourceAlertSourceUrgencyRulesAttributesItem: """ Attributes: - json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for - evaluation - operator (AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset): Comparison operator used to + json_path (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload + for evaluation + operator (Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator]): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset): The type of the - conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset): The kind of the conditionable - alert_urgency_id (str | Unset): The ID of the alert urgency + conditionable_type (Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType]): The type + of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemKind]): The kind of the conditionable + alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: None | str | Unset = UNSET - operator: AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset = UNSET - conditionable_id: None | str | Unset = UNSET - kind: AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET - alert_urgency_id: str | Unset = UNSET + json_path: None | Unset | str = UNSET + operator: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemKind = UNSET + alert_urgency_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | str | Unset + json_path: None | Unset | str if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: str | Unset = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -103,17 +101,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_json_path(data: object) -> None | str | Unset: + def _parse_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset + operator: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -122,7 +120,7 @@ def _parse_json_path(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset + conditionable_type: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -130,17 +128,17 @@ def _parse_json_path(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset + kind: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py b/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py index 139bdfa8..5cd8aa2f 100644 --- a/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class AlertsSourceAlertTemplateAttributesType0: """ Attributes: - title (None | str | Unset): The alert title. - description (None | str | Unset): The alert description. - external_url (None | str | Unset): The alert URL. + title (Union[None, Unset, str]): The alert title. + description (Union[None, Unset, str]): The alert description. + external_url (Union[None, Unset, str]): The alert URL. """ - title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET + title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -60,30 +58,30 @@ 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_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/alerts_source_list.py b/rootly_sdk/models/alerts_source_list.py index 922a66a7..8335e9c5 100644 --- a/rootly_sdk/models/alerts_source_list.py +++ b/rootly_sdk/models/alerts_source_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AlertsSourceList: """ Attributes: - data (list[AlertsSourceListDataItem]): + data (list['AlertsSourceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertsSourceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertsSourceListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alerts_source_list = cls( data=data, diff --git a/rootly_sdk/models/alerts_source_list_data_item.py b/rootly_sdk/models/alerts_source_list_data_item.py index 697c5bc3..5650b90d 100644 --- a/rootly_sdk/models/alerts_source_list_data_item.py +++ b/rootly_sdk/models/alerts_source_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertsSourceListDataItem: id: str type_: AlertsSourceListDataItemType - attributes: AlertsSource + attributes: "AlertsSource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py index efa3dec0..5364cf61 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,68 +32,67 @@ class AlertsSourceResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (bool | Unset): Set this to true to enable the auto resolution rule - condition_type (AlertsSourceResolutionRuleAttributesType0ConditionType | Unset): The type of condition to + enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule + condition_type (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType]): The type of condition to evaluate to apply auto resolution rule - identifier_matchable_type (AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset): The type - of the identifier matchable - identifier_matchable_id (None | str | Unset): The ID of the identifier matchable. If identifier_matchable_type - is AlertField, this is the ID of the alert field. - identifier_reference_kind (AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset): The kind - of the identifier reference - identifier_json_path (None | str | Unset): JSON path expression to extract unique alert identifier used to match - triggered alerts with resolving alerts - identifier_value_regex (None | str | Unset): Regex group to further specify the part of the string used as a - unique identifier - conditions_attributes (list[AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem] | Unset): List of - conditions to evaluate for auto resolution + identifier_matchable_type (Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType]): The + type of the identifier matchable + identifier_matchable_id (Union[None, Unset, str]): The ID of the identifier matchable. If + identifier_matchable_type is AlertField, this is the ID of the alert field. + identifier_reference_kind (Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind]): The + kind of the identifier reference + identifier_json_path (Union[None, Unset, str]): JSON path expression to extract unique alert identifier used to + match triggered alerts with resolving alerts + identifier_value_regex (Union[None, Unset, str]): Regex group to further specify the part of the string used as + a unique identifier + conditions_attributes (Union[Unset, list['AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem']]): + List of conditions to evaluate for auto resolution """ - enabled: bool | Unset = UNSET - condition_type: AlertsSourceResolutionRuleAttributesType0ConditionType | Unset = UNSET - identifier_matchable_type: AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset = UNSET - identifier_matchable_id: None | str | Unset = UNSET - identifier_reference_kind: AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset = UNSET - identifier_json_path: None | str | Unset = UNSET - identifier_value_regex: None | str | Unset = UNSET - conditions_attributes: list[AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem] | Unset = UNSET + enabled: Unset | bool = UNSET + condition_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionType = UNSET + identifier_matchable_type: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType = UNSET + identifier_matchable_id: None | Unset | str = UNSET + identifier_reference_kind: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind = UNSET + identifier_json_path: None | Unset | str = UNSET + identifier_value_regex: None | Unset | str = UNSET + conditions_attributes: Unset | list["AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: str | Unset = UNSET + identifier_matchable_type: Unset | str = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | str | Unset + identifier_matchable_id: None | Unset | str if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: str | Unset = UNSET + identifier_reference_kind: Unset | str = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | str | Unset + identifier_json_path: None | Unset | str if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | str | Unset + identifier_value_regex: None | Unset | str if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: list[dict[str, Any]] | Unset = UNSET + conditions_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -134,14 +131,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: AlertsSourceResolutionRuleAttributesType0ConditionType | Unset + condition_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_alerts_source_resolution_rule_attributes_type_0_condition_type(_condition_type) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset + identifier_matchable_type: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -149,17 +146,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _identifier_matchable_type ) - def _parse_identifier_matchable_id(data: object) -> None | str | Unset: + def _parse_identifier_matchable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset + identifier_reference_kind: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -167,36 +164,32 @@ def _parse_identifier_matchable_id(data: object) -> None | str | Unset: _identifier_reference_kind ) - def _parse_identifier_json_path(data: object) -> None | str | Unset: + def _parse_identifier_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | str | Unset: + def _parse_identifier_value_regex(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) + conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - conditions_attributes: list[AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem] | Unset = UNSET - if _conditions_attributes is not UNSET: - conditions_attributes = [] - for conditions_attributes_item_data in _conditions_attributes: - conditions_attributes_item = ( - AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) - ) + for conditions_attributes_item_data in _conditions_attributes or []: + conditions_attributes_item = AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( + conditions_attributes_item_data + ) - conditions_attributes.append(conditions_attributes_item) + conditions_attributes.append(conditions_attributes_item) alerts_source_resolution_rule_attributes_type_0 = cls( enabled=enabled, diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py index ccc2ade1..37aa59ad 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,54 +25,55 @@ class AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset): Comparison + operator (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset): - The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset): The kind of the + conditionable_type (Union[Unset, + AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind]): The kind of the conditionable """ - field: None | str | Unset = UNSET - operator: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset = ( + field: None | Unset | str = UNSET + operator: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType = ( UNSET ) - conditionable_id: None | str | Unset = UNSET - kind: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | str | Unset + field: None | Unset | str if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: str | Unset = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -100,17 +99,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_field(data: object) -> None | str | Unset: + def _parse_field(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset + operator: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -121,7 +120,7 @@ def _parse_field(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset + conditionable_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -131,17 +130,17 @@ def _parse_field(data: object) -> None | str | Unset: ) ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset + kind: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_response.py b/rootly_sdk/models/alerts_source_response.py index e90b0d90..f7e132aa 100644 --- a/rootly_sdk/models/alerts_source_response.py +++ b/rootly_sdk/models/alerts_source_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AlertsSourceResponse: """ Attributes: data (AlertsSourceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertsSourceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertsSourceResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertsSourceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alerts_source_response = cls( data=data, diff --git a/rootly_sdk/models/alerts_source_response_data.py b/rootly_sdk/models/alerts_source_response_data.py index 848030dc..1c8f6d20 100644 --- a/rootly_sdk/models/alerts_source_response_data.py +++ b/rootly_sdk/models/alerts_source_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertsSourceResponseData: id: str type_: AlertsSourceResponseDataType - attributes: AlertsSource + attributes: "AlertsSource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py index e7714a10..1c5966d0 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py @@ -1,7 +1,6 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast +from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,29 +18,36 @@ @_attrs_define class AlertsSourceSourceableAttributesType0: - """Provide additional attributes for generic_webhook alerts source - - Attributes: - auto_resolve (bool | Unset): Set this to true to auto-resolve alerts based on field_mappings_attributes - conditions - resolve_state (None | str | Unset): This value is matched with the value extracted from alerts payload using - JSON path in field_mappings_attributes - accept_threaded_emails (bool | Unset): Set this to false to reject threaded emails - field_mappings_attributes (list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset): - Specify rules to auto resolve alerts + """Provide additional attributes for the underlying source. `auto_resolve`, `resolve_state` and + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + + Attributes: + id (Union[Unset, UUID]): Unique ID of the underlying source. Read-only; it is resolved from the alert source + itself on update. + auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + conditions + resolve_state (Union[None, Unset, str]): This value is matched with the value extracted from alerts payload + using JSON path in field_mappings_attributes + accept_threaded_emails (Union[Unset, bool]): Set this to false to reject threaded emails + field_mappings_attributes (Union[Unset, + list['AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to auto resolve alerts """ - auto_resolve: bool | Unset = UNSET - resolve_state: None | str | Unset = UNSET - accept_threaded_emails: bool | Unset = UNSET - field_mappings_attributes: list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset = UNSET + id: Unset | UUID = UNSET + auto_resolve: Unset | bool = UNSET + resolve_state: None | Unset | str = UNSET + accept_threaded_emails: Unset | bool = UNSET + field_mappings_attributes: Unset | list["AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + id: Unset | str = UNSET + if not isinstance(self.id, Unset): + id = str(self.id) auto_resolve = self.auto_resolve - resolve_state: None | str | Unset + resolve_state: None | Unset | str if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -49,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET + field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -59,6 +65,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if auto_resolve is not UNSET: field_dict["auto_resolve"] = auto_resolve if resolve_state is not UNSET: @@ -77,35 +85,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + _id = d.pop("id", UNSET) + id: Unset | UUID + if isinstance(_id, Unset): + id = UNSET + else: + id = UUID(_id) + auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | str | Unset: + def _parse_resolve_state(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) accept_threaded_emails = d.pop("accept_threaded_emails", UNSET) + field_mappings_attributes = [] _field_mappings_attributes = d.pop("field_mappings_attributes", UNSET) - field_mappings_attributes: list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset = ( - UNSET - ) - if _field_mappings_attributes is not UNSET: - field_mappings_attributes = [] - for field_mappings_attributes_item_data in _field_mappings_attributes: - field_mappings_attributes_item = ( - AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data - ) - ) + for field_mappings_attributes_item_data in _field_mappings_attributes or []: + field_mappings_attributes_item = AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem.from_dict( + field_mappings_attributes_item_data + ) - field_mappings_attributes.append(field_mappings_attributes_item) + field_mappings_attributes.append(field_mappings_attributes_item) alerts_source_sourceable_attributes_type_0 = cls( + id=id, auto_resolve=auto_resolve, resolve_state=resolve_state, accept_threaded_emails=accept_threaded_emails, diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py index af6141fc..5c28c098 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,19 +17,19 @@ class AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset): Select the field on which - the condition to be evaluated - json_path (str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[Unset, AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField]): Select the field on + which the condition to be evaluated + json_path (Union[Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation. For `notification_target_id` only: if your account has opted in to Dynamic Notification Targets, this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET - json_path: str | Unset = UNSET + field: Unset | AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: str | Unset = UNSET + field: Unset | str = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset + field: Unset | AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/api_key.py b/rootly_sdk/models/api_key.py index c58d6d6b..8cbe7a1b 100644 --- a/rootly_sdk/models/api_key.py +++ b/rootly_sdk/models/api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,24 +18,24 @@ class ApiKey: kind (ApiKeyKind): The kind of the API key created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): A description of the API key - role_id (None | str | Unset): The role ID - on_call_role_id (None | str | Unset): The on-call role ID - expires_at (None | str | Unset): Expiration date - last_used_at (None | str | Unset): Date of last use - grace_period_ends_at (None | str | Unset): Grace period end date + description (Union[None, Unset, str]): A description of the API key + role_id (Union[None, Unset, str]): The role ID + on_call_role_id (Union[None, Unset, str]): The on-call role ID + expires_at (Union[None, Unset, str]): Expiration date + last_used_at (Union[None, Unset, str]): Date of last use + grace_period_ends_at (Union[None, Unset, str]): Grace period end date """ name: str kind: ApiKeyKind created_at: str updated_at: str - description: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET - expires_at: None | str | Unset = UNSET - last_used_at: None | str | Unset = UNSET - grace_period_ends_at: None | str | Unset = UNSET + description: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET + expires_at: None | Unset | str = UNSET + last_used_at: None | Unset | str = UNSET + grace_period_ends_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,37 +47,37 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: None | str | Unset + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: on_call_role_id = self.on_call_role_id - expires_at: None | str | Unset + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: None | str | Unset + last_used_at: None | Unset | str if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: None | str | Unset + grace_period_ends_at: None | Unset | str if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -121,57 +119,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> None | str | Unset: + def _parse_expires_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> None | str | Unset: + def _parse_last_used_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> None | str | Unset: + def _parse_grace_period_ends_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) diff --git a/rootly_sdk/models/api_key_list.py b/rootly_sdk/models/api_key_list.py index ec533508..a2dab4b9 100644 --- a/rootly_sdk/models/api_key_list.py +++ b/rootly_sdk/models/api_key_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class ApiKeyList: """ Attributes: - data (list[ApiKeyListDataItem]): + data (list['ApiKeyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ApiKeyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ApiKeyListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) api_key_list = cls( data=data, diff --git a/rootly_sdk/models/api_key_list_data_item.py b/rootly_sdk/models/api_key_list_data_item.py index 805cc948..e34eec4d 100644 --- a/rootly_sdk/models/api_key_list_data_item.py +++ b/rootly_sdk/models/api_key_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ApiKeyListDataItem: id: str type_: ApiKeyListDataItemType - attributes: ApiKey + attributes: "ApiKey" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/api_key_response.py b/rootly_sdk/models/api_key_response.py index 73e001f3..b9623902 100644 --- a/rootly_sdk/models/api_key_response.py +++ b/rootly_sdk/models/api_key_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ApiKeyResponse: """ Attributes: data (ApiKeyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ApiKeyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ApiKeyResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ApiKeyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) api_key_response = cls( data=data, diff --git a/rootly_sdk/models/api_key_response_data.py b/rootly_sdk/models/api_key_response_data.py index ecc665d2..651f44fd 100644 --- a/rootly_sdk/models/api_key_response_data.py +++ b/rootly_sdk/models/api_key_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ApiKeyResponseData: id: str type_: ApiKeyResponseDataType - attributes: ApiKey + attributes: "ApiKey" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/api_key_with_token_response.py b/rootly_sdk/models/api_key_with_token_response.py index 1d29d480..6621fe08 100644 --- a/rootly_sdk/models/api_key_with_token_response.py +++ b/rootly_sdk/models/api_key_with_token_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ApiKeyWithTokenResponse: """ Attributes: data (ApiKeyWithTokenResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ApiKeyWithTokenResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ApiKeyWithTokenResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ApiKeyWithTokenResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) api_key_with_token_response = cls( data=data, diff --git a/rootly_sdk/models/api_key_with_token_response_data.py b/rootly_sdk/models/api_key_with_token_response_data.py index 3df6e4e5..1b87d1ac 100644 --- a/rootly_sdk/models/api_key_with_token_response_data.py +++ b/rootly_sdk/models/api_key_with_token_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ApiKeyWithTokenResponseData: id: str type_: ApiKeyWithTokenResponseDataType - attributes: ApiKeyWithTokenResponseDataAttributes + attributes: "ApiKeyWithTokenResponseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/api_key_with_token_response_data_attributes.py b/rootly_sdk/models/api_key_with_token_response_data_attributes.py index 31d30f84..daa23b56 100644 --- a/rootly_sdk/models/api_key_with_token_response_data_attributes.py +++ b/rootly_sdk/models/api_key_with_token_response_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,12 +19,12 @@ class ApiKeyWithTokenResponseDataAttributes: created_at (str): Date of creation updated_at (str): Date of last update token (str): The API key token (only shown once) - description (None | str | Unset): A description of the API key - role_id (None | str | Unset): The role ID - on_call_role_id (None | str | Unset): The on-call role ID - expires_at (None | str | Unset): Expiration date - last_used_at (None | str | Unset): Date of last use - grace_period_ends_at (None | str | Unset): Grace period end date + description (Union[None, Unset, str]): A description of the API key + role_id (Union[None, Unset, str]): The role ID + on_call_role_id (Union[None, Unset, str]): The on-call role ID + expires_at (Union[None, Unset, str]): Expiration date + last_used_at (Union[None, Unset, str]): Date of last use + grace_period_ends_at (Union[None, Unset, str]): Grace period end date """ name: str @@ -34,12 +32,12 @@ class ApiKeyWithTokenResponseDataAttributes: created_at: str updated_at: str token: str - description: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET - expires_at: None | str | Unset = UNSET - last_used_at: None | str | Unset = UNSET - grace_period_ends_at: None | str | Unset = UNSET + description: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET + expires_at: None | Unset | str = UNSET + last_used_at: None | Unset | str = UNSET + grace_period_ends_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,37 +51,37 @@ def to_dict(self) -> dict[str, Any]: token = self.token - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: None | str | Unset + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: on_call_role_id = self.on_call_role_id - expires_at: None | str | Unset + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: None | str | Unset + last_used_at: None | Unset | str if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: None | str | Unset + grace_period_ends_at: None | Unset | str if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -128,57 +126,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: token = d.pop("token") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> None | str | Unset: + def _parse_expires_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> None | str | Unset: + def _parse_last_used_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> None | str | Unset: + def _parse_grace_period_ends_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) diff --git a/rootly_sdk/models/archive_google_chat_spaces_task_params.py b/rootly_sdk/models/archive_google_chat_spaces_task_params.py index 2389e17f..fb8c332c 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,22 +21,21 @@ class ArchiveGoogleChatSpacesTaskParams: """ Attributes: - spaces (list[ArchiveGoogleChatSpacesTaskParamsSpacesItem]): - task_type (ArchiveGoogleChatSpacesTaskParamsTaskType | Unset): + spaces (list['ArchiveGoogleChatSpacesTaskParamsSpacesItem']): + task_type (Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType]): """ - spaces: list[ArchiveGoogleChatSpacesTaskParamsSpacesItem] - task_type: ArchiveGoogleChatSpacesTaskParamsTaskType | Unset = UNSET + spaces: list["ArchiveGoogleChatSpacesTaskParamsSpacesItem"] + task_type: Unset | ArchiveGoogleChatSpacesTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - spaces = [] for spaces_item_data in self.spaces: spaces_item = spaces_item_data.to_dict() spaces.append(spaces_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -69,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: spaces.append(spaces_item) _task_type = d.pop("task_type", UNSET) - task_type: ArchiveGoogleChatSpacesTaskParamsTaskType | Unset + task_type: Unset | ArchiveGoogleChatSpacesTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py b/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py index ae50ba42..47588364 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ArchiveGoogleChatSpacesTaskParamsSpacesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py index 5187f9fd..16877c4e 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,17 +25,16 @@ class ArchiveMicrosoftTeamsChannelsTaskParams: """ Attributes: team (ArchiveMicrosoftTeamsChannelsTaskParamsTeam): - channels (list[ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem]): - task_type (ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset): + channels (list['ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem']): + task_type (Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType]): """ - team: ArchiveMicrosoftTeamsChannelsTaskParamsTeam - channels: list[ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem] - task_type: ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset = UNSET + team: "ArchiveMicrosoftTeamsChannelsTaskParamsTeam" + channels: list["ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem"] + task_type: Unset | ArchiveMicrosoftTeamsChannelsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() channels = [] @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -82,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset + task_type: Unset | ArchiveMicrosoftTeamsChannelsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py index bf1a0ca0..d22bf87d 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py index 2bc1aa10..d254639c 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_slack_channels_task_params.py b/rootly_sdk/models/archive_slack_channels_task_params.py index a808ecd2..567f8aad 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params.py +++ b/rootly_sdk/models/archive_slack_channels_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,22 +21,21 @@ class ArchiveSlackChannelsTaskParams: """ Attributes: - channels (list[ArchiveSlackChannelsTaskParamsChannelsItem]): - task_type (ArchiveSlackChannelsTaskParamsTaskType | Unset): + channels (list['ArchiveSlackChannelsTaskParamsChannelsItem']): + task_type (Union[Unset, ArchiveSlackChannelsTaskParamsTaskType]): """ - channels: list[ArchiveSlackChannelsTaskParamsChannelsItem] - task_type: ArchiveSlackChannelsTaskParamsTaskType | Unset = UNSET + channels: list["ArchiveSlackChannelsTaskParamsChannelsItem"] + task_type: Unset | ArchiveSlackChannelsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: ArchiveSlackChannelsTaskParamsTaskType | Unset + task_type: Unset | ArchiveSlackChannelsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py b/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py index dc246e77..61adea9f 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py +++ b/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ArchiveSlackChannelsTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/assign_role_to_user.py b/rootly_sdk/models/assign_role_to_user.py index 947a8507..e28725e6 100644 --- a/rootly_sdk/models/assign_role_to_user.py +++ b/rootly_sdk/models/assign_role_to_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AssignRoleToUser: data (AssignRoleToUserData): """ - data: AssignRoleToUserData + data: "AssignRoleToUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/assign_role_to_user_data.py b/rootly_sdk/models/assign_role_to_user_data.py index 461a07ed..7586cd3f 100644 --- a/rootly_sdk/models/assign_role_to_user_data.py +++ b/rootly_sdk/models/assign_role_to_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class AssignRoleToUserData: """ type_: AssignRoleToUserDataType - attributes: AssignRoleToUserDataAttributes + attributes: "AssignRoleToUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/assign_role_to_user_data_attributes.py b/rootly_sdk/models/assign_role_to_user_data_attributes.py index 466f8a92..11b176f1 100644 --- a/rootly_sdk/models/assign_role_to_user_data_attributes.py +++ b/rootly_sdk/models/assign_role_to_user_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +12,12 @@ class AssignRoleToUserDataAttributes: """ Attributes: - user_id (str | Unset): ID of user you wish to assign this incident - incident_role_id (str | Unset): ID of the incident role + user_id (Union[Unset, str]): ID of user you wish to assign this incident + incident_role_id (Union[Unset, str]): ID of the incident role """ - user_id: str | Unset = UNSET - incident_role_id: str | Unset = UNSET + user_id: Unset | str = UNSET + incident_role_id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/attach_alert.py b/rootly_sdk/models/attach_alert.py index 39dc5313..556ace8e 100644 --- a/rootly_sdk/models/attach_alert.py +++ b/rootly_sdk/models/attach_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AttachAlert: data (AttachAlertData): """ - data: AttachAlertData + data: "AttachAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/attach_alert_data.py b/rootly_sdk/models/attach_alert_data.py index 347f3b33..2fc46472 100644 --- a/rootly_sdk/models/attach_alert_data.py +++ b/rootly_sdk/models/attach_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class AttachAlertData: """ type_: AttachAlertDataType - attributes: AttachAlertDataAttributes + attributes: "AttachAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/attach_alert_data_attributes.py b/rootly_sdk/models/attach_alert_data_attributes.py index 6e524c81..597f3be9 100644 --- a/rootly_sdk/models/attach_alert_data_attributes.py +++ b/rootly_sdk/models/attach_alert_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,13 +10,13 @@ class AttachAlertDataAttributes: """ Attributes: - alert_ids (list[str] | None): Alert Id to attach to the incident + alert_ids (Union[None, list[str]]): Alert Id to attach to the incident """ - alert_ids: list[str] | None + alert_ids: None | list[str] def to_dict(self) -> dict[str, Any]: - alert_ids: list[str] | None + alert_ids: None | list[str] if isinstance(self.alert_ids, list): alert_ids = self.alert_ids @@ -39,7 +37,7 @@ 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_alert_ids(data: object) -> list[str] | None: + def _parse_alert_ids(data: object) -> None | list[str]: if data is None: return data try: @@ -48,9 +46,9 @@ def _parse_alert_ids(data: object) -> list[str] | None: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None, data) + return cast(None | list[str], data) alert_ids = _parse_alert_ids(d.pop("alert_ids")) diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params.py b/rootly_sdk/models/attach_datadog_dashboards_task_params.py index d40d148b..36c3444b 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,32 +26,31 @@ class AttachDatadogDashboardsTaskParams: """ Attributes: - dashboards (list[AttachDatadogDashboardsTaskParamsDashboardsItem]): - task_type (AttachDatadogDashboardsTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset): + dashboards (list['AttachDatadogDashboardsTaskParamsDashboardsItem']): + task_type (Union[Unset, AttachDatadogDashboardsTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem']]): """ - dashboards: list[AttachDatadogDashboardsTaskParamsDashboardsItem] - task_type: AttachDatadogDashboardsTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset = UNSET + dashboards: list["AttachDatadogDashboardsTaskParamsDashboardsItem"] + task_type: Unset | AttachDatadogDashboardsTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -94,7 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: AttachDatadogDashboardsTaskParamsTaskType | Unset + task_type: Unset | AttachDatadogDashboardsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,16 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) attach_datadog_dashboards_task_params = cls( dashboards=dashboards, diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py index 5930e6f9..7921c70f 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AttachDatadogDashboardsTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py index 8436f266..cb588b97 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py new file mode 100644 index 00000000..f9fd95ed --- /dev/null +++ b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py @@ -0,0 +1,90 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, + check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AttachRetrospectivePdfToFreshserviceTicketTaskParams") + + +@_attrs_define +class AttachRetrospectivePdfToFreshserviceTicketTaskParams: + """ + Attributes: + ticket_id (str): The Freshservice ticket id + task_type (Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType]): + filename (Union[Unset, str]): The attachment filename + """ + + ticket_id: str + task_type: Unset | AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType = UNSET + filename: Unset | str = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + ticket_id = self.ticket_id + + task_type: Unset | str = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type + + filename = self.filename + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ticket_id": ticket_id, + } + ) + if task_type is not UNSET: + field_dict["task_type"] = task_type + if filename is not UNSET: + field_dict["filename"] = filename + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ticket_id = d.pop("ticket_id") + + _task_type = d.pop("task_type", UNSET) + task_type: Unset | AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType + if isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type(_task_type) + + filename = d.pop("filename", UNSET) + + attach_retrospective_pdf_to_freshservice_ticket_task_params = cls( + ticket_id=ticket_id, + task_type=task_type, + filename=filename, + ) + + attach_retrospective_pdf_to_freshservice_ticket_task_params.additional_properties = d + return attach_retrospective_pdf_to_freshservice_ticket_task_params + + @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/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py new file mode 100644 index 00000000..dda7dcb5 --- /dev/null +++ b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py @@ -0,0 +1,23 @@ +from typing import Literal, cast + +AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType = Literal[ + "attach_retrospective_pdf_to_freshservice_ticket" +] + +ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: set[ + AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType +] = { + "attach_retrospective_pdf_to_freshservice_ticket", +} + + +def check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type( + value: str | None, +) -> AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType | None: + if value is None: + return None + if value in ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: + return cast(AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py index 64c10013..5f0d7787 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,27 +24,26 @@ class AttachRetrospectivePdfToJiraIssueTaskParams: """ Attributes: issue_id (str): The issue id - task_type (AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset): - integration (AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have - more than one Jira instance - filename (str | Unset): The attachment filename + task_type (Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsTaskType]): + integration (Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsIntegration]): Specify integration id if + you have more than one Jira instance + filename (Union[Unset, str]): The attachment filename """ issue_id: str - task_type: AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset = UNSET - integration: AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset = UNSET - filename: str | Unset = UNSET + task_type: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsTaskType = UNSET + integration: Union[Unset, "AttachRetrospectivePdfToJiraIssueTaskParamsIntegration"] = UNSET + filename: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -78,14 +75,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_id = d.pop("issue_id") _task_type = d.pop("task_type", UNSET) - task_type: AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset + task_type: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_attach_retrospective_pdf_to_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset + integration: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py index 8041a47a..e4aec1c4 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class AttachRetrospectivePdfToJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/audit.py b/rootly_sdk/models/audit.py index 1efaa9d8..ec4864a5 100644 --- a/rootly_sdk/models/audit.py +++ b/rootly_sdk/models/audit.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,38 +21,38 @@ class Audit: Attributes: event (str): Describes the action that was taken. created_at (str): Date of creation - item_type (AuditItemType | Unset): Describes the object in which the action was taken on - item_type_display (None | str | Unset): Human-friendly display name for the item type - object_ (AuditObjectType0 | None | Unset): The object in which the action was taken on - object_changes (AuditObjectChangesType0 | None | Unset): The changes that occurred on the object - user_id (int | None | Unset): The ID of who took action on the object. Together with whodunnit_type can be used - to find the user - user_name (None | str | Unset): Display name of the user who performed the action - user_email (None | str | Unset): Email address of the user who performed the action - ip_address (None | str | Unset): IP address of the client that performed the action - user_agent (None | str | Unset): User-Agent header of the client that performed the action - request_id (None | str | Unset): Unique request ID (UUID) for the HTTP request that triggered the action - session_id (None | str | Unset): SHA-256 fingerprint of the web session for correlating multiple actions within - the same browser session - item_id (None | str | Unset): ID of the affected object - id (int | None | Unset): ID of audit + item_type (Union[Unset, AuditItemType]): Describes the object in which the action was taken on + item_type_display (Union[None, Unset, str]): Human-friendly display name for the item type + object_ (Union['AuditObjectType0', None, Unset]): The object in which the action was taken on + object_changes (Union['AuditObjectChangesType0', None, Unset]): The changes that occurred on the object + user_id (Union[None, Unset, int]): The ID of who took action on the object. Together with whodunnit_type can be + used to find the user + user_name (Union[None, Unset, str]): Display name of the user who performed the action + user_email (Union[None, Unset, str]): Email address of the user who performed the action + ip_address (Union[None, Unset, str]): IP address of the client that performed the action + user_agent (Union[None, Unset, str]): User-Agent header of the client that performed the action + request_id (Union[None, Unset, str]): Unique request ID (UUID) for the HTTP request that triggered the action + session_id (Union[None, Unset, str]): SHA-256 fingerprint of the web session for correlating multiple actions + within the same browser session + item_id (Union[None, Unset, str]): ID of the affected object + id (Union[None, Unset, int]): ID of audit """ event: str created_at: str - item_type: AuditItemType | Unset = UNSET - item_type_display: None | str | Unset = UNSET - object_: AuditObjectType0 | None | Unset = UNSET - object_changes: AuditObjectChangesType0 | None | Unset = UNSET - user_id: int | None | Unset = UNSET - user_name: None | str | Unset = UNSET - user_email: None | str | Unset = UNSET - ip_address: None | str | Unset = UNSET - user_agent: None | str | Unset = UNSET - request_id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - item_id: None | str | Unset = UNSET - id: int | None | Unset = UNSET + item_type: Unset | AuditItemType = UNSET + item_type_display: None | Unset | str = UNSET + object_: Union["AuditObjectType0", None, Unset] = UNSET + object_changes: Union["AuditObjectChangesType0", None, Unset] = UNSET + user_id: None | Unset | int = UNSET + user_name: None | Unset | str = UNSET + user_email: None | Unset | str = UNSET + ip_address: None | Unset | str = UNSET + user_agent: None | Unset | str = UNSET + request_id: None | Unset | str = UNSET + session_id: None | Unset | str = UNSET + item_id: None | Unset | str = UNSET + id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,17 +63,17 @@ def to_dict(self) -> dict[str, Any]: created_at = self.created_at - item_type: str | Unset = UNSET + item_type: Unset | str = UNSET if not isinstance(self.item_type, Unset): item_type = self.item_type - item_type_display: None | str | Unset + item_type_display: None | Unset | str if isinstance(self.item_type_display, Unset): item_type_display = UNSET else: item_type_display = self.item_type_display - object_: dict[str, Any] | None | Unset + object_: None | Unset | dict[str, Any] if isinstance(self.object_, Unset): object_ = UNSET elif isinstance(self.object_, AuditObjectType0): @@ -83,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: else: object_ = self.object_ - object_changes: dict[str, Any] | None | Unset + object_changes: None | Unset | dict[str, Any] if isinstance(self.object_changes, Unset): object_changes = UNSET elif isinstance(self.object_changes, AuditObjectChangesType0): @@ -91,55 +89,55 @@ def to_dict(self) -> dict[str, Any]: else: object_changes = self.object_changes - user_id: int | None | Unset + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - user_name: None | str | Unset + user_name: None | Unset | str if isinstance(self.user_name, Unset): user_name = UNSET else: user_name = self.user_name - user_email: None | str | Unset + user_email: None | Unset | str if isinstance(self.user_email, Unset): user_email = UNSET else: user_email = self.user_email - ip_address: None | str | Unset + ip_address: None | Unset | str if isinstance(self.ip_address, Unset): ip_address = UNSET else: ip_address = self.ip_address - user_agent: None | str | Unset + user_agent: None | Unset | str if isinstance(self.user_agent, Unset): user_agent = UNSET else: user_agent = self.user_agent - request_id: None | str | Unset + request_id: None | Unset | str if isinstance(self.request_id, Unset): request_id = UNSET else: request_id = self.request_id - session_id: None | str | Unset + session_id: None | Unset | str if isinstance(self.session_id, Unset): session_id = UNSET else: session_id = self.session_id - item_id: None | str | Unset + item_id: None | Unset | str if isinstance(self.item_id, Unset): item_id = UNSET else: item_id = self.item_id - id: int | None | Unset + id: None | Unset | int if isinstance(self.id, Unset): id = UNSET else: @@ -193,22 +191,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at = d.pop("created_at") _item_type = d.pop("item_type", UNSET) - item_type: AuditItemType | Unset + item_type: Unset | AuditItemType if isinstance(_item_type, Unset): item_type = UNSET else: item_type = check_audit_item_type(_item_type) - def _parse_item_type_display(data: object) -> None | str | Unset: + def _parse_item_type_display(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) item_type_display = _parse_item_type_display(d.pop("item_type_display", UNSET)) - def _parse_object_(data: object) -> AuditObjectType0 | None | Unset: + def _parse_object_(data: object) -> Union["AuditObjectType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -219,13 +217,13 @@ def _parse_object_(data: object) -> AuditObjectType0 | None | Unset: object_type_0 = AuditObjectType0.from_dict(data) return object_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AuditObjectType0 | None | Unset, data) + return cast(Union["AuditObjectType0", None, Unset], data) object_ = _parse_object_(d.pop("object", UNSET)) - def _parse_object_changes(data: object) -> AuditObjectChangesType0 | None | Unset: + def _parse_object_changes(data: object) -> Union["AuditObjectChangesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -236,90 +234,90 @@ def _parse_object_changes(data: object) -> AuditObjectChangesType0 | None | Unse object_changes_type_0 = AuditObjectChangesType0.from_dict(data) return object_changes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AuditObjectChangesType0 | None | Unset, data) + return cast(Union["AuditObjectChangesType0", None, Unset], data) object_changes = _parse_object_changes(d.pop("object_changes", UNSET)) - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_user_name(data: object) -> None | str | Unset: + def _parse_user_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_name = _parse_user_name(d.pop("user_name", UNSET)) - def _parse_user_email(data: object) -> None | str | Unset: + def _parse_user_email(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_email = _parse_user_email(d.pop("user_email", UNSET)) - def _parse_ip_address(data: object) -> None | str | Unset: + def _parse_ip_address(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ip_address = _parse_ip_address(d.pop("ip_address", UNSET)) - def _parse_user_agent(data: object) -> None | str | Unset: + def _parse_user_agent(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_agent = _parse_user_agent(d.pop("user_agent", UNSET)) - def _parse_request_id(data: object) -> None | str | Unset: + def _parse_request_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) request_id = _parse_request_id(d.pop("request_id", UNSET)) - def _parse_session_id(data: object) -> None | str | Unset: + def _parse_session_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) session_id = _parse_session_id(d.pop("session_id", UNSET)) - def _parse_item_id(data: object) -> None | str | Unset: + def _parse_item_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) item_id = _parse_item_id(d.pop("item_id", UNSET)) - def _parse_id(data: object) -> int | None | Unset: + def _parse_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) id = _parse_id(d.pop("id", UNSET)) diff --git a/rootly_sdk/models/audit_object_changes_type_0.py b/rootly_sdk/models/audit_object_changes_type_0.py index adacb420..c26c297b 100644 --- a/rootly_sdk/models/audit_object_changes_type_0.py +++ b/rootly_sdk/models/audit_object_changes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AuditObjectChangesType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/audit_object_type_0.py b/rootly_sdk/models/audit_object_type_0.py index 2a1a35a1..66c54325 100644 --- a/rootly_sdk/models/audit_object_type_0.py +++ b/rootly_sdk/models/audit_object_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AuditObjectType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/audits_list.py b/rootly_sdk/models/audits_list.py index 85729264..bd5ffb11 100644 --- a/rootly_sdk/models/audits_list.py +++ b/rootly_sdk/models/audits_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AuditsList: """ Attributes: - data (list[AuditsListDataItem]): + data (list['AuditsListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AuditsListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AuditsListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) audits_list = cls( data=data, diff --git a/rootly_sdk/models/audits_list_data_item.py b/rootly_sdk/models/audits_list_data_item.py index 4056d5dd..94b30791 100644 --- a/rootly_sdk/models/audits_list_data_item.py +++ b/rootly_sdk/models/audits_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AuditsListDataItem: id: str type_: AuditsListDataItemType - attributes: Audit + attributes: "Audit" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/authorization.py b/rootly_sdk/models/authorization.py index 62b21259..8e600ea8 100644 --- a/rootly_sdk/models/authorization.py +++ b/rootly_sdk/models/authorization.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/authorization_list.py b/rootly_sdk/models/authorization_list.py index a3e81667..fa0df65d 100644 --- a/rootly_sdk/models/authorization_list.py +++ b/rootly_sdk/models/authorization_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class AuthorizationList: """ Attributes: - data (list[AuthorizationListDataItem]): + data (list['AuthorizationListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AuthorizationListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AuthorizationListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) authorization_list = cls( data=data, diff --git a/rootly_sdk/models/authorization_list_data_item.py b/rootly_sdk/models/authorization_list_data_item.py index bbd20e83..254bb294 100644 --- a/rootly_sdk/models/authorization_list_data_item.py +++ b/rootly_sdk/models/authorization_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AuthorizationListDataItem: id: str type_: AuthorizationListDataItemType - attributes: Authorization + attributes: "Authorization" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/authorization_response.py b/rootly_sdk/models/authorization_response.py index 8ac40ff2..0141ff5a 100644 --- a/rootly_sdk/models/authorization_response.py +++ b/rootly_sdk/models/authorization_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class AuthorizationResponse: """ Attributes: data (AuthorizationResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AuthorizationResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AuthorizationResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AuthorizationResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) authorization_response = cls( data=data, diff --git a/rootly_sdk/models/authorization_response_data.py b/rootly_sdk/models/authorization_response_data.py index 16703d12..0b141026 100644 --- a/rootly_sdk/models/authorization_response_data.py +++ b/rootly_sdk/models/authorization_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AuthorizationResponseData: id: str type_: AuthorizationResponseDataType - attributes: Authorization + attributes: "Authorization" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py index ab61baa7..7180c666 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class AutoAssignRoleOpsgenieTaskParams: Attributes: incident_role_id (str): The role id schedule (AutoAssignRoleOpsgenieTaskParamsSchedule): - task_type (AutoAssignRoleOpsgenieTaskParamsTaskType | Unset): + task_type (Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType]): """ incident_role_id: str - schedule: AutoAssignRoleOpsgenieTaskParamsSchedule - task_type: AutoAssignRoleOpsgenieTaskParamsTaskType | Unset = UNSET + schedule: "AutoAssignRoleOpsgenieTaskParamsSchedule" + task_type: Unset | AutoAssignRoleOpsgenieTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_role_id = self.incident_role_id schedule = self.schedule.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = AutoAssignRoleOpsgenieTaskParamsSchedule.from_dict(d.pop("schedule")) _task_type = d.pop("task_type", UNSET) - task_type: AutoAssignRoleOpsgenieTaskParamsTaskType | Unset + task_type: Unset | AutoAssignRoleOpsgenieTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py index d9929206..f56df6a9 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AutoAssignRoleOpsgenieTaskParamsSchedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py index cd35eaf2..4b18a5dd 100644 --- a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py +++ b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AutoAssignRolePagerdutyTaskParamsType0Schedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py index 3ef911c2..31768832 100644 --- a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py +++ b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params.py b/rootly_sdk/models/auto_assign_role_rootly_task_params.py deleted file mode 100644 index 865859ae..00000000 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params.py +++ /dev/null @@ -1,190 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.auto_assign_role_rootly_task_params_task_type import ( - AutoAssignRoleRootlyTaskParamsTaskType, - check_auto_assign_role_rootly_task_params_task_type, -) -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.auto_assign_role_rootly_task_params_escalation_policy_target import ( - AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget, - ) - from ..models.auto_assign_role_rootly_task_params_group_target import AutoAssignRoleRootlyTaskParamsGroupTarget - from ..models.auto_assign_role_rootly_task_params_schedule_target import ( - AutoAssignRoleRootlyTaskParamsScheduleTarget, - ) - from ..models.auto_assign_role_rootly_task_params_service_target import AutoAssignRoleRootlyTaskParamsServiceTarget - from ..models.auto_assign_role_rootly_task_params_user_target import AutoAssignRoleRootlyTaskParamsUserTarget - - -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParams") - - -@_attrs_define -class AutoAssignRoleRootlyTaskParams: - """ - Attributes: - incident_role_id (str): The role id - task_type (AutoAssignRoleRootlyTaskParamsTaskType | Unset): - escalation_policy_target (AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget | Unset): - service_target (AutoAssignRoleRootlyTaskParamsServiceTarget | Unset): - user_target (AutoAssignRoleRootlyTaskParamsUserTarget | Unset): - group_target (AutoAssignRoleRootlyTaskParamsGroupTarget | Unset): - schedule_target (AutoAssignRoleRootlyTaskParamsScheduleTarget | Unset): - """ - - incident_role_id: str - task_type: AutoAssignRoleRootlyTaskParamsTaskType | Unset = UNSET - escalation_policy_target: AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: AutoAssignRoleRootlyTaskParamsServiceTarget | Unset = UNSET - user_target: AutoAssignRoleRootlyTaskParamsUserTarget | Unset = UNSET - group_target: AutoAssignRoleRootlyTaskParamsGroupTarget | Unset = UNSET - schedule_target: AutoAssignRoleRootlyTaskParamsScheduleTarget | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - incident_role_id = self.incident_role_id - - task_type: str | Unset = UNSET - if not isinstance(self.task_type, Unset): - task_type = self.task_type - - escalation_policy_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.escalation_policy_target, Unset): - escalation_policy_target = self.escalation_policy_target.to_dict() - - service_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.service_target, Unset): - service_target = self.service_target.to_dict() - - user_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_target, Unset): - user_target = self.user_target.to_dict() - - group_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.group_target, Unset): - group_target = self.group_target.to_dict() - - schedule_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.schedule_target, Unset): - schedule_target = self.schedule_target.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "incident_role_id": incident_role_id, - } - ) - if task_type is not UNSET: - field_dict["task_type"] = task_type - if escalation_policy_target is not UNSET: - field_dict["escalation_policy_target"] = escalation_policy_target - if service_target is not UNSET: - field_dict["service_target"] = service_target - if user_target is not UNSET: - field_dict["user_target"] = user_target - if group_target is not UNSET: - field_dict["group_target"] = group_target - if schedule_target is not UNSET: - field_dict["schedule_target"] = schedule_target - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.auto_assign_role_rootly_task_params_escalation_policy_target import ( - AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget, - ) - from ..models.auto_assign_role_rootly_task_params_group_target import AutoAssignRoleRootlyTaskParamsGroupTarget - from ..models.auto_assign_role_rootly_task_params_schedule_target import ( - AutoAssignRoleRootlyTaskParamsScheduleTarget, - ) - from ..models.auto_assign_role_rootly_task_params_service_target import ( - AutoAssignRoleRootlyTaskParamsServiceTarget, - ) - from ..models.auto_assign_role_rootly_task_params_user_target import AutoAssignRoleRootlyTaskParamsUserTarget - - d = dict(src_dict) - incident_role_id = d.pop("incident_role_id") - - _task_type = d.pop("task_type", UNSET) - task_type: AutoAssignRoleRootlyTaskParamsTaskType | Unset - if isinstance(_task_type, Unset): - task_type = UNSET - else: - task_type = check_auto_assign_role_rootly_task_params_task_type(_task_type) - - _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget | Unset - if isinstance(_escalation_policy_target, Unset): - escalation_policy_target = UNSET - else: - escalation_policy_target = AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget.from_dict( - _escalation_policy_target - ) - - _service_target = d.pop("service_target", UNSET) - service_target: AutoAssignRoleRootlyTaskParamsServiceTarget | Unset - if isinstance(_service_target, Unset): - service_target = UNSET - else: - service_target = AutoAssignRoleRootlyTaskParamsServiceTarget.from_dict(_service_target) - - _user_target = d.pop("user_target", UNSET) - user_target: AutoAssignRoleRootlyTaskParamsUserTarget | Unset - if isinstance(_user_target, Unset): - user_target = UNSET - else: - user_target = AutoAssignRoleRootlyTaskParamsUserTarget.from_dict(_user_target) - - _group_target = d.pop("group_target", UNSET) - group_target: AutoAssignRoleRootlyTaskParamsGroupTarget | Unset - if isinstance(_group_target, Unset): - group_target = UNSET - else: - group_target = AutoAssignRoleRootlyTaskParamsGroupTarget.from_dict(_group_target) - - _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: AutoAssignRoleRootlyTaskParamsScheduleTarget | Unset - if isinstance(_schedule_target, Unset): - schedule_target = UNSET - else: - schedule_target = AutoAssignRoleRootlyTaskParamsScheduleTarget.from_dict(_schedule_target) - - auto_assign_role_rootly_task_params = cls( - incident_role_id=incident_role_id, - task_type=task_type, - escalation_policy_target=escalation_policy_target, - service_target=service_target, - user_target=user_target, - group_target=group_target, - schedule_target=schedule_target, - ) - - auto_assign_role_rootly_task_params.additional_properties = d - return auto_assign_role_rootly_task_params - - @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/rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py deleted file mode 100644 index 5c0e317f..00000000 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -AutoAssignRoleRootlyTaskParamsTaskType = Literal["auto_assign_role_rootly"] - -AUTO_ASSIGN_ROLE_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES: set[AutoAssignRoleRootlyTaskParamsTaskType] = { - "auto_assign_role_rootly", -} - - -def check_auto_assign_role_rootly_task_params_task_type( - value: str | None, -) -> AutoAssignRoleRootlyTaskParamsTaskType | None: - if value is None: - return None - if value in AUTO_ASSIGN_ROLE_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AutoAssignRoleRootlyTaskParamsTaskType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {AUTO_ASSIGN_ROLE_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py similarity index 72% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_escalation_policy_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py index 4f2dc0fb..04e6e1a3 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -8,19 +6,19 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget: +class AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_escalation_policy_target = cls( + auto_assign_role_rootly_task_params_type_0_escalation_policy_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_escalation_policy_target.additional_properties = d - return auto_assign_role_rootly_task_params_escalation_policy_target + auto_assign_role_rootly_task_params_type_0_escalation_policy_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_0_escalation_policy_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_schedule_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py similarity index 74% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_schedule_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py index 1f6e3338..04743c81 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -8,19 +6,19 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsScheduleTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType1ServiceTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsScheduleTarget: +class AutoAssignRoleRootlyTaskParamsType1ServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_schedule_target = cls( + auto_assign_role_rootly_task_params_type_1_service_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_schedule_target.additional_properties = d - return auto_assign_role_rootly_task_params_schedule_target + auto_assign_role_rootly_task_params_type_1_service_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_1_service_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_group_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py similarity index 74% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_group_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py index f8147e20..66331d25 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_group_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -8,19 +6,19 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsGroupTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType2UserTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsGroupTarget: +class AutoAssignRoleRootlyTaskParamsType2UserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_group_target = cls( + auto_assign_role_rootly_task_params_type_2_user_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_group_target.additional_properties = d - return auto_assign_role_rootly_task_params_group_target + auto_assign_role_rootly_task_params_type_2_user_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_2_user_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_service_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py similarity index 74% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_service_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py index e8908713..9e506c67 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_service_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -8,19 +6,19 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsServiceTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType3GroupTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsServiceTarget: +class AutoAssignRoleRootlyTaskParamsType3GroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_service_target = cls( + auto_assign_role_rootly_task_params_type_3_group_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_service_target.additional_properties = d - return auto_assign_role_rootly_task_params_service_target + auto_assign_role_rootly_task_params_type_3_group_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_3_group_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py new file mode 100644 index 00000000..8d1f180b --- /dev/null +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType4ScheduleTarget") + + +@_attrs_define +class AutoAssignRoleRootlyTaskParamsType4ScheduleTarget: + """ + Attributes: + id (Union[Unset, str]): + name (Union[Unset, str]): + """ + + id: Unset | str = UNSET + name: Unset | str = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + 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) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + auto_assign_role_rootly_task_params_type_4_schedule_target = cls( + id=id, + name=name, + ) + + auto_assign_role_rootly_task_params_type_4_schedule_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_4_schedule_target + + @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/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py index 74213134..6071ebbb 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class AutoAssignRoleVictorOpsTaskParams: Attributes: incident_role_id (str): The role id team (AutoAssignRoleVictorOpsTaskParamsTeam): - task_type (AutoAssignRoleVictorOpsTaskParamsTaskType | Unset): + task_type (Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType]): """ incident_role_id: str - team: AutoAssignRoleVictorOpsTaskParamsTeam - task_type: AutoAssignRoleVictorOpsTaskParamsTaskType | Unset = UNSET + team: "AutoAssignRoleVictorOpsTaskParamsTeam" + task_type: Unset | AutoAssignRoleVictorOpsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_role_id = self.incident_role_id team = self.team.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = AutoAssignRoleVictorOpsTaskParamsTeam.from_dict(d.pop("team")) _task_type = d.pop("task_type", UNSET) - task_type: AutoAssignRoleVictorOpsTaskParamsTaskType | Unset + task_type: Unset | AutoAssignRoleVictorOpsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py index aca48451..c4a051fe 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class AutoAssignRoleVictorOpsTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py index e78840fa..f2809ade 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyCatalogEntitiesResponse: """ Attributes: - data (BulkDestroyCatalogEntitiesResponseData | Unset): + data (Union[Unset, BulkDestroyCatalogEntitiesResponseData]): """ - data: BulkDestroyCatalogEntitiesResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyCatalogEntitiesResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyCatalogEntitiesResponseData | Unset + data: Unset | BulkDestroyCatalogEntitiesResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py index 100418a0..485f2e1c 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,28 +13,28 @@ class BulkDestroyCatalogEntitiesResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py b/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py index aa0318b3..c480370e 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py index 82423407..2c7aee2f 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,16 +18,16 @@ class BulkDestroyCatalogEntitiesType1: Attributes: managed_by (BulkDestroyCatalogEntitiesType1ManagedBy): Delete all entities with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Entities with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Entities with these external_ids are preserved. """ managed_by: BulkDestroyCatalogEntitiesType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_environments_response.py b/rootly_sdk/models/bulk_destroy_environments_response.py index b10deeef..44391875 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response.py +++ b/rootly_sdk/models/bulk_destroy_environments_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyEnvironmentsResponse: """ Attributes: - data (BulkDestroyEnvironmentsResponseData | Unset): + data (Union[Unset, BulkDestroyEnvironmentsResponseData]): """ - data: BulkDestroyEnvironmentsResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyEnvironmentsResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyEnvironmentsResponseData | Unset + data: Unset | BulkDestroyEnvironmentsResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_environments_response_data.py b/rootly_sdk/models/bulk_destroy_environments_response_data.py index 64ba34fd..35713f90 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response_data.py +++ b/rootly_sdk/models/bulk_destroy_environments_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,28 +13,28 @@ class BulkDestroyEnvironmentsResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_environments_type_0.py b/rootly_sdk/models/bulk_destroy_environments_type_0.py index f214081d..a7abe6a2 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_0.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_environments_type_1.py b/rootly_sdk/models/bulk_destroy_environments_type_1.py index ce96f4b6..20b4d2bc 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_1.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,16 +18,16 @@ class BulkDestroyEnvironmentsType1: Attributes: managed_by (BulkDestroyEnvironmentsType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyEnvironmentsType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response.py b/rootly_sdk/models/bulk_destroy_functionalities_response.py index 07bfc6d7..305b6c0c 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyFunctionalitiesResponse: """ Attributes: - data (BulkDestroyFunctionalitiesResponseData | Unset): + data (Union[Unset, BulkDestroyFunctionalitiesResponseData]): """ - data: BulkDestroyFunctionalitiesResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyFunctionalitiesResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyFunctionalitiesResponseData | Unset + data: Unset | BulkDestroyFunctionalitiesResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py index 09696126..983b7e64 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,28 +13,28 @@ class BulkDestroyFunctionalitiesResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_functionalities_type_0.py b/rootly_sdk/models/bulk_destroy_functionalities_type_0.py index 3d848f82..c7275e20 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_0.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py index f26f768a..e68f7239 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,16 +18,16 @@ class BulkDestroyFunctionalitiesType1: Attributes: managed_by (BulkDestroyFunctionalitiesType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyFunctionalitiesType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_services_response.py b/rootly_sdk/models/bulk_destroy_services_response.py index 74550d05..af591752 100644 --- a/rootly_sdk/models/bulk_destroy_services_response.py +++ b/rootly_sdk/models/bulk_destroy_services_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyServicesResponse: """ Attributes: - data (BulkDestroyServicesResponseData | Unset): + data (Union[Unset, BulkDestroyServicesResponseData]): """ - data: BulkDestroyServicesResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyServicesResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyServicesResponseData | Unset + data: Unset | BulkDestroyServicesResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_services_response_data.py b/rootly_sdk/models/bulk_destroy_services_response_data.py index f1a02711..d5cf813f 100644 --- a/rootly_sdk/models/bulk_destroy_services_response_data.py +++ b/rootly_sdk/models/bulk_destroy_services_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,28 +13,28 @@ class BulkDestroyServicesResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_services_type_0.py b/rootly_sdk/models/bulk_destroy_services_type_0.py index 1c0b2be3..ab09b1c8 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_0.py +++ b/rootly_sdk/models/bulk_destroy_services_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_services_type_1.py b/rootly_sdk/models/bulk_destroy_services_type_1.py index 30af9e88..7a8c0fc9 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_1.py +++ b/rootly_sdk/models/bulk_destroy_services_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,16 +18,16 @@ class BulkDestroyServicesType1: Attributes: managed_by (BulkDestroyServicesType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyServicesType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_teams_response.py b/rootly_sdk/models/bulk_destroy_teams_response.py index d84b0f6d..70a1bda4 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response.py +++ b/rootly_sdk/models/bulk_destroy_teams_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyTeamsResponse: """ Attributes: - data (BulkDestroyTeamsResponseData | Unset): + data (Union[Unset, BulkDestroyTeamsResponseData]): """ - data: BulkDestroyTeamsResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyTeamsResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyTeamsResponseData | Unset + data: Unset | BulkDestroyTeamsResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_teams_response_data.py b/rootly_sdk/models/bulk_destroy_teams_response_data.py index c4e2e3fc..619fd269 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response_data.py +++ b/rootly_sdk/models/bulk_destroy_teams_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,28 +13,28 @@ class BulkDestroyTeamsResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_teams_type_0.py b/rootly_sdk/models/bulk_destroy_teams_type_0.py index 3e2eb0d5..f88ab8c8 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_0.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_teams_type_1.py b/rootly_sdk/models/bulk_destroy_teams_type_1.py index 881d654b..4063f4b2 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_1.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,16 +18,16 @@ class BulkDestroyTeamsType1: Attributes: managed_by (BulkDestroyTeamsType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyTeamsType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities.py b/rootly_sdk/models/bulk_upsert_catalog_entities.py index d6d87d56..316e8eda 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertCatalogEntities: """ Attributes: - entities (list[BulkUpsertCatalogEntitiesEntitiesItem]): Array of catalog entities to upsert. Each must have an + entities (list['BulkUpsertCatalogEntitiesEntitiesItem']): Array of catalog entities to upsert. Each must have an external_id. Max 100 per request. external_ids must be unique within a batch. """ - entities: list[BulkUpsertCatalogEntitiesEntitiesItem] + entities: list["BulkUpsertCatalogEntitiesEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py index 941d1738..4e8ecc10 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,40 +20,47 @@ class BulkUpsertCatalogEntitiesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Must be unique within the catalog. - name (str | Unset): Required for new entities. Optional for updates (managed-fields: omitted attributes are - preserved). - description (None | str | Unset): - backstage_id (None | str | Unset): - fields (list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset): Property values for this entity. Only - mentioned fields are written; unmentioned fields are preserved. + name (Union[Unset, str]): Required for new entities. Optional for updates (managed-fields: omitted attributes + are preserved). + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + fields (Union[Unset, list['BulkUpsertCatalogEntitiesEntitiesItemFieldsItem']]): Property values for this entity. + Only mentioned fields are written; unmentioned fields are preserved. """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - fields: list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + fields: Unset | list["BulkUpsertCatalogEntitiesEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - backstage_id: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - fields: list[dict[str, Any]] | Unset = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -73,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if backstage_id is not UNSET: field_dict["backstage_id"] = backstage_id if fields is not UNSET: @@ -91,37 +98,45 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertCatalogEntitiesEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertCatalogEntitiesEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_catalog_entities_entities_item = cls( external_id=external_id, name=name, description=description, + public_description=public_description, backstage_id=backstage_id, fields=fields, ) diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py index 4ee249c4..98503dc3 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +15,14 @@ class BulkUpsertCatalogEntitiesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_error.py b/rootly_sdk/models/bulk_upsert_catalog_entities_error.py index ef8ea3cd..e7351d05 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_error.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertCatalogEntitiesError: """ Attributes: - errors (list[BulkUpsertCatalogEntitiesErrorErrorsItem]): + errors (list['BulkUpsertCatalogEntitiesErrorErrorsItem']): """ - errors: list[BulkUpsertCatalogEntitiesErrorErrorsItem] + errors: list["BulkUpsertCatalogEntitiesErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py index 996410a2..4b7c5c28 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py index 41ada9ec..3d5f864c 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,15 +17,14 @@ class BulkUpsertCatalogEntitiesResponse: """ Attributes: - data (list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertCatalogEntitiesResponseDataItem']]): """ - data: list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset = UNSET + data: Unset | list["BulkUpsertCatalogEntitiesResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_catalog_entities_response_data_item import BulkUpsertCatalogEntitiesResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertCatalogEntitiesResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertCatalogEntitiesResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_catalog_entities_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py index 17df9577..92739697 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertCatalogEntitiesResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertCatalogEntitiesResponseDataItemType | Unset): - attributes (CatalogEntity | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType]): + attributes (Union[Unset, CatalogEntity]): """ - id: str | Unset = UNSET - type_: BulkUpsertCatalogEntitiesResponseDataItemType | Unset = UNSET - attributes: CatalogEntity | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertCatalogEntitiesResponseDataItemType = UNSET + attributes: Union[Unset, "CatalogEntity"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertCatalogEntitiesResponseDataItemType | Unset + type_: Unset | BulkUpsertCatalogEntitiesResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_catalog_entities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CatalogEntity | Unset + attributes: Unset | CatalogEntity if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_environments.py b/rootly_sdk/models/bulk_upsert_environments.py index 8b79a7f4..92088a23 100644 --- a/rootly_sdk/models/bulk_upsert_environments.py +++ b/rootly_sdk/models/bulk_upsert_environments.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertEnvironments: """ Attributes: - entities (list[BulkUpsertEnvironmentsEntitiesItem]): Environments to upsert, matched by external_id. Max 100 per - request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). + entities (list['BulkUpsertEnvironmentsEntitiesItem']): Environments to upsert, matched by external_id. Max 100 + per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertEnvironmentsEntitiesItem] + entities: list["BulkUpsertEnvironmentsEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item.py index fc203929..255726bb 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,49 +18,56 @@ class BulkUpsertEnvironmentsEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - notify_emails (list[str] | None | Unset): - fields (list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: - only mentioned fields written). + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + notify_emails (Union[None, Unset, list[str]]): + fields (Union[Unset, list['BulkUpsertEnvironmentsEntitiesItemFieldsItem']]): Catalog property values (merge + semantics: only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - fields: list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + fields: Unset | list["BulkUpsertEnvironmentsEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -71,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - fields: list[dict[str, Any]] | Unset = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -89,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -111,34 +118,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -149,25 +165,24 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertEnvironmentsEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertEnvironmentsEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_environments_entities_item = cls( external_id=external_id, name=name, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py index a2fb5f0b..78b617b9 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +15,14 @@ class BulkUpsertEnvironmentsEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_environments_error.py b/rootly_sdk/models/bulk_upsert_environments_error.py index 38e7490e..638ed9a8 100644 --- a/rootly_sdk/models/bulk_upsert_environments_error.py +++ b/rootly_sdk/models/bulk_upsert_environments_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertEnvironmentsError: """ Attributes: - errors (list[BulkUpsertEnvironmentsErrorErrorsItem]): + errors (list['BulkUpsertEnvironmentsErrorErrorsItem']): """ - errors: list[BulkUpsertEnvironmentsErrorErrorsItem] + errors: list["BulkUpsertEnvironmentsErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py b/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py index 39c9c7b2..073c968e 100644 --- a/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_environments_response.py b/rootly_sdk/models/bulk_upsert_environments_response.py index 3e7032dc..72890e00 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response.py +++ b/rootly_sdk/models/bulk_upsert_environments_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,15 +17,14 @@ class BulkUpsertEnvironmentsResponse: """ Attributes: - data (list[BulkUpsertEnvironmentsResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertEnvironmentsResponseDataItem']]): """ - data: list[BulkUpsertEnvironmentsResponseDataItem] | Unset = UNSET + data: Unset | list["BulkUpsertEnvironmentsResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_environments_response_data_item import BulkUpsertEnvironmentsResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertEnvironmentsResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertEnvironmentsResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertEnvironmentsResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_environments_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py index 57f2a594..fd861d60 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertEnvironmentsResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertEnvironmentsResponseDataItemType | Unset): - attributes (Environment | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertEnvironmentsResponseDataItemType]): + attributes (Union[Unset, Environment]): """ - id: str | Unset = UNSET - type_: BulkUpsertEnvironmentsResponseDataItemType | Unset = UNSET - attributes: Environment | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertEnvironmentsResponseDataItemType = UNSET + attributes: Union[Unset, "Environment"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertEnvironmentsResponseDataItemType | Unset + type_: Unset | BulkUpsertEnvironmentsResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_environments_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Environment | Unset + attributes: Unset | Environment if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_functionalities.py b/rootly_sdk/models/bulk_upsert_functionalities.py index 31332a66..256663a4 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities.py +++ b/rootly_sdk/models/bulk_upsert_functionalities.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,16 +15,15 @@ class BulkUpsertFunctionalities: """ Attributes: - entities (list[BulkUpsertFunctionalitiesEntitiesItem]): Functionalities to upsert, matched by external_id. Max + entities (list['BulkUpsertFunctionalitiesEntitiesItem']): Functionalities to upsert, matched by external_id. Max 100 per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertFunctionalitiesEntitiesItem] + entities: list["BulkUpsertFunctionalitiesEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py index e0dc2dec..b5c14786 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,87 +20,86 @@ class BulkUpsertFunctionalitiesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - public_description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - show_uptime (bool | None | Unset): - show_uptime_last_days (int | None | Unset): - notify_emails (list[str] | None | Unset): - pagerduty_id (None | str | Unset): - opsgenie_id (None | str | Unset): - opsgenie_team_id (None | str | Unset): - backstage_id (None | str | Unset): - cortex_id (None | str | Unset): - opslevel_id (None | str | Unset): - service_now_ci_sys_id (None | str | Unset): - fields (list[BulkUpsertFunctionalitiesEntitiesItemFieldsItem] | Unset): Catalog property values (merge + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + show_uptime (Union[None, Unset, bool]): + show_uptime_last_days (Union[None, Unset, int]): + notify_emails (Union[None, Unset, list[str]]): + pagerduty_id (Union[None, Unset, str]): + opsgenie_id (Union[None, Unset, str]): + opsgenie_team_id (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + cortex_id (Union[None, Unset, str]): + opslevel_id (Union[None, Unset, str]): + service_now_ci_sys_id (Union[None, Unset, str]): + fields (Union[Unset, list['BulkUpsertFunctionalitiesEntitiesItemFieldsItem']]): Catalog property values (merge semantics: only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - opslevel_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - fields: list[BulkUpsertFunctionalitiesEntitiesItemFieldsItem] | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + opslevel_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + fields: Unset | list["BulkUpsertFunctionalitiesEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | None | Unset + show_uptime_last_days: None | Unset | int if isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = self.show_uptime_last_days - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -111,49 +108,49 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | str | Unset + opslevel_id: None | Unset | str if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - fields: list[dict[str, Any]] | Unset = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -213,61 +210,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> int | None | Unset: + def _parse_show_uptime_last_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -278,83 +275,81 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | str | Unset: + def _parse_opslevel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertFunctionalitiesEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertFunctionalitiesEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertFunctionalitiesEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_functionalities_entities_item = cls( external_id=external_id, diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py index f56126ce..a55c96c3 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +15,14 @@ class BulkUpsertFunctionalitiesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_error.py b/rootly_sdk/models/bulk_upsert_functionalities_error.py index 2c93c715..ae9f29c3 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_error.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertFunctionalitiesError: """ Attributes: - errors (list[BulkUpsertFunctionalitiesErrorErrorsItem]): + errors (list['BulkUpsertFunctionalitiesErrorErrorsItem']): """ - errors: list[BulkUpsertFunctionalitiesErrorErrorsItem] + errors: list["BulkUpsertFunctionalitiesErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py b/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py index 8ae7ae2e..10981217 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response.py b/rootly_sdk/models/bulk_upsert_functionalities_response.py index 1318338b..e042eeba 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,15 +17,14 @@ class BulkUpsertFunctionalitiesResponse: """ Attributes: - data (list[BulkUpsertFunctionalitiesResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertFunctionalitiesResponseDataItem']]): """ - data: list[BulkUpsertFunctionalitiesResponseDataItem] | Unset = UNSET + data: Unset | list["BulkUpsertFunctionalitiesResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_functionalities_response_data_item import BulkUpsertFunctionalitiesResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertFunctionalitiesResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertFunctionalitiesResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertFunctionalitiesResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_functionalities_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py index a96ca1af..d12b3435 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertFunctionalitiesResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertFunctionalitiesResponseDataItemType | Unset): - attributes (Functionality | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType]): + attributes (Union[Unset, Functionality]): """ - id: str | Unset = UNSET - type_: BulkUpsertFunctionalitiesResponseDataItemType | Unset = UNSET - attributes: Functionality | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertFunctionalitiesResponseDataItemType = UNSET + attributes: Union[Unset, "Functionality"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertFunctionalitiesResponseDataItemType | Unset + type_: Unset | BulkUpsertFunctionalitiesResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_functionalities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Functionality | Unset + attributes: Unset | Functionality if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_services.py b/rootly_sdk/models/bulk_upsert_services.py index e027c8be..7efff1ad 100644 --- a/rootly_sdk/models/bulk_upsert_services.py +++ b/rootly_sdk/models/bulk_upsert_services.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertServices: """ Attributes: - entities (list[BulkUpsertServicesEntitiesItem]): Services to upsert, matched by external_id. Max 100 per + entities (list['BulkUpsertServicesEntitiesItem']): Services to upsert, matched by external_id. Max 100 per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertServicesEntitiesItem] + entities: list["BulkUpsertServicesEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item.py index 9c8d36e8..c04617a9 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,171 +18,170 @@ class BulkUpsertServicesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - public_description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - show_uptime (bool | None | Unset): - show_uptime_last_days (int | None | Unset): - github_repository_name (None | str | Unset): - github_repository_branch (None | str | Unset): - gitlab_repository_name (None | str | Unset): - gitlab_repository_branch (None | str | Unset): - kubernetes_deployment_name (None | str | Unset): - pagerduty_id (None | str | Unset): - opsgenie_id (None | str | Unset): - opsgenie_team_id (None | str | Unset): - cortex_id (None | str | Unset): - opslevel_id (None | str | Unset): - backstage_id (None | str | Unset): - service_now_ci_sys_id (None | str | Unset): - notify_emails (list[str] | None | Unset): - alerts_email_enabled (bool | None | Unset): - fields (list[BulkUpsertServicesEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: only - mentioned fields written). + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + show_uptime (Union[None, Unset, bool]): + show_uptime_last_days (Union[None, Unset, int]): + github_repository_name (Union[None, Unset, str]): + github_repository_branch (Union[None, Unset, str]): + gitlab_repository_name (Union[None, Unset, str]): + gitlab_repository_branch (Union[None, Unset, str]): + kubernetes_deployment_name (Union[None, Unset, str]): + pagerduty_id (Union[None, Unset, str]): + opsgenie_id (Union[None, Unset, str]): + opsgenie_team_id (Union[None, Unset, str]): + cortex_id (Union[None, Unset, str]): + opslevel_id (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + service_now_ci_sys_id (Union[None, Unset, str]): + notify_emails (Union[None, Unset, list[str]]): + alerts_email_enabled (Union[None, Unset, bool]): + fields (Union[Unset, list['BulkUpsertServicesEntitiesItemFieldsItem']]): Catalog property values (merge + semantics: only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: int | None | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - opslevel_id: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - fields: list[BulkUpsertServicesEntitiesItemFieldsItem] | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: None | Unset | int = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + opslevel_id: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + fields: Unset | list["BulkUpsertServicesEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | None | Unset + show_uptime_last_days: None | Unset | int if isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = self.show_uptime_last_days - github_repository_name: None | str | Unset + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | str | Unset + opslevel_id: None | Unset | str if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -193,13 +190,13 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: list[dict[str, Any]] | Unset = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -269,169 +266,169 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> int | None | Unset: + def _parse_show_uptime_last_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | str | Unset: + def _parse_opslevel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -442,29 +439,27 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertServicesEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertServicesEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertServicesEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_services_entities_item = cls( external_id=external_id, diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py index 1c8f31dc..4b873417 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +15,14 @@ class BulkUpsertServicesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_services_error.py b/rootly_sdk/models/bulk_upsert_services_error.py index 2c96bf7d..36ae7c13 100644 --- a/rootly_sdk/models/bulk_upsert_services_error.py +++ b/rootly_sdk/models/bulk_upsert_services_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertServicesError: """ Attributes: - errors (list[BulkUpsertServicesErrorErrorsItem]): + errors (list['BulkUpsertServicesErrorErrorsItem']): """ - errors: list[BulkUpsertServicesErrorErrorsItem] + errors: list["BulkUpsertServicesErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_services_error_errors_item.py b/rootly_sdk/models/bulk_upsert_services_error_errors_item.py index 8fb6bac4..51a76f78 100644 --- a/rootly_sdk/models/bulk_upsert_services_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_services_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_services_response.py b/rootly_sdk/models/bulk_upsert_services_response.py index 60959ba7..1fee4353 100644 --- a/rootly_sdk/models/bulk_upsert_services_response.py +++ b/rootly_sdk/models/bulk_upsert_services_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,15 +17,14 @@ class BulkUpsertServicesResponse: """ Attributes: - data (list[BulkUpsertServicesResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertServicesResponseDataItem']]): """ - data: list[BulkUpsertServicesResponseDataItem] | Unset = UNSET + data: Unset | list["BulkUpsertServicesResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_services_response_data_item import BulkUpsertServicesResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertServicesResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertServicesResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertServicesResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_services_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_services_response_data_item.py b/rootly_sdk/models/bulk_upsert_services_response_data_item.py index a57b5d08..622e2f0f 100644 --- a/rootly_sdk/models/bulk_upsert_services_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_services_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertServicesResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertServicesResponseDataItemType | Unset): - attributes (Service | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertServicesResponseDataItemType]): + attributes (Union[Unset, Service]): """ - id: str | Unset = UNSET - type_: BulkUpsertServicesResponseDataItemType | Unset = UNSET - attributes: Service | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertServicesResponseDataItemType = UNSET + attributes: Union[Unset, "Service"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertServicesResponseDataItemType | Unset + type_: Unset | BulkUpsertServicesResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_services_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Service | Unset + attributes: Unset | Service if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_teams.py b/rootly_sdk/models/bulk_upsert_teams.py index 8495037f..ba93015c 100644 --- a/rootly_sdk/models/bulk_upsert_teams.py +++ b/rootly_sdk/models/bulk_upsert_teams.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertTeams: """ Attributes: - entities (list[BulkUpsertTeamsEntitiesItem]): Teams to upsert, matched by external_id. Max 100 per request; + entities (list['BulkUpsertTeamsEntitiesItem']): Teams to upsert, matched by external_id. Max 100 per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertTeamsEntitiesItem] + entities: list["BulkUpsertTeamsEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item.py index 2f881903..33868db8 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,69 +18,76 @@ class BulkUpsertTeamsEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - notify_emails (list[str] | None | Unset): - pagerduty_id (None | str | Unset): - pagerduty_service_id (None | str | Unset): - opsgenie_id (None | str | Unset): - victor_ops_id (None | str | Unset): - pagertree_id (None | str | Unset): - backstage_id (None | str | Unset): - cortex_id (None | str | Unset): - opslevel_id (None | str | Unset): - service_now_ci_sys_id (None | str | Unset): - alerts_email_enabled (bool | None | Unset): - fields (list[BulkUpsertTeamsEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: only - mentioned fields written). + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + notify_emails (Union[None, Unset, list[str]]): + pagerduty_id (Union[None, Unset, str]): + pagerduty_service_id (Union[None, Unset, str]): + opsgenie_id (Union[None, Unset, str]): + victor_ops_id (Union[None, Unset, str]): + pagertree_id (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + cortex_id (Union[None, Unset, str]): + opslevel_id (Union[None, Unset, str]): + service_now_ci_sys_id (Union[None, Unset, str]): + alerts_email_enabled (Union[None, Unset, bool]): + fields (Union[Unset, list['BulkUpsertTeamsEntitiesItemFieldsItem']]): Catalog property values (merge semantics: + only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - opslevel_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - fields: list[BulkUpsertTeamsEntitiesItemFieldsItem] | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + opslevel_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + fields: Unset | list["BulkUpsertTeamsEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -91,67 +96,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | str | Unset + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | str | Unset + opslevel_id: None | Unset | str if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: list[dict[str, Any]] | Unset = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -169,6 +174,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -209,34 +216,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -247,115 +263,114 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | str | Unset: + def _parse_opslevel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertTeamsEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertTeamsEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertTeamsEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_teams_entities_item = cls( external_id=external_id, name=name, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py index 72057a8f..8d2ce3d1 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +15,14 @@ class BulkUpsertTeamsEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_teams_error.py b/rootly_sdk/models/bulk_upsert_teams_error.py index 1c23d188..220ce856 100644 --- a/rootly_sdk/models/bulk_upsert_teams_error.py +++ b/rootly_sdk/models/bulk_upsert_teams_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertTeamsError: """ Attributes: - errors (list[BulkUpsertTeamsErrorErrorsItem]): + errors (list['BulkUpsertTeamsErrorErrorsItem']): """ - errors: list[BulkUpsertTeamsErrorErrorsItem] + errors: list["BulkUpsertTeamsErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py b/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py index bb7cffdc..76cc68ba 100644 --- a/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_teams_response.py b/rootly_sdk/models/bulk_upsert_teams_response.py index 6080b412..c4644149 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response.py +++ b/rootly_sdk/models/bulk_upsert_teams_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,15 +17,14 @@ class BulkUpsertTeamsResponse: """ Attributes: - data (list[BulkUpsertTeamsResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertTeamsResponseDataItem']]): """ - data: list[BulkUpsertTeamsResponseDataItem] | Unset = UNSET + data: Unset | list["BulkUpsertTeamsResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_teams_response_data_item import BulkUpsertTeamsResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertTeamsResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertTeamsResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertTeamsResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_teams_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py index 16ccb481..9bdacaaf 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertTeamsResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertTeamsResponseDataItemType | Unset): - attributes (Team | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertTeamsResponseDataItemType]): + attributes (Union[Unset, Team]): """ - id: str | Unset = UNSET - type_: BulkUpsertTeamsResponseDataItemType | Unset = UNSET - attributes: Team | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertTeamsResponseDataItemType = UNSET + attributes: Union[Unset, "Team"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertTeamsResponseDataItemType | Unset + type_: Unset | BulkUpsertTeamsResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_teams_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Team | Unset + attributes: Unset | Team if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/call_people_task_params.py b/rootly_sdk/models/call_people_task_params.py index c5cebec4..796d763c 100644 --- a/rootly_sdk/models/call_people_task_params.py +++ b/rootly_sdk/models/call_people_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,13 +20,13 @@ class CallPeopleTaskParams: phone_numbers (list[str]): name (str): The name content (str): The message to be read by text-to-voice - task_type (CallPeopleTaskParamsTaskType | Unset): + task_type (Union[Unset, CallPeopleTaskParamsTaskType]): """ phone_numbers: list[str] name: str content: str - task_type: CallPeopleTaskParamsTaskType | Unset = UNSET + task_type: Unset | CallPeopleTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: CallPeopleTaskParamsTaskType | Unset + task_type: Unset | CallPeopleTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/cancel_incident.py b/rootly_sdk/models/cancel_incident.py index d8a65df4..452891a0 100644 --- a/rootly_sdk/models/cancel_incident.py +++ b/rootly_sdk/models/cancel_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class CancelIncident: data (CancelIncidentData): """ - data: CancelIncidentData + data: "CancelIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/cancel_incident_data.py b/rootly_sdk/models/cancel_incident_data.py index 3e06852a..f93f0b30 100644 --- a/rootly_sdk/models/cancel_incident_data.py +++ b/rootly_sdk/models/cancel_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class CancelIncidentData: """ type_: CancelIncidentDataType - attributes: CancelIncidentDataAttributes + attributes: "CancelIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/cancel_incident_data_attributes.py b/rootly_sdk/models/cancel_incident_data_attributes.py index c3362192..6586a808 100644 --- a/rootly_sdk/models/cancel_incident_data_attributes.py +++ b/rootly_sdk/models/cancel_incident_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,13 +12,13 @@ class CancelIncidentDataAttributes: """ Attributes: - cancellation_message (None | str | Unset): Why was the incident cancelled? + cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? """ - cancellation_message: None | str | Unset = UNSET + cancellation_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - cancellation_message: None | str | Unset + cancellation_message: None | Unset | str if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -38,12 +36,12 @@ 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_cancellation_message(data: object) -> None | str | Unset: + def _parse_cancellation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/catalog.py b/rootly_sdk/models/catalog.py index 97470165..45896f39 100644 --- a/rootly_sdk/models/catalog.py +++ b/rootly_sdk/models/catalog.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,22 +17,24 @@ class Catalog: Attributes: name (str): icon (CatalogIcon): - position (int | None): Default position of the catalog when displayed in a list. + position (Union[None, int]): Default position of the catalog when displayed in a list. created_at (str): updated_at (str): - description (None | str | Unset): - external_id (None | str | Unset): An external identifier for this catalog. Must be unique within the team. - managed_by (CatalogManagedBy | Unset): Which source manages this resource (read-only). + slug (Union[Unset, str]): The slug of the catalog. Derived from `name`. + description (Union[None, Unset, str]): + external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. + managed_by (Union[Unset, CatalogManagedBy]): Which source manages this resource (read-only). """ name: str icon: CatalogIcon - position: int | None + position: None | int created_at: str updated_at: str - description: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogManagedBy | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogManagedBy = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,26 +42,28 @@ def to_dict(self) -> dict[str, Any]: icon: str = self.icon - position: int | None + position: None | int position = self.position created_at = self.created_at updated_at = self.updated_at - description: None | str | Unset + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -76,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: "updated_at": updated_at, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if external_id is not UNSET: @@ -92,10 +96,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: icon = check_catalog_icon(d.pop("icon")) - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -103,26 +107,28 @@ def _parse_position(data: object) -> int | None: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + slug = d.pop("slug", UNSET) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogManagedBy | Unset + managed_by: Unset | CatalogManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: @@ -134,6 +140,7 @@ def _parse_external_id(data: object) -> None | str | Unset: position=position, created_at=created_at, updated_at=updated_at, + slug=slug, description=description, external_id=external_id, managed_by=managed_by, diff --git a/rootly_sdk/models/catalog_checklist_template.py b/rootly_sdk/models/catalog_checklist_template.py index 44046997..a9ae621d 100644 --- a/rootly_sdk/models/catalog_checklist_template.py +++ b/rootly_sdk/models/catalog_checklist_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,10 +32,10 @@ class CatalogChecklistTemplate: scope_id (str): The scope ID created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the checklist template - description (None | str | Unset): The description of the checklist template - fields (list[CatalogChecklistTemplateFieldsType0Item] | None | Unset): Template fields in position order - owners (list[CatalogChecklistTemplateOwnersType0Item] | None | Unset): Template owners + slug (Union[Unset, str]): The slug of the checklist template + description (Union[None, Unset, str]): The description of the checklist template + fields (Union[None, Unset, list['CatalogChecklistTemplateFieldsType0Item']]): Template fields in position order + owners (Union[None, Unset, list['CatalogChecklistTemplateOwnersType0Item']]): Template owners """ name: str @@ -46,14 +44,13 @@ class CatalogChecklistTemplate: scope_id: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - fields: list[CatalogChecklistTemplateFieldsType0Item] | None | Unset = UNSET - owners: list[CatalogChecklistTemplateOwnersType0Item] | None | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + fields: None | Unset | list["CatalogChecklistTemplateFieldsType0Item"] = UNSET + owners: None | Unset | list["CatalogChecklistTemplateOwnersType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name catalog_type: str = self.catalog_type @@ -68,13 +65,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: list[dict[str, Any]] | None | Unset + fields: None | Unset | list[dict[str, Any]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -86,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: list[dict[str, Any]] | None | Unset + owners: None | Unset | list[dict[str, Any]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -141,16 +138,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_fields(data: object) -> list[CatalogChecklistTemplateFieldsType0Item] | None | Unset: + def _parse_fields(data: object) -> None | Unset | list["CatalogChecklistTemplateFieldsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -166,13 +163,13 @@ def _parse_fields(data: object) -> list[CatalogChecklistTemplateFieldsType0Item] fields_type_0.append(fields_type_0_item) return fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogChecklistTemplateFieldsType0Item] | None | Unset, data) + return cast(None | Unset | list["CatalogChecklistTemplateFieldsType0Item"], data) fields = _parse_fields(d.pop("fields", UNSET)) - def _parse_owners(data: object) -> list[CatalogChecklistTemplateOwnersType0Item] | None | Unset: + def _parse_owners(data: object) -> None | Unset | list["CatalogChecklistTemplateOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -188,9 +185,9 @@ def _parse_owners(data: object) -> list[CatalogChecklistTemplateOwnersType0Item] owners_type_0.append(owners_type_0_item) return owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogChecklistTemplateOwnersType0Item] | None | Unset, data) + return cast(None | Unset | list["CatalogChecklistTemplateOwnersType0Item"], data) owners = _parse_owners(d.pop("owners", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py index c2eaf173..81804df4 100644 --- a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py +++ b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,24 +17,24 @@ class CatalogChecklistTemplateFieldsType0Item: """ Attributes: - field_source (CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset): Source of the field - field_key (str | Unset): Key identifying the field - catalog_property_id (None | str | Unset): ID of the catalog property for custom fields + field_source (Union[Unset, CatalogChecklistTemplateFieldsType0ItemFieldSource]): Source of the field + field_key (Union[Unset, str]): Key identifying the field + catalog_property_id (Union[None, Unset, str]): ID of the catalog property for custom fields """ - field_source: CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset = UNSET - field_key: str | Unset = UNSET - catalog_property_id: None | str | Unset = UNSET + field_source: Unset | CatalogChecklistTemplateFieldsType0ItemFieldSource = UNSET + field_key: Unset | str = UNSET + catalog_property_id: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_source: str | Unset = UNSET + field_source: Unset | str = UNSET if not isinstance(self.field_source, Unset): field_source = self.field_source field_key = self.field_key - catalog_property_id: None | str | Unset + catalog_property_id: None | Unset | str if isinstance(self.catalog_property_id, Unset): catalog_property_id = UNSET else: @@ -58,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field_source = d.pop("field_source", UNSET) - field_source: CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset + field_source: Unset | CatalogChecklistTemplateFieldsType0ItemFieldSource if isinstance(_field_source, Unset): field_source = UNSET else: @@ -66,12 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_key = d.pop("field_key", UNSET) - def _parse_catalog_property_id(data: object) -> None | str | Unset: + def _parse_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) catalog_property_id = _parse_catalog_property_id(d.pop("catalog_property_id", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_list.py b/rootly_sdk/models/catalog_checklist_template_list.py index c0f7ee80..c4ef5839 100644 --- a/rootly_sdk/models/catalog_checklist_template_list.py +++ b/rootly_sdk/models/catalog_checklist_template_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CatalogChecklistTemplateList: """ Attributes: - data (list[CatalogChecklistTemplateListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CatalogChecklistTemplateListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogChecklistTemplateListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogChecklistTemplateListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_checklist_template_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_checklist_template_list_data_item.py b/rootly_sdk/models/catalog_checklist_template_list_data_item.py index be31006e..d69abd27 100644 --- a/rootly_sdk/models/catalog_checklist_template_list_data_item.py +++ b/rootly_sdk/models/catalog_checklist_template_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogChecklistTemplateListDataItem: id: str type_: CatalogChecklistTemplateListDataItemType - attributes: CatalogChecklistTemplate + attributes: "CatalogChecklistTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py index 23e30f42..5e05961b 100644 --- a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py +++ b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class CatalogChecklistTemplateOwnersType0Item: """ Attributes: - id (str | Unset): User ID for user owners, or field key for field owners - type_ (CatalogChecklistTemplateOwnersType0ItemType | Unset): Type of owner + id (Union[Unset, str]): User ID for user owners, or field key for field owners + type_ (Union[Unset, CatalogChecklistTemplateOwnersType0ItemType]): Type of owner """ - id: str | Unset = UNSET - type_: CatalogChecklistTemplateOwnersType0ItemType | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | CatalogChecklistTemplateOwnersType0ItemType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CatalogChecklistTemplateOwnersType0ItemType | Unset + type_: Unset | CatalogChecklistTemplateOwnersType0ItemType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template_response.py b/rootly_sdk/models/catalog_checklist_template_response.py index c86b6fd4..1f517df8 100644 --- a/rootly_sdk/models/catalog_checklist_template_response.py +++ b/rootly_sdk/models/catalog_checklist_template_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CatalogChecklistTemplateResponse: """ Attributes: data (CatalogChecklistTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogChecklistTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogChecklistTemplateResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogChecklistTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_checklist_template_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_checklist_template_response_data.py b/rootly_sdk/models/catalog_checklist_template_response_data.py index 777c5a27..8227aea1 100644 --- a/rootly_sdk/models/catalog_checklist_template_response_data.py +++ b/rootly_sdk/models/catalog_checklist_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogChecklistTemplateResponseData: id: str type_: CatalogChecklistTemplateResponseDataType - attributes: CatalogChecklistTemplate + attributes: "CatalogChecklistTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity.py b/rootly_sdk/models/catalog_entity.py index abd0a3b3..8affd2bd 100644 --- a/rootly_sdk/models/catalog_entity.py +++ b/rootly_sdk/models/catalog_entity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -21,62 +19,73 @@ class CatalogEntity: """ Attributes: name (str): - position (int | None): Default position of the item when displayed in a list. + position (Union[None, int]): Default position of the item when displayed in a list. created_at (str): updated_at (str): - description (None | str | Unset): - backstage_id (None | str | Unset): The Backstage entity ID this catalog entity is linked to. - external_id (None | str | Unset): An external identifier for this catalog entity. Must be unique within the + slug (Union[Unset, str]): The slug of the catalog entity. Derived from `name`. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): The status page description of the catalog entity + backstage_id (Union[None, Unset, str]): The Backstage entity ID this catalog entity is linked to. + external_id (Union[None, Unset, str]): An external identifier for this catalog entity. Must be unique within the catalog. - managed_by (CatalogEntityManagedBy | Unset): Which source manages this resource (read-only). - properties (list[CatalogEntityPropertiesItem] | Unset): Array of property values for this catalog entity + managed_by (Union[Unset, CatalogEntityManagedBy]): Which source manages this resource (read-only). + properties (Union[Unset, list['CatalogEntityPropertiesItem']]): Array of property values for this catalog entity """ name: str - position: int | None + position: None | int created_at: str updated_at: str - description: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogEntityManagedBy | Unset = UNSET - properties: list[CatalogEntityPropertiesItem] | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogEntityManagedBy = UNSET + properties: Unset | list["CatalogEntityPropertiesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - position: int | None + position: None | int position = self.position created_at = self.created_at updated_at = self.updated_at - description: None | str | Unset + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - backstage_id: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -93,8 +102,12 @@ def to_dict(self) -> dict[str, Any]: "updated_at": updated_at, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if backstage_id is not UNSET: field_dict["backstage_id"] = backstage_id if external_id is not UNSET: @@ -113,10 +126,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -124,55 +137,66 @@ def _parse_position(data: object) -> int | None: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + slug = d.pop("slug", UNSET) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogEntityManagedBy | Unset + managed_by: Unset | CatalogEntityManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_catalog_entity_managed_by(_managed_by) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[CatalogEntityPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = CatalogEntityPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = CatalogEntityPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) catalog_entity = cls( name=name, position=position, created_at=created_at, updated_at=updated_at, + slug=slug, description=description, + public_description=public_description, backstage_id=backstage_id, external_id=external_id, managed_by=managed_by, diff --git a/rootly_sdk/models/catalog_entity_checklist.py b/rootly_sdk/models/catalog_entity_checklist.py index 24f345bc..e13a70db 100644 --- a/rootly_sdk/models/catalog_entity_checklist.py +++ b/rootly_sdk/models/catalog_entity_checklist.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -35,11 +33,11 @@ class CatalogEntityChecklist: status (CatalogEntityChecklistStatus): The status of the checklist created_at (str): Date of creation updated_at (str): Date of last update - started_at (None | str | Unset): When the checklist was started - completed_at (None | str | Unset): When the checklist was completed - completed_by_user_id (None | str | Unset): The ID of the user who completed the checklist - checklist_fields (list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset): Checklist fields - checklist_owners (list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset): Checklist owners + started_at (Union[None, Unset, str]): When the checklist was started + completed_at (Union[None, Unset, str]): When the checklist was completed + completed_by_user_id (Union[None, Unset, str]): The ID of the user who completed the checklist + checklist_fields (Union[None, Unset, list['CatalogEntityChecklistChecklistFieldsType0Item']]): Checklist fields + checklist_owners (Union[None, Unset, list['CatalogEntityChecklistChecklistOwnersType0Item']]): Checklist owners """ catalog_checklist_template_id: str @@ -48,15 +46,14 @@ class CatalogEntityChecklist: status: CatalogEntityChecklistStatus created_at: str updated_at: str - started_at: None | str | Unset = UNSET - completed_at: None | str | Unset = UNSET - completed_by_user_id: None | str | Unset = UNSET - checklist_fields: list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset = UNSET - checklist_owners: list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset = UNSET + started_at: None | Unset | str = UNSET + completed_at: None | Unset | str = UNSET + completed_by_user_id: None | Unset | str = UNSET + checklist_fields: None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"] = UNSET + checklist_owners: None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - catalog_checklist_template_id = self.catalog_checklist_template_id auditable_type: str = self.auditable_type @@ -69,25 +66,25 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: None | str | Unset + completed_at: None | Unset | str if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - completed_by_user_id: None | str | Unset + completed_by_user_id: None | Unset | str if isinstance(self.completed_by_user_id, Unset): completed_by_user_id = UNSET else: completed_by_user_id = self.completed_by_user_id - checklist_fields: list[dict[str, Any]] | None | Unset + checklist_fields: None | Unset | list[dict[str, Any]] if isinstance(self.checklist_fields, Unset): checklist_fields = UNSET elif isinstance(self.checklist_fields, list): @@ -99,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: else: checklist_fields = self.checklist_fields - checklist_owners: list[dict[str, Any]] | None | Unset + checklist_owners: None | Unset | list[dict[str, Any]] if isinstance(self.checklist_owners, Unset): checklist_owners = UNSET elif isinstance(self.checklist_owners, list): @@ -158,36 +155,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> None | str | Unset: + def _parse_completed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_completed_by_user_id(data: object) -> None | str | Unset: + def _parse_completed_by_user_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) def _parse_checklist_fields( data: object, - ) -> list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset: + ) -> None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -205,15 +202,15 @@ def _parse_checklist_fields( checklist_fields_type_0.append(checklist_fields_type_0_item) return checklist_fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset, data) + return cast(None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"], data) checklist_fields = _parse_checklist_fields(d.pop("checklist_fields", UNSET)) def _parse_checklist_owners( data: object, - ) -> list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset: + ) -> None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -231,9 +228,9 @@ def _parse_checklist_owners( checklist_owners_type_0.append(checklist_owners_type_0_item) return checklist_owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset, data) + return cast(None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"], data) checklist_owners = _parse_checklist_owners(d.pop("checklist_owners", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py index 6543fd4e..bcb3ab76 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,14 @@ class CatalogEntityChecklistChecklistFieldsType0Item: """ Attributes: - data (CatalogEntityChecklistChecklistFieldsType0ItemData | Unset): + data (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemData]): """ - data: CatalogEntityChecklistChecklistFieldsType0ItemData | Unset = UNSET + data: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -49,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: CatalogEntityChecklistChecklistFieldsType0ItemData | Unset + data: Unset | CatalogEntityChecklistChecklistFieldsType0ItemData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py index 577b41b2..ec8b5928 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,25 +23,24 @@ class CatalogEntityChecklistChecklistFieldsType0ItemData: """ Attributes: - id (str | Unset): ID of the checklist field - type_ (CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset): - attributes (CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset): + id (Union[Unset, str]): ID of the checklist field + type_ (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType]): + attributes (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes]): """ - id: str | Unset = UNSET - type_: CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset = UNSET - attributes: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataType = UNSET + attributes: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -69,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset + type_: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_catalog_entity_checklist_checklist_fields_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset + attributes: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py index 21f60c2e..9a4d70b7 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,29 +19,29 @@ class CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes: """ Attributes: - catalog_entity_checklist_id (str | Unset): The ID of the parent checklist - catalog_checklist_template_field_id (None | str | Unset): The ID of the template field - field_key (str | Unset): The field key - checked (bool | Unset): Whether the field is checked - value_snapshot (CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset): - The value snapshot at time of checking - completed_by_user_id (None | str | Unset): The ID of the user who checked the field - completed_at (None | str | Unset): When the field was checked - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + catalog_entity_checklist_id (Union[Unset, str]): The ID of the parent checklist + catalog_checklist_template_field_id (Union[None, Unset, str]): The ID of the template field + field_key (Union[Unset, str]): The field key + checked (Union[Unset, bool]): Whether the field is checked + value_snapshot (Union['CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0', None, + Unset]): The value snapshot at time of checking + completed_by_user_id (Union[None, Unset, str]): The ID of the user who checked the field + completed_at (Union[None, Unset, str]): When the field was checked + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - catalog_entity_checklist_id: str | Unset = UNSET - catalog_checklist_template_field_id: None | str | Unset = UNSET - field_key: str | Unset = UNSET - checked: bool | Unset = UNSET - value_snapshot: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset = ( - UNSET - ) - completed_by_user_id: None | str | Unset = UNSET - completed_at: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + catalog_entity_checklist_id: Unset | str = UNSET + catalog_checklist_template_field_id: None | Unset | str = UNSET + field_key: Unset | str = UNSET + checked: Unset | bool = UNSET + value_snapshot: Union[ + "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset + ] = UNSET + completed_by_user_id: None | Unset | str = UNSET + completed_at: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: catalog_entity_checklist_id = self.catalog_entity_checklist_id - catalog_checklist_template_field_id: None | str | Unset + catalog_checklist_template_field_id: None | Unset | str if isinstance(self.catalog_checklist_template_field_id, Unset): catalog_checklist_template_field_id = UNSET else: @@ -63,7 +61,7 @@ def to_dict(self) -> dict[str, Any]: checked = self.checked - value_snapshot: dict[str, Any] | None | Unset + value_snapshot: None | Unset | dict[str, Any] if isinstance(self.value_snapshot, Unset): value_snapshot = UNSET elif isinstance( @@ -73,13 +71,13 @@ def to_dict(self) -> dict[str, Any]: else: value_snapshot = self.value_snapshot - completed_by_user_id: None | str | Unset + completed_by_user_id: None | Unset | str if isinstance(self.completed_by_user_id, Unset): completed_by_user_id = UNSET else: completed_by_user_id = self.completed_by_user_id - completed_at: None | str | Unset + completed_at: None | Unset | str if isinstance(self.completed_at, Unset): completed_at = UNSET else: @@ -122,12 +120,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) catalog_entity_checklist_id = d.pop("catalog_entity_checklist_id", UNSET) - def _parse_catalog_checklist_template_field_id(data: object) -> None | str | Unset: + def _parse_catalog_checklist_template_field_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) catalog_checklist_template_field_id = _parse_catalog_checklist_template_field_id( d.pop("catalog_checklist_template_field_id", UNSET) @@ -139,7 +137,7 @@ def _parse_catalog_checklist_template_field_id(data: object) -> None | str | Uns def _parse_value_snapshot( data: object, - ) -> CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset: + ) -> Union["CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -152,29 +150,30 @@ def _parse_value_snapshot( ) return value_snapshot_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset, data + Union["CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset], + data, ) value_snapshot = _parse_value_snapshot(d.pop("value_snapshot", UNSET)) - def _parse_completed_by_user_id(data: object) -> None | str | Unset: + def _parse_completed_by_user_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) - def _parse_completed_at(data: object) -> None | str | Unset: + def _parse_completed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py index c0b25867..b853f651 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotT additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py index a0e411bc..b5f47041 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,14 @@ class CatalogEntityChecklistChecklistOwnersType0Item: """ Attributes: - data (CatalogEntityChecklistChecklistOwnersType0ItemData | Unset): + data (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemData]): """ - data: CatalogEntityChecklistChecklistOwnersType0ItemData | Unset = UNSET + data: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -49,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: CatalogEntityChecklistChecklistOwnersType0ItemData | Unset + data: Unset | CatalogEntityChecklistChecklistOwnersType0ItemData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py index b2e34423..04fc37d8 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,25 +23,24 @@ class CatalogEntityChecklistChecklistOwnersType0ItemData: """ Attributes: - id (str | Unset): ID of the checklist owner - type_ (CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset): - attributes (CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset): + id (Union[Unset, str]): ID of the checklist owner + type_ (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType]): + attributes (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes]): """ - id: str | Unset = UNSET - type_: CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset = UNSET - attributes: CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataType = UNSET + attributes: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -69,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset + type_: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_catalog_entity_checklist_checklist_owners_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset + attributes: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py index 923596d6..1e2f85e4 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,16 +13,16 @@ class CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes: """ Attributes: - catalog_entity_checklist_id (str | Unset): The ID of the parent checklist - owner_user_id (str | Unset): The ID of the owner user - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + catalog_entity_checklist_id (Union[Unset, str]): The ID of the parent checklist + owner_user_id (Union[Unset, str]): The ID of the owner user + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - catalog_entity_checklist_id: str | Unset = UNSET - owner_user_id: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + catalog_entity_checklist_id: Unset | str = UNSET + owner_user_id: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/catalog_entity_checklist_list.py b/rootly_sdk/models/catalog_entity_checklist_list.py index 2eaf2854..ab8ee26d 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list.py +++ b/rootly_sdk/models/catalog_entity_checklist_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CatalogEntityChecklistList: """ Attributes: - data (list[CatalogEntityChecklistListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CatalogEntityChecklistListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogEntityChecklistListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogEntityChecklistListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_checklist_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_checklist_list_data_item.py b/rootly_sdk/models/catalog_entity_checklist_list_data_item.py index 4e904d00..32e91060 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityChecklistListDataItem: id: str type_: CatalogEntityChecklistListDataItemType - attributes: CatalogEntityChecklist + attributes: "CatalogEntityChecklist" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_checklist_response.py b/rootly_sdk/models/catalog_entity_checklist_response.py index 649544ff..85097426 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response.py +++ b/rootly_sdk/models/catalog_entity_checklist_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CatalogEntityChecklistResponse: """ Attributes: data (CatalogEntityChecklistResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogEntityChecklistResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogEntityChecklistResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogEntityChecklistResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_checklist_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_checklist_response_data.py b/rootly_sdk/models/catalog_entity_checklist_response_data.py index 0f7379b9..d04912a0 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityChecklistResponseData: id: str type_: CatalogEntityChecklistResponseDataType - attributes: CatalogEntityChecklist + attributes: "CatalogEntityChecklist" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_list.py b/rootly_sdk/models/catalog_entity_list.py index 25ebef55..5c111e7e 100644 --- a/rootly_sdk/models/catalog_entity_list.py +++ b/rootly_sdk/models/catalog_entity_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CatalogEntityList: """ Attributes: - data (list[CatalogEntityListDataItem]): + data (list['CatalogEntityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogEntityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogEntityListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_list_data_item.py b/rootly_sdk/models/catalog_entity_list_data_item.py index d6635a40..e71d7885 100644 --- a/rootly_sdk/models/catalog_entity_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityListDataItem: id: str type_: CatalogEntityListDataItemType - attributes: CatalogEntity + attributes: "CatalogEntity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_properties_item.py b/rootly_sdk/models/catalog_entity_properties_item.py index a96d631a..4209688b 100644 --- a/rootly_sdk/models/catalog_entity_properties_item.py +++ b/rootly_sdk/models/catalog_entity_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/catalog_entity_property.py b/rootly_sdk/models/catalog_entity_property.py index 36c57257..28079807 100644 --- a/rootly_sdk/models/catalog_entity_property.py +++ b/rootly_sdk/models/catalog_entity_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/catalog_entity_property_list.py b/rootly_sdk/models/catalog_entity_property_list.py index ee46c1ca..9cfd64a2 100644 --- a/rootly_sdk/models/catalog_entity_property_list.py +++ b/rootly_sdk/models/catalog_entity_property_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,20 +22,19 @@ class CatalogEntityPropertyList: endpoints (teams, services, functionalities, incident_types, causes, environments) to retrieve field values instead. Attributes: - data (list[CatalogEntityPropertyListDataItem]): + data (list['CatalogEntityPropertyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogEntityPropertyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogEntityPropertyListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -87,14 +84,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_property_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_property_list_data_item.py b/rootly_sdk/models/catalog_entity_property_list_data_item.py index 076db434..5296266a 100644 --- a/rootly_sdk/models/catalog_entity_property_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_property_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,11 +29,10 @@ class CatalogEntityPropertyListDataItem: id: str type_: CatalogEntityPropertyListDataItemType - attributes: CatalogEntityProperty + attributes: "CatalogEntityProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_property_response.py b/rootly_sdk/models/catalog_entity_property_response.py index dcc92f35..4d5e1433 100644 --- a/rootly_sdk/models/catalog_entity_property_response.py +++ b/rootly_sdk/models/catalog_entity_property_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,18 +21,17 @@ class CatalogEntityPropertyResponse: Attributes: data (CatalogEntityPropertyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogEntityPropertyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogEntityPropertyResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -61,14 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogEntityPropertyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_property_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_property_response_data.py b/rootly_sdk/models/catalog_entity_property_response_data.py index 498e31c9..2eadd03a 100644 --- a/rootly_sdk/models/catalog_entity_property_response_data.py +++ b/rootly_sdk/models/catalog_entity_property_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,11 +29,10 @@ class CatalogEntityPropertyResponseData: id: str type_: CatalogEntityPropertyResponseDataType - attributes: CatalogEntityProperty + attributes: "CatalogEntityProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_response.py b/rootly_sdk/models/catalog_entity_response.py index d4021d60..88a94682 100644 --- a/rootly_sdk/models/catalog_entity_response.py +++ b/rootly_sdk/models/catalog_entity_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CatalogEntityResponse: """ Attributes: data (CatalogEntityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogEntityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogEntityResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogEntityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_response_data.py b/rootly_sdk/models/catalog_entity_response_data.py index c94fce28..de40e5fb 100644 --- a/rootly_sdk/models/catalog_entity_response_data.py +++ b/rootly_sdk/models/catalog_entity_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityResponseData: id: str type_: CatalogEntityResponseDataType - attributes: CatalogEntity + attributes: "CatalogEntity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_field.py b/rootly_sdk/models/catalog_field.py index ec19027e..47e853eb 100644 --- a/rootly_sdk/models/catalog_field.py +++ b/rootly_sdk/models/catalog_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,35 +16,35 @@ class CatalogField: """ Attributes: - catalog_id (None | str): + catalog_id (Union[None, str]): name (str): kind (CatalogFieldKind): multiple (bool): Whether the attribute accepts multiple values. - position (int | None): Default position of the item when displayed in a list. + position (Union[None, int]): Default position of the item when displayed in a list. created_at (str): updated_at (str): - slug (str | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - required (bool | Unset): Whether the field is required. - catalog_type (CatalogFieldCatalogType | Unset): The type of catalog the field belongs to. - external_id (None | str | Unset): An external identifier for this catalog field. Must be unique within the + slug (Union[Unset, str]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + required (Union[Unset, bool]): Whether the field is required. + catalog_type (Union[Unset, CatalogFieldCatalogType]): The type of catalog the field belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog field. Must be unique within the scope. - managed_by (CatalogFieldManagedBy | Unset): Which source manages this resource (read-only). + managed_by (Union[Unset, CatalogFieldManagedBy]): Which source manages this resource (read-only). """ catalog_id: None | str name: str kind: CatalogFieldKind multiple: bool - position: int | None + position: None | int created_at: str updated_at: str - slug: str | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: CatalogFieldCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogFieldManagedBy | Unset = UNSET + slug: Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | CatalogFieldCatalogType = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogFieldManagedBy = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None + position: None | int position = self.position created_at = self.created_at @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: None | str | Unset + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -76,17 +74,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -135,10 +133,10 @@ def _parse_catalog_id(data: object) -> None | str: multiple = d.pop("multiple") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -148,35 +146,35 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: CatalogFieldCatalogType | Unset + catalog_type: Unset | CatalogFieldCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_catalog_field_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogFieldManagedBy | Unset + managed_by: Unset | CatalogFieldManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_field_list.py b/rootly_sdk/models/catalog_field_list.py index 701ad0c1..69edf3ce 100644 --- a/rootly_sdk/models/catalog_field_list.py +++ b/rootly_sdk/models/catalog_field_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CatalogFieldList: """ Attributes: - data (list[CatalogFieldListDataItem]): + data (list['CatalogFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_field_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_field_list_data_item.py b/rootly_sdk/models/catalog_field_list_data_item.py index 682398fe..744cc909 100644 --- a/rootly_sdk/models/catalog_field_list_data_item.py +++ b/rootly_sdk/models/catalog_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogFieldListDataItem: id: str type_: CatalogFieldListDataItemType - attributes: CatalogField + attributes: "CatalogField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_field_response.py b/rootly_sdk/models/catalog_field_response.py index 28027488..18ae0ed0 100644 --- a/rootly_sdk/models/catalog_field_response.py +++ b/rootly_sdk/models/catalog_field_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CatalogFieldResponse: """ Attributes: data (CatalogFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogFieldResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_field_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_field_response_data.py b/rootly_sdk/models/catalog_field_response_data.py index 8e7af968..21e16252 100644 --- a/rootly_sdk/models/catalog_field_response_data.py +++ b/rootly_sdk/models/catalog_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogFieldResponseData: id: str type_: CatalogFieldResponseDataType - attributes: CatalogField + attributes: "CatalogField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_list.py b/rootly_sdk/models/catalog_list.py index b08d4e29..c307f652 100644 --- a/rootly_sdk/models/catalog_list.py +++ b/rootly_sdk/models/catalog_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CatalogList: """ Attributes: - data (list[CatalogListDataItem]): + data (list['CatalogListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_list_data_item.py b/rootly_sdk/models/catalog_list_data_item.py index b571539d..7c497c89 100644 --- a/rootly_sdk/models/catalog_list_data_item.py +++ b/rootly_sdk/models/catalog_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CatalogListDataItem: id: str type_: CatalogListDataItemType - attributes: Catalog + attributes: "Catalog" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_property.py b/rootly_sdk/models/catalog_property.py index 290c5655..af5b8991 100644 --- a/rootly_sdk/models/catalog_property.py +++ b/rootly_sdk/models/catalog_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,35 +16,35 @@ class CatalogProperty: """ Attributes: - catalog_id (None | str): + catalog_id (Union[None, str]): name (str): kind (CatalogPropertyKind): multiple (bool): Whether the attribute accepts multiple values. - position (int | None): Default position of the item when displayed in a list. + position (Union[None, int]): Default position of the item when displayed in a list. created_at (str): updated_at (str): - slug (str | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - required (bool | Unset): Whether the property is required. - catalog_type (CatalogPropertyCatalogType | Unset): The type of catalog the property belongs to. - external_id (None | str | Unset): An external identifier for this catalog property. Must be unique within the - scope. - managed_by (CatalogPropertyManagedBy | Unset): Which source manages this resource (read-only). + slug (Union[Unset, str]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + required (Union[Unset, bool]): Whether the property is required. + catalog_type (Union[Unset, CatalogPropertyCatalogType]): The type of catalog the property belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog property. Must be unique within + the scope. + managed_by (Union[Unset, CatalogPropertyManagedBy]): Which source manages this resource (read-only). """ catalog_id: None | str name: str kind: CatalogPropertyKind multiple: bool - position: int | None + position: None | int created_at: str updated_at: str - slug: str | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: CatalogPropertyCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogPropertyManagedBy | Unset = UNSET + slug: Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | CatalogPropertyCatalogType = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogPropertyManagedBy = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None + position: None | int position = self.position created_at = self.created_at @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: None | str | Unset + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -76,17 +74,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -135,10 +133,10 @@ def _parse_catalog_id(data: object) -> None | str: multiple = d.pop("multiple") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -148,35 +146,35 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: CatalogPropertyCatalogType | Unset + catalog_type: Unset | CatalogPropertyCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_catalog_property_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogPropertyManagedBy | Unset + managed_by: Unset | CatalogPropertyManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_property_list.py b/rootly_sdk/models/catalog_property_list.py index 599d86d9..d61b7225 100644 --- a/rootly_sdk/models/catalog_property_list.py +++ b/rootly_sdk/models/catalog_property_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CatalogPropertyList: """ Attributes: - data (list[CatalogPropertyListDataItem]): + data (list['CatalogPropertyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogPropertyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogPropertyListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_property_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_property_list_data_item.py b/rootly_sdk/models/catalog_property_list_data_item.py index 30b3a4f7..4bd69137 100644 --- a/rootly_sdk/models/catalog_property_list_data_item.py +++ b/rootly_sdk/models/catalog_property_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogPropertyListDataItem: id: str type_: CatalogPropertyListDataItemType - attributes: CatalogProperty + attributes: "CatalogProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_property_response.py b/rootly_sdk/models/catalog_property_response.py index 9487ea12..f4669081 100644 --- a/rootly_sdk/models/catalog_property_response.py +++ b/rootly_sdk/models/catalog_property_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CatalogPropertyResponse: """ Attributes: data (CatalogPropertyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogPropertyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogPropertyResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogPropertyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_property_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_property_response_data.py b/rootly_sdk/models/catalog_property_response_data.py index 97cf9c33..9899d562 100644 --- a/rootly_sdk/models/catalog_property_response_data.py +++ b/rootly_sdk/models/catalog_property_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogPropertyResponseData: id: str type_: CatalogPropertyResponseDataType - attributes: CatalogProperty + attributes: "CatalogProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_response.py b/rootly_sdk/models/catalog_response.py index 803acfef..77b93a64 100644 --- a/rootly_sdk/models/catalog_response.py +++ b/rootly_sdk/models/catalog_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CatalogResponse: """ Attributes: data (CatalogResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_response_data.py b/rootly_sdk/models/catalog_response_data.py index 3043dcd1..84cb45e7 100644 --- a/rootly_sdk/models/catalog_response_data.py +++ b/rootly_sdk/models/catalog_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CatalogResponseData: id: str type_: CatalogResponseDataType - attributes: Catalog + attributes: "Catalog" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/cause.py b/rootly_sdk/models/cause.py index 0f7cc7b6..ac51daa7 100644 --- a/rootly_sdk/models/cause.py +++ b/rootly_sdk/models/cause.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,23 +20,24 @@ class Cause: name (str): The name of the cause created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the cause - description (None | str | Unset): The description of the cause - position (int | None | Unset): Position of the cause - properties (list[CausePropertiesItem] | Unset): Array of property values for this cause. + slug (Union[Unset, str]): The slug of the cause + description (Union[None, Unset, str]): The description of the cause + public_description (Union[None, Unset, str]): The status page description of the cause + position (Union[None, Unset, int]): Position of the cause + properties (Union[Unset, list['CausePropertiesItem']]): Array of property values for this cause. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - properties: list[CausePropertiesItem] | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + properties: Unset | list["CausePropertiesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -47,19 +46,25 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -79,6 +84,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if properties is not UNSET: @@ -99,32 +106,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[CausePropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = CausePropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = CausePropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) cause = cls( name=name, @@ -132,6 +146,7 @@ def _parse_position(data: object) -> int | None | Unset: updated_at=updated_at, slug=slug, description=description, + public_description=public_description, position=position, properties=properties, ) diff --git a/rootly_sdk/models/cause_list.py b/rootly_sdk/models/cause_list.py index 09bf20ee..b2a05e85 100644 --- a/rootly_sdk/models/cause_list.py +++ b/rootly_sdk/models/cause_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CauseList: """ Attributes: - data (list[CauseListDataItem]): + data (list['CauseListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CauseListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CauseListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) cause_list = cls( data=data, diff --git a/rootly_sdk/models/cause_list_data_item.py b/rootly_sdk/models/cause_list_data_item.py index ab260383..be1f6faa 100644 --- a/rootly_sdk/models/cause_list_data_item.py +++ b/rootly_sdk/models/cause_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CauseListDataItem: id: str type_: CauseListDataItemType - attributes: Cause + attributes: "Cause" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/cause_properties_item.py b/rootly_sdk/models/cause_properties_item.py index ada1e890..ab1a6e50 100644 --- a/rootly_sdk/models/cause_properties_item.py +++ b/rootly_sdk/models/cause_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/cause_response.py b/rootly_sdk/models/cause_response.py index 5b7f1b42..8db75808 100644 --- a/rootly_sdk/models/cause_response.py +++ b/rootly_sdk/models/cause_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CauseResponse: """ Attributes: data (CauseResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CauseResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CauseResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CauseResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) cause_response = cls( data=data, diff --git a/rootly_sdk/models/cause_response_data.py b/rootly_sdk/models/cause_response_data.py index 26df2bb4..474e138f 100644 --- a/rootly_sdk/models/cause_response_data.py +++ b/rootly_sdk/models/cause_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CauseResponseData: id: str type_: CauseResponseDataType - attributes: Cause + attributes: "Cause" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/change_google_chat_space_privacy_task_params.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params.py index b38539dc..7e38b344 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,25 +22,24 @@ class ChangeGoogleChatSpacePrivacyTaskParams: """ Attributes: space (ChangeGoogleChatSpacePrivacyTaskParamsSpace): - task_type (ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset): - audience (None | str | Unset): Target audience resource name (e.g. audiences/default). Leave blank to make + task_type (Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType]): + audience (Union[None, Unset, str]): Target audience resource name (e.g. audiences/default). Leave blank to make private. """ - space: ChangeGoogleChatSpacePrivacyTaskParamsSpace - task_type: ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset = UNSET - audience: None | str | Unset = UNSET + space: "ChangeGoogleChatSpacePrivacyTaskParamsSpace" + task_type: Unset | ChangeGoogleChatSpacePrivacyTaskParamsTaskType = UNSET + audience: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - audience: None | str | Unset + audience: None | Unset | str if isinstance(self.audience, Unset): audience = UNSET else: @@ -72,18 +69,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: space = ChangeGoogleChatSpacePrivacyTaskParamsSpace.from_dict(d.pop("space")) _task_type = d.pop("task_type", UNSET) - task_type: ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset + task_type: Unset | ChangeGoogleChatSpacePrivacyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_change_google_chat_space_privacy_task_params_task_type(_task_type) - def _parse_audience(data: object) -> None | str | Unset: + def _parse_audience(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) audience = _parse_audience(d.pop("audience", UNSET)) diff --git a/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py index cf4c0984..a9116862 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ChangeGoogleChatSpacePrivacyTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params.py b/rootly_sdk/models/change_slack_channel_privacy_task_params.py index 58c10e84..3c87f256 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,21 +27,20 @@ class ChangeSlackChannelPrivacyTaskParams: Attributes: channel (ChangeSlackChannelPrivacyTaskParamsChannel): privacy (ChangeSlackChannelPrivacyTaskParamsPrivacy): - task_type (ChangeSlackChannelPrivacyTaskParamsTaskType | Unset): + task_type (Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType]): """ - channel: ChangeSlackChannelPrivacyTaskParamsChannel + channel: "ChangeSlackChannelPrivacyTaskParamsChannel" privacy: ChangeSlackChannelPrivacyTaskParamsPrivacy - task_type: ChangeSlackChannelPrivacyTaskParamsTaskType | Unset = UNSET + task_type: Unset | ChangeSlackChannelPrivacyTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() privacy: str = self.privacy - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: privacy = check_change_slack_channel_privacy_task_params_privacy(d.pop("privacy")) _task_type = d.pop("task_type", UNSET) - task_type: ChangeSlackChannelPrivacyTaskParamsTaskType | Unset + task_type: Unset | ChangeSlackChannelPrivacyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py b/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py index 1dd7d904..4457d494 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ChangeSlackChannelPrivacyTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_group.py b/rootly_sdk/models/communications_group.py index a6028858..5c8f0903 100644 --- a/rootly_sdk/models/communications_group.py +++ b/rootly_sdk/models/communications_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -36,14 +34,14 @@ class CommunicationsGroup: email_channel (bool): Email channel enabled created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications group - description (None | str | Unset): The description of the communications group - communication_group_conditions (list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset): - Group conditions attributes - member_ids (list[int] | None | Unset): Array of member user IDs - slack_channel_ids (list[str] | None | Unset): Array of Slack channel IDs - communication_external_group_members (list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None - | Unset): External group members + slug (Union[Unset, str]): The slug of the communications group + description (Union[None, Unset, str]): The description of the communications group + communication_group_conditions (Union[None, Unset, + list['CommunicationsGroupCommunicationGroupConditionsType0Item']]): Group conditions attributes + member_ids (Union[None, Unset, list[int]]): Array of member user IDs + slack_channel_ids (Union[None, Unset, list[str]]): Array of Slack channel IDs + communication_external_group_members (Union[None, Unset, + list['CommunicationsGroupCommunicationExternalGroupMembersType0Item']]): External group members """ name: str @@ -54,20 +52,19 @@ class CommunicationsGroup: email_channel: bool created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_group_conditions: list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset = ( + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_group_conditions: None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"] = ( UNSET ) - member_ids: list[int] | None | Unset = UNSET - slack_channel_ids: list[str] | None | Unset = UNSET + member_ids: None | Unset | list[int] = UNSET + slack_channel_ids: None | Unset | list[str] = UNSET communication_external_group_members: ( - list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset + None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"] ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name communication_type_id = self.communication_type_id @@ -86,13 +83,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - communication_group_conditions: list[dict[str, Any]] | None | Unset + communication_group_conditions: None | Unset | list[dict[str, Any]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -104,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - member_ids: list[int] | None | Unset + member_ids: None | Unset | list[int] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -113,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: list[str] | None | Unset + slack_channel_ids: None | Unset | list[str] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -122,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_external_group_members: list[dict[str, Any]] | None | Unset + communication_external_group_members: None | Unset | list[dict[str, Any]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -193,18 +190,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset: + ) -> None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -224,15 +221,15 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset, data) + return cast(None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"], data) communication_group_conditions = _parse_communication_group_conditions( d.pop("communication_group_conditions", UNSET) ) - def _parse_member_ids(data: object) -> list[int] | None | Unset: + def _parse_member_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -243,13 +240,13 @@ def _parse_member_ids(data: object) -> list[int] | None | Unset: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: + def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -260,15 +257,15 @@ def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_external_group_members( data: object, - ) -> list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset: + ) -> None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -290,9 +287,9 @@ def _parse_communication_external_group_members( communication_external_group_members_type_0.append(communication_external_group_members_type_0_item) return communication_external_group_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset, data) + return cast(None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"], data) communication_external_group_members = _parse_communication_external_group_members( d.pop("communication_external_group_members", UNSET) diff --git a/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py b/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py index 7edf9df3..51c6093d 100644 --- a/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,16 +13,16 @@ class CommunicationsGroupCommunicationExternalGroupMembersType0Item: """ Attributes: - id (str | Unset): ID of the external group member - name (str | Unset): Name of the external member - email (str | Unset): Email of the external member - phone_number (str | Unset): Phone number of the external member + id (Union[Unset, str]): ID of the external group member + name (Union[Unset, str]): Name of the external member + email (Union[Unset, str]): Email of the external member + phone_number (Union[Unset, str]): Phone number of the external member """ - id: str | Unset = UNSET - name: str | Unset = UNSET - email: str | Unset = UNSET - phone_number: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET + email: Unset | str = UNSET + phone_number: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py index 8f0cfd6e..49c2521d 100644 --- a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,28 +17,29 @@ class CommunicationsGroupCommunicationGroupConditionsType0Item: """ Attributes: - property_type (CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset): Property type - service_ids (list[str] | None | Unset): Array of service IDs - severity_ids (list[str] | None | Unset): Array of severity IDs - functionality_ids (list[str] | None | Unset): Array of functionality IDs - group_ids (list[str] | None | Unset): Array of group IDs - incident_type_ids (list[str] | None | Unset): Array of incident type IDs + property_type (Union[Unset, CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType]): Property + type + service_ids (Union[None, Unset, list[str]]): Array of service IDs + severity_ids (Union[None, Unset, list[str]]): Array of severity IDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality IDs + group_ids (Union[None, Unset, list[str]]): Array of group IDs + incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - property_type: CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + property_type: Unset | CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType = UNSET + service_ids: None | Unset | list[str] = UNSET + severity_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: str | Unset = UNSET + property_type: Unset | str = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -49,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -58,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -67,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -107,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _property_type = d.pop("property_type", UNSET) - property_type: CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset + property_type: Unset | CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType if isinstance(_property_type, Unset): property_type = UNSET else: @@ -115,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_type ) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -126,13 +125,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -143,13 +142,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -160,13 +159,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -177,13 +176,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -194,9 +193,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/communications_group_response.py b/rootly_sdk/models/communications_group_response.py index b5a5b73d..6c34df6d 100644 --- a/rootly_sdk/models/communications_group_response.py +++ b/rootly_sdk/models/communications_group_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CommunicationsGroupResponse: """ Attributes: data (CommunicationsGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsGroupResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_group_response = cls( data=data, diff --git a/rootly_sdk/models/communications_group_response_data.py b/rootly_sdk/models/communications_group_response_data.py index 348403a7..c2a3a20f 100644 --- a/rootly_sdk/models/communications_group_response_data.py +++ b/rootly_sdk/models/communications_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsGroupResponseData: id: str type_: CommunicationsGroupResponseDataType - attributes: CommunicationsGroup + attributes: "CommunicationsGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_groups_response.py b/rootly_sdk/models/communications_groups_response.py index 073a891b..f38a5fcf 100644 --- a/rootly_sdk/models/communications_groups_response.py +++ b/rootly_sdk/models/communications_groups_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsGroupsResponse: """ Attributes: - data (list[CommunicationsGroupsResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsGroupsResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsGroupsResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsGroupsResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_groups_response = cls( data=data, diff --git a/rootly_sdk/models/communications_groups_response_data_item.py b/rootly_sdk/models/communications_groups_response_data_item.py index 9aa6b3cd..137cf52e 100644 --- a/rootly_sdk/models/communications_groups_response_data_item.py +++ b/rootly_sdk/models/communications_groups_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsGroupsResponseDataItem: id: str type_: CommunicationsGroupsResponseDataItemType - attributes: CommunicationsGroup + attributes: "CommunicationsGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_stage.py b/rootly_sdk/models/communications_stage.py index a32faca1..fadd1b8c 100644 --- a/rootly_sdk/models/communications_stage.py +++ b/rootly_sdk/models/communications_stage.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,25 +14,25 @@ class CommunicationsStage: """ Attributes: name (str): The name of the communications stage - position (int | None): Position of the communications stage + position (Union[None, int]): Position of the communications stage created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications stage - description (None | str | Unset): The description of the communications stage + slug (Union[Unset, str]): The slug of the communications stage + description (Union[None, Unset, str]): The description of the communications stage """ name: str - position: int | None + position: None | int created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: int | None + position: None | int position = self.position created_at = self.created_at @@ -43,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -71,10 +69,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -84,12 +82,12 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/communications_stage_response.py b/rootly_sdk/models/communications_stage_response.py index 4fd84073..cadf4ee8 100644 --- a/rootly_sdk/models/communications_stage_response.py +++ b/rootly_sdk/models/communications_stage_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CommunicationsStageResponse: """ Attributes: data (CommunicationsStageResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsStageResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsStageResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsStageResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_stage_response = cls( data=data, diff --git a/rootly_sdk/models/communications_stage_response_data.py b/rootly_sdk/models/communications_stage_response_data.py index 740ecf53..e1c9d1b4 100644 --- a/rootly_sdk/models/communications_stage_response_data.py +++ b/rootly_sdk/models/communications_stage_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsStageResponseData: id: str type_: CommunicationsStageResponseDataType - attributes: CommunicationsStage + attributes: "CommunicationsStage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_stages_response.py b/rootly_sdk/models/communications_stages_response.py index bc18ddc2..70d1fd5c 100644 --- a/rootly_sdk/models/communications_stages_response.py +++ b/rootly_sdk/models/communications_stages_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsStagesResponse: """ Attributes: - data (list[CommunicationsStagesResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsStagesResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsStagesResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsStagesResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_stages_response = cls( data=data, diff --git a/rootly_sdk/models/communications_stages_response_data_item.py b/rootly_sdk/models/communications_stages_response_data_item.py index 08d91cc3..97a69037 100644 --- a/rootly_sdk/models/communications_stages_response_data_item.py +++ b/rootly_sdk/models/communications_stages_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsStagesResponseDataItem: id: str type_: CommunicationsStagesResponseDataItemType - attributes: CommunicationsStage + attributes: "CommunicationsStage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_template.py b/rootly_sdk/models/communications_template.py index 6e9b9007..1e892142 100644 --- a/rootly_sdk/models/communications_template.py +++ b/rootly_sdk/models/communications_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,35 +21,34 @@ class CommunicationsTemplate: """ Attributes: name (str): The name of the communications template - position (int | None): Position of the communications template + position (Union[None, int]): Position of the communications template created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications template - description (None | str | Unset): The description of the communications template - communication_type_id (str | Unset): The communication type ID - communication_template_stages (list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset): - Communication template stages - communication_type (CommunicationsTemplateCommunicationType | Unset): + slug (Union[Unset, str]): The slug of the communications template + description (Union[None, Unset, str]): The description of the communications template + communication_type_id (Union[Unset, str]): The communication type ID + communication_template_stages (Union[None, Unset, + list['CommunicationsTemplateCommunicationTemplateStagesType0Item']]): Communication template stages + communication_type (Union[Unset, CommunicationsTemplateCommunicationType]): """ name: str - position: int | None + position: None | int created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_type_id: str | Unset = UNSET - communication_template_stages: list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset = ( + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_type_id: Unset | str = UNSET + communication_template_stages: None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"] = ( UNSET ) - communication_type: CommunicationsTemplateCommunicationType | Unset = UNSET + communication_type: Union[Unset, "CommunicationsTemplateCommunicationType"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - position: int | None + position: None | int position = self.position created_at = self.created_at @@ -60,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -68,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - communication_template_stages: list[dict[str, Any]] | None | Unset + communication_template_stages: None | Unset | list[dict[str, Any]] if isinstance(self.communication_template_stages, Unset): communication_template_stages = UNSET elif isinstance(self.communication_template_stages, list): @@ -80,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_template_stages = self.communication_template_stages - communication_type: dict[str, Any] | Unset = UNSET + communication_type: Unset | dict[str, Any] = UNSET if not isinstance(self.communication_type, Unset): communication_type = self.communication_type.to_dict() @@ -117,10 +114,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -130,12 +127,12 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -143,7 +140,7 @@ def _parse_description(data: object) -> None | str | Unset: def _parse_communication_template_stages( data: object, - ) -> list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset: + ) -> None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -163,16 +160,16 @@ def _parse_communication_template_stages( communication_template_stages_type_0.append(communication_template_stages_type_0_item) return communication_template_stages_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset, data) + return cast(None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"], data) communication_template_stages = _parse_communication_template_stages( d.pop("communication_template_stages", UNSET) ) _communication_type = d.pop("communication_type", UNSET) - communication_type: CommunicationsTemplateCommunicationType | Unset + communication_type: Unset | CommunicationsTemplateCommunicationType if isinstance(_communication_type, Unset): communication_type = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py index 1d8c4f18..94f47d8b 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,14 @@ class CommunicationsTemplateCommunicationTemplateStagesType0Item: """ Attributes: - data (CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset): + data (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemData]): """ - data: CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset = UNSET + data: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -49,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset + data: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py index 0999ec29..318d79c6 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,25 +23,24 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemData: """ Attributes: - id (str | Unset): ID of the communication template stage - type_ (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset): - attributes (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset): + id (Union[Unset, str]): ID of the communication template stage + type_ (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType]): + attributes (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes]): """ - id: str | Unset = UNSET - type_: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset = UNSET - attributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType = UNSET + attributes: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -69,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset + type_: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_communications_template_communication_template_stages_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset + attributes: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py index 1d91175b..cabf8621 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,53 +22,52 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes: """ Attributes: - email_body (None | str | Unset): Email body for the stage - email_subject (None | str | Unset): Email subject for the stage - slack_content (None | str | Unset): Slack content for the stage - sms_content (None | str | Unset): SMS content for the stage - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - communication_stage (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage - | Unset): - communication_template - (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset): + email_body (Union[None, Unset, str]): Email body for the stage + email_subject (Union[None, Unset, str]): Email subject for the stage + slack_content (Union[None, Unset, str]): Slack content for the stage + sms_content (Union[None, Unset, str]): SMS content for the stage + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + communication_stage (Union[Unset, + CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage]): + communication_template (Union[Unset, + CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate]): """ - email_body: None | str | Unset = UNSET - email_subject: None | str | Unset = UNSET - slack_content: None | str | Unset = UNSET - sms_content: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - communication_stage: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage | Unset - ) = UNSET - communication_template: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset - ) = UNSET + email_body: None | Unset | str = UNSET + email_subject: None | Unset | str = UNSET + slack_content: None | Unset | str = UNSET + sms_content: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET + communication_stage: Union[ + Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage" + ] = UNSET + communication_template: Union[ + Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate" + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - email_body: None | str | Unset + email_body: None | Unset | str if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - email_subject: None | str | Unset + email_subject: None | Unset | str if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - slack_content: None | str | Unset + slack_content: None | Unset | str if isinstance(self.slack_content, Unset): slack_content = UNSET else: slack_content = self.slack_content - sms_content: None | str | Unset + sms_content: None | Unset | str if isinstance(self.sms_content, Unset): sms_content = UNSET else: @@ -80,11 +77,11 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - communication_stage: dict[str, Any] | Unset = UNSET + communication_stage: Unset | dict[str, Any] = UNSET if not isinstance(self.communication_stage, Unset): communication_stage = self.communication_stage.to_dict() - communication_template: dict[str, Any] | Unset = UNSET + communication_template: Unset | dict[str, Any] = UNSET if not isinstance(self.communication_template, Unset): communication_template = self.communication_template.to_dict() @@ -121,39 +118,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_email_body(data: object) -> None | str | Unset: + def _parse_email_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_email_subject(data: object) -> None | str | Unset: + def _parse_email_subject(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_slack_content(data: object) -> None | str | Unset: + def _parse_slack_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) - def _parse_sms_content(data: object) -> None | str | Unset: + def _parse_sms_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) @@ -163,7 +160,7 @@ def _parse_sms_content(data: object) -> None | str | Unset: _communication_stage = d.pop("communication_stage", UNSET) communication_stage: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage | Unset + Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage ) if isinstance(_communication_stage, Unset): communication_stage = UNSET @@ -176,7 +173,7 @@ def _parse_sms_content(data: object) -> None | str | Unset: _communication_template = d.pop("communication_template", UNSET) communication_template: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset + Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate ) if isinstance(_communication_template, Unset): communication_template = UNSET diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py index 9d3a2edc..aa63f20b 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage: """ Attributes: - id (str | Unset): The communication stage ID - name (str | Unset): The communication stage name + id (Union[Unset, str]): The communication stage ID + name (Union[Unset, str]): The communication stage name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py index b490ec24..b5b69095 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate: """ Attributes: - id (str | Unset): The communication template ID - name (str | Unset): The communication template name + id (Union[Unset, str]): The communication template ID + name (Union[Unset, str]): The communication template name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_communication_type.py b/rootly_sdk/models/communications_template_communication_type.py index c4b73f8c..48cfce89 100644 --- a/rootly_sdk/models/communications_template_communication_type.py +++ b/rootly_sdk/models/communications_template_communication_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CommunicationsTemplateCommunicationType: """ Attributes: - id (str | Unset): ID of the communication type - name (str | Unset): Name of the communication type + id (Union[Unset, str]): ID of the communication type + name (Union[Unset, str]): Name of the communication type """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_response.py b/rootly_sdk/models/communications_template_response.py index ad97411a..cf3d8f2c 100644 --- a/rootly_sdk/models/communications_template_response.py +++ b/rootly_sdk/models/communications_template_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CommunicationsTemplateResponse: """ Attributes: data (CommunicationsTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsTemplateResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_template_response = cls( data=data, diff --git a/rootly_sdk/models/communications_template_response_data.py b/rootly_sdk/models/communications_template_response_data.py index a5f60679..26697651 100644 --- a/rootly_sdk/models/communications_template_response_data.py +++ b/rootly_sdk/models/communications_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTemplateResponseData: id: str type_: CommunicationsTemplateResponseDataType - attributes: CommunicationsTemplate + attributes: "CommunicationsTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_templates_response.py b/rootly_sdk/models/communications_templates_response.py index c8d4f769..8b0365e3 100644 --- a/rootly_sdk/models/communications_templates_response.py +++ b/rootly_sdk/models/communications_templates_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsTemplatesResponse: """ Attributes: - data (list[CommunicationsTemplatesResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsTemplatesResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsTemplatesResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsTemplatesResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_templates_response = cls( data=data, diff --git a/rootly_sdk/models/communications_templates_response_data_item.py b/rootly_sdk/models/communications_templates_response_data_item.py index 1c42e544..f3bcaee6 100644 --- a/rootly_sdk/models/communications_templates_response_data_item.py +++ b/rootly_sdk/models/communications_templates_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTemplatesResponseDataItem: id: str type_: CommunicationsTemplatesResponseDataItemType - attributes: CommunicationsTemplate + attributes: "CommunicationsTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_type.py b/rootly_sdk/models/communications_type.py index 0323e1ec..4574bcae 100644 --- a/rootly_sdk/models/communications_type.py +++ b/rootly_sdk/models/communications_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,12 +14,12 @@ class CommunicationsType: """ Attributes: name (str): The name of the communications type - color (None | str): The color of the communications type + color (Union[None, str]): The color of the communications type position (int): Position of the communications type created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications type - description (None | str | Unset): The description of the communications type + slug (Union[Unset, str]): The slug of the communications type + description (Union[None, Unset, str]): The description of the communications type """ name: str @@ -29,8 +27,8 @@ class CommunicationsType: position: int created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -91,12 +89,12 @@ def _parse_color(data: object) -> None | str: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/communications_type_response.py b/rootly_sdk/models/communications_type_response.py index 87a0439a..89cfbca7 100644 --- a/rootly_sdk/models/communications_type_response.py +++ b/rootly_sdk/models/communications_type_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CommunicationsTypeResponse: """ Attributes: data (CommunicationsTypeResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsTypeResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsTypeResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsTypeResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_type_response = cls( data=data, diff --git a/rootly_sdk/models/communications_type_response_data.py b/rootly_sdk/models/communications_type_response_data.py index f37e6746..9d97ff64 100644 --- a/rootly_sdk/models/communications_type_response_data.py +++ b/rootly_sdk/models/communications_type_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTypeResponseData: id: str type_: CommunicationsTypeResponseDataType - attributes: CommunicationsType + attributes: "CommunicationsType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_types_response.py b/rootly_sdk/models/communications_types_response.py index adbf3c58..d2583e16 100644 --- a/rootly_sdk/models/communications_types_response.py +++ b/rootly_sdk/models/communications_types_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsTypesResponse: """ Attributes: - data (list[CommunicationsTypesResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsTypesResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsTypesResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsTypesResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_types_response = cls( data=data, diff --git a/rootly_sdk/models/communications_types_response_data_item.py b/rootly_sdk/models/communications_types_response_data_item.py index 21bd7214..ad9a0474 100644 --- a/rootly_sdk/models/communications_types_response_data_item.py +++ b/rootly_sdk/models/communications_types_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTypesResponseDataItem: id: str type_: CommunicationsTypesResponseDataItemType - attributes: CommunicationsType + attributes: "CommunicationsType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/create_airtable_table_record_task_params.py b/rootly_sdk/models/create_airtable_table_record_task_params.py index 61670f3d..02aa62ba 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -26,28 +24,27 @@ class CreateAirtableTableRecordTaskParams: Attributes: base (CreateAirtableTableRecordTaskParamsBase): table (CreateAirtableTableRecordTaskParamsTable): - task_type (CreateAirtableTableRecordTaskParamsTaskType | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateAirtableTableRecordTaskParamsTaskType]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ - base: CreateAirtableTableRecordTaskParamsBase - table: CreateAirtableTableRecordTaskParamsTable - task_type: CreateAirtableTableRecordTaskParamsTaskType | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + base: "CreateAirtableTableRecordTaskParamsBase" + table: "CreateAirtableTableRecordTaskParamsTable" + task_type: Unset | CreateAirtableTableRecordTaskParamsTaskType = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - base = self.base.to_dict() table = self.table.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -79,18 +76,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table = CreateAirtableTableRecordTaskParamsTable.from_dict(d.pop("table")) _task_type = d.pop("task_type", UNSET) - task_type: CreateAirtableTableRecordTaskParamsTaskType | Unset + task_type: Unset | CreateAirtableTableRecordTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_airtable_table_record_task_params_task_type(_task_type) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_airtable_table_record_task_params_base.py b/rootly_sdk/models/create_airtable_table_record_task_params_base.py index f8402d23..e4dac884 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_base.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_base.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateAirtableTableRecordTaskParamsBase: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_airtable_table_record_task_params_table.py b/rootly_sdk/models/create_airtable_table_record_task_params_table.py index dc5d3a10..77f8f3bb 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_table.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_table.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateAirtableTableRecordTaskParamsTable: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py index fe2527e4..9bae2c8b 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,28 +23,31 @@ class CreateAnthropicChatCompletionTaskParams: Attributes: model (CreateAnthropicChatCompletionTaskParamsModel): The Anthropic model. eg: claude-3-5-sonnet-20241022 prompt (str): The prompt to send to Anthropic - task_type (CreateAnthropicChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to Anthropic (optional) + task_type (Union[Unset, CreateAnthropicChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to Anthropic (optional) + max_tokens (Union[Unset, int]): Maximum number of tokens to generate. Defaults to 4000 when omitted """ - model: CreateAnthropicChatCompletionTaskParamsModel + model: "CreateAnthropicChatCompletionTaskParamsModel" prompt: str - task_type: CreateAnthropicChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET + task_type: Unset | CreateAnthropicChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET + max_tokens: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type system_prompt = self.system_prompt + max_tokens = self.max_tokens + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -59,6 +60,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["task_type"] = task_type if system_prompt is not UNSET: field_dict["system_prompt"] = system_prompt + if max_tokens is not UNSET: + field_dict["max_tokens"] = max_tokens return field_dict @@ -74,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateAnthropicChatCompletionTaskParamsTaskType | Unset + task_type: Unset | CreateAnthropicChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -82,11 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: system_prompt = d.pop("system_prompt", UNSET) + max_tokens = d.pop("max_tokens", UNSET) + create_anthropic_chat_completion_task_params = cls( model=model, prompt=prompt, task_type=task_type, system_prompt=system_prompt, + max_tokens=max_tokens, ) create_anthropic_chat_completion_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py index 0d5723dd..9eeddadf 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateAnthropicChatCompletionTaskParamsModel: """The Anthropic model. eg: claude-3-5-sonnet-20241022 Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_subtask_task_params.py b/rootly_sdk/models/create_asana_subtask_task_params.py index 3c379f45..fc23a420 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params.py +++ b/rootly_sdk/models/create_asana_subtask_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,37 +28,36 @@ class CreateAsanaSubtaskTaskParams: parent_task_id (str): The parent task id title (str): The subtask title completion (CreateAsanaSubtaskTaskParamsCompletion): - task_type (CreateAsanaSubtaskTaskParamsTaskType | Unset): - notes (str | Unset): - assign_user_email (str | Unset): The assigned user's email - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateAsanaSubtaskTaskParamsTaskType]): + notes (Union[Unset, str]): + assign_user_email (Union[Unset, str]): The assigned user's email + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - dependency_direction (CreateAsanaSubtaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. - dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax + dependency_direction (Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection]): Default: 'blocking'. + dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax """ parent_task_id: str title: str - completion: CreateAsanaSubtaskTaskParamsCompletion - task_type: CreateAsanaSubtaskTaskParamsTaskType | Unset = UNSET - notes: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - dependency_direction: CreateAsanaSubtaskTaskParamsDependencyDirection | Unset = "blocking" - dependent_task_ids: list[str] | None | Unset = UNSET + completion: "CreateAsanaSubtaskTaskParamsCompletion" + task_type: Unset | CreateAsanaSubtaskTaskParamsTaskType = UNSET + notes: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + dependency_direction: Unset | CreateAsanaSubtaskTaskParamsDependencyDirection = "blocking" + dependent_task_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - parent_task_id = self.parent_task_id title = self.title completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,17 +67,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: str | Unset = UNSET + dependency_direction: Unset | str = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: list[str] | None | Unset + dependent_task_ids: None | Unset | list[str] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -127,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateAsanaSubtaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: CreateAsanaSubtaskTaskParamsTaskType | Unset + task_type: Unset | CreateAsanaSubtaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -139,23 +136,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: CreateAsanaSubtaskTaskParamsDependencyDirection | Unset + dependency_direction: Unset | CreateAsanaSubtaskTaskParamsDependencyDirection if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_create_asana_subtask_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: + def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -166,9 +163,9 @@ def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/create_asana_subtask_task_params_completion.py b/rootly_sdk/models/create_asana_subtask_task_params_completion.py index 1bd94c1d..a4a99573 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params_completion.py +++ b/rootly_sdk/models/create_asana_subtask_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateAsanaSubtaskTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params.py b/rootly_sdk/models/create_asana_task_task_params.py index 173324ea..cfb6cc5c 100644 --- a/rootly_sdk/models/create_asana_task_task_params.py +++ b/rootly_sdk/models/create_asana_task_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,34 +28,33 @@ class CreateAsanaTaskTaskParams: """ Attributes: workspace (CreateAsanaTaskTaskParamsWorkspace): - projects (list[CreateAsanaTaskTaskParamsProjectsItem]): + projects (list['CreateAsanaTaskTaskParamsProjectsItem']): title (str): The task title completion (CreateAsanaTaskTaskParamsCompletion): - task_type (CreateAsanaTaskTaskParamsTaskType | Unset): - notes (str | Unset): - assign_user_email (str | Unset): The assigned user's email - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateAsanaTaskTaskParamsTaskType]): + notes (Union[Unset, str]): + assign_user_email (Union[Unset, str]): The assigned user's email + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - dependency_direction (CreateAsanaTaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. - dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax + dependency_direction (Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection]): Default: 'blocking'. + dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax """ - workspace: CreateAsanaTaskTaskParamsWorkspace - projects: list[CreateAsanaTaskTaskParamsProjectsItem] + workspace: "CreateAsanaTaskTaskParamsWorkspace" + projects: list["CreateAsanaTaskTaskParamsProjectsItem"] title: str - completion: CreateAsanaTaskTaskParamsCompletion - task_type: CreateAsanaTaskTaskParamsTaskType | Unset = UNSET - notes: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - dependency_direction: CreateAsanaTaskTaskParamsDependencyDirection | Unset = "blocking" - dependent_task_ids: list[str] | None | Unset = UNSET + completion: "CreateAsanaTaskTaskParamsCompletion" + task_type: Unset | CreateAsanaTaskTaskParamsTaskType = UNSET + notes: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + dependency_direction: Unset | CreateAsanaTaskTaskParamsDependencyDirection = "blocking" + dependent_task_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workspace = self.workspace.to_dict() projects = [] @@ -69,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,17 +76,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: str | Unset = UNSET + dependency_direction: Unset | str = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: list[str] | None | Unset + dependent_task_ids: None | Unset | list[str] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -146,7 +143,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateAsanaTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: CreateAsanaTaskTaskParamsTaskType | Unset + task_type: Unset | CreateAsanaTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -158,23 +155,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: CreateAsanaTaskTaskParamsDependencyDirection | Unset + dependency_direction: Unset | CreateAsanaTaskTaskParamsDependencyDirection if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_create_asana_task_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: + def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -185,9 +182,9 @@ def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/create_asana_task_task_params_completion.py b/rootly_sdk/models/create_asana_task_task_params_completion.py index 11ef1e82..a64d8b2b 100644 --- a/rootly_sdk/models/create_asana_task_task_params_completion.py +++ b/rootly_sdk/models/create_asana_task_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateAsanaTaskTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params_projects_item.py b/rootly_sdk/models/create_asana_task_task_params_projects_item.py index 41cafec6..88723252 100644 --- a/rootly_sdk/models/create_asana_task_task_params_projects_item.py +++ b/rootly_sdk/models/create_asana_task_task_params_projects_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateAsanaTaskTaskParamsProjectsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params_workspace.py b/rootly_sdk/models/create_asana_task_task_params_workspace.py index 4359c902..e21ea450 100644 --- a/rootly_sdk/models/create_asana_task_task_params_workspace.py +++ b/rootly_sdk/models/create_asana_task_task_params_workspace.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateAsanaTaskTaskParamsWorkspace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_clickup_task_task_params.py b/rootly_sdk/models/create_clickup_task_task_params.py index 9231249b..c7857b0d 100644 --- a/rootly_sdk/models/create_clickup_task_task_params.py +++ b/rootly_sdk/models/create_clickup_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -13,6 +11,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.create_clickup_task_task_params_list import CreateClickupTaskTaskParamsList from ..models.create_clickup_task_task_params_priority import CreateClickupTaskTaskParamsPriority @@ -24,32 +23,35 @@ class CreateClickupTaskTaskParams: """ Attributes: title (str): The task title - task_type (CreateClickupTaskTaskParamsTaskType | Unset): - description (str | Unset): The task description - tags (str | Unset): The task tags - priority (CreateClickupTaskTaskParamsPriority | Unset): The priority id and display name - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + list_ (CreateClickupTaskTaskParamsList): + task_type (Union[Unset, CreateClickupTaskTaskParamsTaskType]): + description (Union[Unset, str]): The task description + tags (Union[Unset, str]): The task tags + priority (Union[Unset, CreateClickupTaskTaskParamsPriority]): The priority id and display name + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - task_payload (None | str | Unset): Additional ClickUp task attributes. Will be merged into whatever was + task_payload (Union[None, Unset, str]): Additional ClickUp task attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ title: str - task_type: CreateClickupTaskTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - tags: str | Unset = UNSET - priority: CreateClickupTaskTaskParamsPriority | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - task_payload: None | str | Unset = UNSET + list_: "CreateClickupTaskTaskParamsList" + task_type: Unset | CreateClickupTaskTaskParamsTaskType = UNSET + description: Unset | str = UNSET + tags: Unset | str = UNSET + priority: Union[Unset, "CreateClickupTaskTaskParamsPriority"] = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + task_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + list_ = self.list_.to_dict() + + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,19 +59,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: None | str | Unset + task_payload: None | Unset | str if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -80,6 +82,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "title": title, + "list": list_, } ) if task_type is not UNSET: @@ -101,13 +104,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_clickup_task_task_params_list import CreateClickupTaskTaskParamsList from ..models.create_clickup_task_task_params_priority import CreateClickupTaskTaskParamsPriority d = dict(src_dict) title = d.pop("title") + list_ = CreateClickupTaskTaskParamsList.from_dict(d.pop("list")) + _task_type = d.pop("task_type", UNSET) - task_type: CreateClickupTaskTaskParamsTaskType | Unset + task_type: Unset | CreateClickupTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -118,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateClickupTaskTaskParamsPriority | Unset + priority: Unset | CreateClickupTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -126,26 +132,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> None | str | Unset: + def _parse_task_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) create_clickup_task_task_params = cls( title=title, + list_=list_, task_type=task_type, description=description, tags=tags, diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_user_target.py b/rootly_sdk/models/create_clickup_task_task_params_list.py similarity index 75% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_user_target.py rename to rootly_sdk/models/create_clickup_task_task_params_list.py index e0a79a33..9ca1035e 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_user_target.py +++ b/rootly_sdk/models/create_clickup_task_task_params_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -8,19 +6,19 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsUserTarget") +T = TypeVar("T", bound="CreateClickupTaskTaskParamsList") @_attrs_define -class AutoAssignRoleRootlyTaskParamsUserTarget: +class CreateClickupTaskTaskParamsList: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_user_target = cls( + create_clickup_task_task_params_list = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_user_target.additional_properties = d - return auto_assign_role_rootly_task_params_user_target + create_clickup_task_task_params_list.additional_properties = d + return create_clickup_task_task_params_list @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/create_clickup_task_task_params_priority.py b/rootly_sdk/models/create_clickup_task_task_params_priority.py index 34e2271a..21c4a7c6 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/create_clickup_task_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateClickupTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_coda_page_task_params.py b/rootly_sdk/models/create_coda_page_task_params.py index 4d8fb030..6819d148 100644 --- a/rootly_sdk/models/create_coda_page_task_params.py +++ b/rootly_sdk/models/create_coda_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,32 +23,31 @@ class CreateCodaPageTaskParams: """ Attributes: title (str): The Coda page title - task_type (CreateCodaPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - subtitle (str | Unset): The Coda page subtitle - content (str | Unset): The Coda page content - template (CreateCodaPageTaskParamsTemplate | Unset): - folder_id (str | Unset): The Coda folder id - doc (CreateCodaPageTaskParamsDoc | Unset): The Coda doc object with id and name + task_type (Union[Unset, CreateCodaPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + subtitle (Union[Unset, str]): The Coda page subtitle + content (Union[Unset, str]): The Coda page content + template (Union[Unset, CreateCodaPageTaskParamsTemplate]): + folder_id (Union[Unset, str]): The Coda folder id + doc (Union[Unset, CreateCodaPageTaskParamsDoc]): The Coda doc object with id and name """ title: str - task_type: CreateCodaPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - subtitle: str | Unset = UNSET - content: str | Unset = UNSET - template: CreateCodaPageTaskParamsTemplate | Unset = UNSET - folder_id: str | Unset = UNSET - doc: CreateCodaPageTaskParamsDoc | Unset = UNSET + task_type: Unset | CreateCodaPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + subtitle: Unset | str = UNSET + content: Unset | str = UNSET + template: Union[Unset, "CreateCodaPageTaskParamsTemplate"] = UNSET + folder_id: Unset | str = UNSET + doc: Union[Unset, "CreateCodaPageTaskParamsDoc"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,13 +59,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: dict[str, Any] | Unset = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() folder_id = self.folder_id - doc: dict[str, Any] | Unset = UNSET + doc: Unset | dict[str, Any] = UNSET if not isinstance(self.doc, Unset): doc = self.doc.to_dict() @@ -107,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateCodaPageTaskParamsTaskType | Unset + task_type: Unset | CreateCodaPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -122,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: CreateCodaPageTaskParamsTemplate | Unset + template: Unset | CreateCodaPageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: @@ -131,7 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: folder_id = d.pop("folder_id", UNSET) _doc = d.pop("doc", UNSET) - doc: CreateCodaPageTaskParamsDoc | Unset + doc: Unset | CreateCodaPageTaskParamsDoc if isinstance(_doc, Unset): doc = UNSET else: diff --git a/rootly_sdk/models/create_coda_page_task_params_doc.py b/rootly_sdk/models/create_coda_page_task_params_doc.py index ea0354bb..ae70fa93 100644 --- a/rootly_sdk/models/create_coda_page_task_params_doc.py +++ b/rootly_sdk/models/create_coda_page_task_params_doc.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateCodaPageTaskParamsDoc: """The Coda doc object with id and name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_coda_page_task_params_template.py b/rootly_sdk/models/create_coda_page_task_params_template.py index b2b94318..54bfee21 100644 --- a/rootly_sdk/models/create_coda_page_task_params_template.py +++ b/rootly_sdk/models/create_coda_page_task_params_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateCodaPageTaskParamsTemplate: """ Attributes: - id (str | Unset): Combined doc_id/page_id in format 'doc_id/page_id' - name (str | Unset): + id (Union[Unset, str]): Combined doc_id/page_id in format 'doc_id/page_id' + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params.py b/rootly_sdk/models/create_confluence_page_task_params.py index f1cb980e..b05a3656 100644 --- a/rootly_sdk/models/create_confluence_page_task_params.py +++ b/rootly_sdk/models/create_confluence_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,52 +26,53 @@ class CreateConfluencePageTaskParams: Attributes: space (CreateConfluencePageTaskParamsSpace): title (str): The page title - task_type (CreateConfluencePageTaskParamsTaskType | Unset): - integration (CreateConfluencePageTaskParamsIntegration | Unset): Specify integration id if you have more than - one Confluence instance - ancestor (CreateConfluencePageTaskParamsAncestor | Unset): - template (CreateConfluencePageTaskParamsTemplate | Unset): - content (str | Unset): The page content - post_mortem_template_id (str | Unset): The Retrospective template to use - mark_post_mortem_as_published (bool | Unset): Default: True. - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. - create_as_live_doc (bool | Unset): Default: False. + task_type (Union[Unset, CreateConfluencePageTaskParamsTaskType]): + integration (Union[Unset, CreateConfluencePageTaskParamsIntegration]): Specify integration id if you have more + than one Confluence instance + ancestor (Union[Unset, CreateConfluencePageTaskParamsAncestor]): + template (Union[Unset, CreateConfluencePageTaskParamsTemplate]): + content (Union[Unset, str]): The page content + post_mortem_template_id (Union[Unset, str]): The Retrospective template to use + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. + create_as_live_doc (Union[Unset, bool]): Default: False. """ - space: CreateConfluencePageTaskParamsSpace + space: "CreateConfluencePageTaskParamsSpace" title: str - task_type: CreateConfluencePageTaskParamsTaskType | Unset = UNSET - integration: CreateConfluencePageTaskParamsIntegration | Unset = UNSET - ancestor: CreateConfluencePageTaskParamsAncestor | Unset = UNSET - template: CreateConfluencePageTaskParamsTemplate | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - include_overview: bool | Unset = True - include_timeline: bool | Unset = True - create_as_live_doc: bool | Unset = False + task_type: Unset | CreateConfluencePageTaskParamsTaskType = UNSET + integration: Union[Unset, "CreateConfluencePageTaskParamsIntegration"] = UNSET + ancestor: Union[Unset, "CreateConfluencePageTaskParamsAncestor"] = UNSET + template: Union[Unset, "CreateConfluencePageTaskParamsTemplate"] = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True + create_as_live_doc: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() - ancestor: dict[str, Any] | Unset = UNSET + ancestor: Unset | dict[str, Any] = UNSET if not isinstance(self.ancestor, Unset): ancestor = self.ancestor.to_dict() - template: dict[str, Any] | Unset = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -87,6 +86,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + create_as_live_doc = self.create_as_live_doc field_dict: dict[str, Any] = {} @@ -115,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups if create_as_live_doc is not UNSET: field_dict["create_as_live_doc"] = create_as_live_doc @@ -133,28 +136,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateConfluencePageTaskParamsTaskType | Unset + task_type: Unset | CreateConfluencePageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_confluence_page_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: CreateConfluencePageTaskParamsIntegration | Unset + integration: Unset | CreateConfluencePageTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: integration = CreateConfluencePageTaskParamsIntegration.from_dict(_integration) _ancestor = d.pop("ancestor", UNSET) - ancestor: CreateConfluencePageTaskParamsAncestor | Unset + ancestor: Unset | CreateConfluencePageTaskParamsAncestor if isinstance(_ancestor, Unset): ancestor = UNSET else: ancestor = CreateConfluencePageTaskParamsAncestor.from_dict(_ancestor) _template = d.pop("template", UNSET) - template: CreateConfluencePageTaskParamsTemplate | Unset + template: Unset | CreateConfluencePageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: @@ -170,6 +173,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + create_as_live_doc = d.pop("create_as_live_doc", UNSET) create_confluence_page_task_params = cls( @@ -184,6 +189,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published=mark_post_mortem_as_published, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, create_as_live_doc=create_as_live_doc, ) diff --git a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py index 2ce7713b..42829d65 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py +++ b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateConfluencePageTaskParamsAncestor: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_integration.py b/rootly_sdk/models/create_confluence_page_task_params_integration.py index 8414aaf5..0479d651 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/create_confluence_page_task_params_integration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateConfluencePageTaskParamsIntegration: """Specify integration id if you have more than one Confluence instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_space.py b/rootly_sdk/models/create_confluence_page_task_params_space.py index a5ac23bd..2e7b2651 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_space.py +++ b/rootly_sdk/models/create_confluence_page_task_params_space.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateConfluencePageTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_template.py b/rootly_sdk/models/create_confluence_page_task_params_template.py index 3c78e534..4b7df4c3 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_template.py +++ b/rootly_sdk/models/create_confluence_page_task_params_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateConfluencePageTaskParamsTemplate: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params.py b/rootly_sdk/models/create_datadog_notebook_task_params.py index 02c1c0ae..bf7881c1 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,29 +27,28 @@ class CreateDatadogNotebookTaskParams: Attributes: title (str): The notebook title kind (CreateDatadogNotebookTaskParamsKind): The notebook kind - task_type (CreateDatadogNotebookTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating notebook, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - template (CreateDatadogNotebookTaskParamsTemplate | Unset): - content (str | Unset): The notebook content + task_type (Union[Unset, CreateDatadogNotebookTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating notebook, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + template (Union[Unset, CreateDatadogNotebookTaskParamsTemplate]): + content (Union[Unset, str]): The notebook content """ title: str kind: CreateDatadogNotebookTaskParamsKind - task_type: CreateDatadogNotebookTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - template: CreateDatadogNotebookTaskParamsTemplate | Unset = UNSET - content: str | Unset = UNSET + task_type: Unset | CreateDatadogNotebookTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + template: Union[Unset, "CreateDatadogNotebookTaskParamsTemplate"] = UNSET + content: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title kind: str = self.kind - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - template: dict[str, Any] | Unset = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -96,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_create_datadog_notebook_task_params_kind(d.pop("kind")) _task_type = d.pop("task_type", UNSET) - task_type: CreateDatadogNotebookTaskParamsTaskType | Unset + task_type: Unset | CreateDatadogNotebookTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -107,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _template = d.pop("template", UNSET) - template: CreateDatadogNotebookTaskParamsTemplate | Unset + template: Unset | CreateDatadogNotebookTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params_template.py b/rootly_sdk/models/create_datadog_notebook_task_params_template.py index 1ba885b5..7191fa50 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateDatadogNotebookTaskParamsTemplate: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params.py b/rootly_sdk/models/create_dropbox_paper_page_task_params.py index 415cf46f..4fcdee63 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,28 +25,27 @@ class CreateDropboxPaperPageTaskParams: """ Attributes: title (str): The page task title - task_type (CreateDropboxPaperPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page task, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - content (str | Unset): The page content - namespace (CreateDropboxPaperPageTaskParamsNamespace | Unset): - parent_folder (CreateDropboxPaperPageTaskParamsParentFolder | Unset): + task_type (Union[Unset, CreateDropboxPaperPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page task, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + content (Union[Unset, str]): The page content + namespace (Union[Unset, CreateDropboxPaperPageTaskParamsNamespace]): + parent_folder (Union[Unset, CreateDropboxPaperPageTaskParamsParentFolder]): """ title: str - task_type: CreateDropboxPaperPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - content: str | Unset = UNSET - namespace: CreateDropboxPaperPageTaskParamsNamespace | Unset = UNSET - parent_folder: CreateDropboxPaperPageTaskParamsParentFolder | Unset = UNSET + task_type: Unset | CreateDropboxPaperPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + content: Unset | str = UNSET + namespace: Union[Unset, "CreateDropboxPaperPageTaskParamsNamespace"] = UNSET + parent_folder: Union[Unset, "CreateDropboxPaperPageTaskParamsParentFolder"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: content = self.content - namespace: dict[str, Any] | Unset = UNSET + namespace: Unset | dict[str, Any] = UNSET if not isinstance(self.namespace, Unset): namespace = self.namespace.to_dict() - parent_folder: dict[str, Any] | Unset = UNSET + parent_folder: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -99,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateDropboxPaperPageTaskParamsTaskType | Unset + task_type: Unset | CreateDropboxPaperPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -112,14 +109,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _namespace = d.pop("namespace", UNSET) - namespace: CreateDropboxPaperPageTaskParamsNamespace | Unset + namespace: Unset | CreateDropboxPaperPageTaskParamsNamespace if isinstance(_namespace, Unset): namespace = UNSET else: namespace = CreateDropboxPaperPageTaskParamsNamespace.from_dict(_namespace) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: CreateDropboxPaperPageTaskParamsParentFolder | Unset + parent_folder: Unset | CreateDropboxPaperPageTaskParamsParentFolder if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py index 9a83f04b..93b1ef98 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateDropboxPaperPageTaskParamsNamespace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py index 5c31099d..ca4e271f 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateDropboxPaperPageTaskParamsParentFolder: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_edge_connector_action_body.py b/rootly_sdk/models/create_edge_connector_action_body.py index 72e8c61c..b5e7af64 100644 --- a/rootly_sdk/models/create_edge_connector_action_body.py +++ b/rootly_sdk/models/create_edge_connector_action_body.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class CreateEdgeConnectorActionBody: """ Attributes: - action (CreateEdgeConnectorActionBodyAction | Unset): + action (Union[Unset, CreateEdgeConnectorActionBodyAction]): """ - action: CreateEdgeConnectorActionBodyAction | Unset = UNSET + action: Union[Unset, "CreateEdgeConnectorActionBodyAction"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - action: dict[str, Any] | Unset = UNSET + action: Unset | dict[str, Any] = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: CreateEdgeConnectorActionBodyAction | Unset + action: Unset | CreateEdgeConnectorActionBodyAction if isinstance(_action, Unset): action = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action.py b/rootly_sdk/models/create_edge_connector_action_body_action.py index f8fedce0..47bc8d5a 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class CreateEdgeConnectorActionBodyAction: Attributes: name (str): Action name action_type (CreateEdgeConnectorActionBodyActionActionType): Action type - metadata (CreateEdgeConnectorActionBodyActionMetadata | Unset): + metadata (Union[Unset, CreateEdgeConnectorActionBodyActionMetadata]): """ name: str action_type: CreateEdgeConnectorActionBodyActionActionType - metadata: CreateEdgeConnectorActionBodyActionMetadata | Unset = UNSET + metadata: Union[Unset, "CreateEdgeConnectorActionBodyActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name action_type: str = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -68,7 +65,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_type = check_create_edge_connector_action_body_action_action_type(d.pop("action_type")) _metadata = d.pop("metadata", UNSET) - metadata: CreateEdgeConnectorActionBodyActionMetadata | Unset + metadata: Unset | CreateEdgeConnectorActionBodyActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py index 46132686..e32305e3 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,23 +19,22 @@ class CreateEdgeConnectorActionBodyActionMetadata: """ Attributes: - description (str | Unset): - timeout (int | Unset): - parameters (list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset): + description (Union[Unset, str]): + timeout (Union[Unset, int]): + parameters (Union[Unset, list['CreateEdgeConnectorActionBodyActionMetadataParametersItem']]): """ - description: str | Unset = UNSET - timeout: int | Unset = UNSET - parameters: list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset = UNSET + description: Unset | str = UNSET + timeout: Unset | int = UNSET + parameters: Unset | list["CreateEdgeConnectorActionBodyActionMetadataParametersItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - description = self.description timeout = self.timeout - parameters: list[dict[str, Any]] | Unset = UNSET + parameters: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: @@ -67,16 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: timeout = d.pop("timeout", UNSET) + parameters = [] _parameters = d.pop("parameters", UNSET) - parameters: list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset = UNSET - if _parameters is not UNSET: - parameters = [] - for parameters_item_data in _parameters: - parameters_item = CreateEdgeConnectorActionBodyActionMetadataParametersItem.from_dict( - parameters_item_data - ) + for parameters_item_data in _parameters or []: + parameters_item = CreateEdgeConnectorActionBodyActionMetadataParametersItem.from_dict(parameters_item_data) - parameters.append(parameters_item) + parameters.append(parameters_item) create_edge_connector_action_body_action_metadata = cls( description=description, diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py index f6694bc1..8da7d329 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,24 +17,24 @@ class CreateEdgeConnectorActionBodyActionMetadataParametersItem: """ Attributes: - name (str | Unset): - type_ (CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset): - required (bool | Unset): - description (str | Unset): - options (list[str] | Unset): + name (Union[Unset, str]): + type_ (Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType]): + required (Union[Unset, bool]): + description (Union[Unset, str]): + options (Union[Unset, list[str]]): """ - name: str | Unset = UNSET - type_: CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset = UNSET - required: bool | Unset = UNSET - description: str | Unset = UNSET - options: list[str] | Unset = UNSET + name: Unset | str = UNSET + type_: Unset | CreateEdgeConnectorActionBodyActionMetadataParametersItemType = UNSET + required: Unset | bool = UNSET + description: Unset | str = UNSET + options: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -44,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - options: list[str] | Unset = UNSET + options: Unset | list[str] = UNSET if not isinstance(self.options, Unset): options = self.options @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset + type_: Unset | CreateEdgeConnectorActionBodyActionMetadataParametersItemType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_body.py b/rootly_sdk/models/create_edge_connector_body.py index 26b01395..d0719ab5 100644 --- a/rootly_sdk/models/create_edge_connector_body.py +++ b/rootly_sdk/models/create_edge_connector_body.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class CreateEdgeConnectorBody: data (CreateEdgeConnectorBodyData): """ - data: CreateEdgeConnectorBodyData + data: "CreateEdgeConnectorBodyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/create_edge_connector_body_data.py b/rootly_sdk/models/create_edge_connector_body_data.py index a9d31183..744f7e51 100644 --- a/rootly_sdk/models/create_edge_connector_body_data.py +++ b/rootly_sdk/models/create_edge_connector_body_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class CreateEdgeConnectorBodyData: """ type_: CreateEdgeConnectorBodyDataType - attributes: CreateEdgeConnectorBodyDataAttributes + attributes: "CreateEdgeConnectorBodyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes.py b/rootly_sdk/models/create_edge_connector_body_data_attributes.py index 5731ed4c..68321be2 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,35 +22,34 @@ class CreateEdgeConnectorBodyDataAttributes: """ Attributes: name (str): Connector name - description (str | Unset): Connector description - status (CreateEdgeConnectorBodyDataAttributesStatus | Unset): Connector status - subscriptions (list[str] | Unset): Array of event types to subscribe to - filters (CreateEdgeConnectorBodyDataAttributesFilters | Unset): Event filters. OR within dimension, AND across - dimensions. + description (Union[Unset, str]): Connector description + status (Union[Unset, CreateEdgeConnectorBodyDataAttributesStatus]): Connector status + subscriptions (Union[Unset, list[str]]): Array of event types to subscribe to + filters (Union[Unset, CreateEdgeConnectorBodyDataAttributesFilters]): Event filters. OR within dimension, AND + across dimensions. """ name: str - description: str | Unset = UNSET - status: CreateEdgeConnectorBodyDataAttributesStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET - filters: CreateEdgeConnectorBodyDataAttributesFilters | Unset = UNSET + description: Unset | str = UNSET + status: Unset | CreateEdgeConnectorBodyDataAttributesStatus = UNSET + subscriptions: Unset | list[str] = UNSET + filters: Union[Unset, "CreateEdgeConnectorBodyDataAttributesFilters"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name description = self.description - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: dict[str, Any] | Unset = UNSET + filters: Unset | dict[str, Any] = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -86,7 +83,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: CreateEdgeConnectorBodyDataAttributesStatus | Unset + status: Unset | CreateEdgeConnectorBodyDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: @@ -95,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) _filters = d.pop("filters", UNSET) - filters: CreateEdgeConnectorBodyDataAttributesFilters | Unset + filters: Unset | CreateEdgeConnectorBodyDataAttributesFilters if isinstance(_filters, Unset): filters = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py b/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py index 14497423..c28b2f7b 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,31 +13,31 @@ class CreateEdgeConnectorBodyDataAttributesFilters: """Event filters. OR within dimension, AND across dimensions. Attributes: - group_ids (list[str] | Unset): Filter by group UUIDs - service_ids (list[str] | Unset): Filter by service UUIDs - environment_ids (list[str] | Unset): Filter by environment UUIDs - functionality_ids (list[str] | Unset): Filter by functionality UUIDs + group_ids (Union[Unset, list[str]]): Filter by group UUIDs + service_ids (Union[Unset, list[str]]): Filter by service UUIDs + environment_ids (Union[Unset, list[str]]): Filter by environment UUIDs + functionality_ids (Union[Unset, list[str]]): Filter by functionality UUIDs """ - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids diff --git a/rootly_sdk/models/create_github_issue_task_params.py b/rootly_sdk/models/create_github_issue_task_params.py index 26f28b7a..632aaccc 100644 --- a/rootly_sdk/models/create_github_issue_task_params.py +++ b/rootly_sdk/models/create_github_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,55 +25,54 @@ class CreateGithubIssueTaskParams: Attributes: title (str): The issue title repository (CreateGithubIssueTaskParamsRepository): - task_type (CreateGithubIssueTaskParamsTaskType | Unset): - body (str | Unset): The issue body - labels (list[CreateGithubIssueTaskParamsLabelsItem] | Unset): The issue labels - issue_type (CreateGithubIssueTaskParamsIssueType | Unset): The issue type - parent_issue_number (None | str | Unset): The parent issue number for sub-issue linking - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateGithubIssueTaskParamsTaskType]): + body (Union[Unset, str]): The issue body + labels (Union[Unset, list['CreateGithubIssueTaskParamsLabelsItem']]): The issue labels + issue_type (Union[Unset, CreateGithubIssueTaskParamsIssueType]): The issue type + parent_issue_number (Union[None, Unset, str]): The parent issue number for sub-issue linking + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ title: str - repository: CreateGithubIssueTaskParamsRepository - task_type: CreateGithubIssueTaskParamsTaskType | Unset = UNSET - body: str | Unset = UNSET - labels: list[CreateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - issue_type: CreateGithubIssueTaskParamsIssueType | Unset = UNSET - parent_issue_number: None | str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + repository: "CreateGithubIssueTaskParamsRepository" + task_type: Unset | CreateGithubIssueTaskParamsTaskType = UNSET + body: Unset | str = UNSET + labels: Unset | list["CreateGithubIssueTaskParamsLabelsItem"] = UNSET + issue_type: Union[Unset, "CreateGithubIssueTaskParamsIssueType"] = UNSET + parent_issue_number: None | Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title repository = self.repository.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type body = self.body - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - issue_type: dict[str, Any] | Unset = UNSET + issue_type: Unset | dict[str, Any] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - parent_issue_number: None | str | Unset + parent_issue_number: None | Unset | str if isinstance(self.parent_issue_number, Unset): parent_issue_number = UNSET else: parent_issue_number = self.parent_issue_number - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -116,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: repository = CreateGithubIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: CreateGithubIssueTaskParamsTaskType | Unset + task_type: Unset | CreateGithubIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -124,37 +121,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body", UNSET) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _issue_type = d.pop("issue_type", UNSET) - issue_type: CreateGithubIssueTaskParamsIssueType | Unset + issue_type: Unset | CreateGithubIssueTaskParamsIssueType if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = CreateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_parent_issue_number(data: object) -> None | str | Unset: + def _parse_parent_issue_number(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) parent_issue_number = _parse_parent_issue_number(d.pop("parent_issue_number", UNSET)) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_github_issue_task_params_issue_type.py b/rootly_sdk/models/create_github_issue_task_params_issue_type.py index 8dcdb1a0..161e025d 100644 --- a/rootly_sdk/models/create_github_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_github_issue_task_params_issue_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateGithubIssueTaskParamsIssueType: """The issue type Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_github_issue_task_params_labels_item.py b/rootly_sdk/models/create_github_issue_task_params_labels_item.py index ae8e2abb..d3e8c024 100644 --- a/rootly_sdk/models/create_github_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_github_issue_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGithubIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_github_issue_task_params_repository.py b/rootly_sdk/models/create_github_issue_task_params_repository.py index a46c14d5..75501b1d 100644 --- a/rootly_sdk/models/create_github_issue_task_params_repository.py +++ b/rootly_sdk/models/create_github_issue_task_params_repository.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGithubIssueTaskParamsRepository: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_gitlab_issue_task_params.py b/rootly_sdk/models/create_gitlab_issue_task_params.py index f8d4741b..ea0b548f 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,38 +25,35 @@ class CreateGitlabIssueTaskParams: """ Attributes: + issue_type (CreateGitlabIssueTaskParamsIssueType): The issue type title (str): The issue title repository (CreateGitlabIssueTaskParamsRepository): - task_type (CreateGitlabIssueTaskParamsTaskType | Unset): - issue_type (CreateGitlabIssueTaskParamsIssueType | Unset): The issue type - description (str | Unset): The issue description - labels (str | Unset): The issue labels - due_date (str | Unset): The due date + task_type (Union[Unset, CreateGitlabIssueTaskParamsTaskType]): + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + due_date (Union[Unset, str]): The due date """ + issue_type: CreateGitlabIssueTaskParamsIssueType title: str - repository: CreateGitlabIssueTaskParamsRepository - task_type: CreateGitlabIssueTaskParamsTaskType | Unset = UNSET - issue_type: CreateGitlabIssueTaskParamsIssueType | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET + repository: "CreateGitlabIssueTaskParamsRepository" + task_type: Unset | CreateGitlabIssueTaskParamsTaskType = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + issue_type: str = self.issue_type title = self.title repository = self.repository.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - issue_type: str | Unset = UNSET - if not isinstance(self.issue_type, Unset): - issue_type = self.issue_type - description = self.description labels = self.labels @@ -69,14 +64,13 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "issue_type": issue_type, "title": title, "repository": repository, } ) if task_type is not UNSET: field_dict["task_type"] = task_type - if issue_type is not UNSET: - field_dict["issue_type"] = issue_type if description is not UNSET: field_dict["description"] = description if labels is not UNSET: @@ -91,24 +85,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.create_gitlab_issue_task_params_repository import CreateGitlabIssueTaskParamsRepository d = dict(src_dict) + issue_type = check_create_gitlab_issue_task_params_issue_type(d.pop("issue_type")) + title = d.pop("title") repository = CreateGitlabIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: CreateGitlabIssueTaskParamsTaskType | Unset + task_type: Unset | CreateGitlabIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_gitlab_issue_task_params_task_type(_task_type) - _issue_type = d.pop("issue_type", UNSET) - issue_type: CreateGitlabIssueTaskParamsIssueType | Unset - if isinstance(_issue_type, Unset): - issue_type = UNSET - else: - issue_type = check_create_gitlab_issue_task_params_issue_type(_issue_type) - description = d.pop("description", UNSET) labels = d.pop("labels", UNSET) @@ -116,10 +105,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) create_gitlab_issue_task_params = cls( + issue_type=issue_type, title=title, repository=repository, task_type=task_type, - issue_type=issue_type, description=description, labels=labels, due_date=due_date, diff --git a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py index 4193b887..5b377efe 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGitlabIssueTaskParamsRepository: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_go_to_meeting_task_params.py b/rootly_sdk/models/create_go_to_meeting_task_params.py index e2ffda6c..5144ec0b 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,34 +28,34 @@ class CreateGoToMeetingTaskParams: """ Attributes: subject (str): The meeting subject - task_type (CreateGoToMeetingTaskParamsTaskType | Unset): - conference_call_info (CreateGoToMeetingTaskParamsConferenceCallInfo | Unset): Default: 'voip'. Example: voip. - password_required (bool | None | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateGoToMeetingTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateGoToMeetingTaskParamsTaskType]): + conference_call_info (Union[Unset, CreateGoToMeetingTaskParamsConferenceCallInfo]): Default: 'voip'. Example: + voip. + password_required (Union[None, Unset, bool]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateGoToMeetingTaskParamsPostToSlackChannelsItem']]): """ subject: str - task_type: CreateGoToMeetingTaskParamsTaskType | Unset = UNSET - conference_call_info: CreateGoToMeetingTaskParamsConferenceCallInfo | Unset = "voip" - password_required: bool | None | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateGoToMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateGoToMeetingTaskParamsTaskType = UNSET + conference_call_info: Unset | CreateGoToMeetingTaskParamsConferenceCallInfo = "voip" + password_required: None | Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateGoToMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - subject = self.subject - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_call_info: str | Unset = UNSET + conference_call_info: Unset | str = UNSET if not isinstance(self.conference_call_info, Unset): conference_call_info = self.conference_call_info - password_required: bool | None | Unset + password_required: None | Unset | bool if isinstance(self.password_required, Unset): password_required = UNSET else: @@ -65,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -102,40 +100,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoToMeetingTaskParamsTaskType | Unset + task_type: Unset | CreateGoToMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_go_to_meeting_task_params_task_type(_task_type) _conference_call_info = d.pop("conference_call_info", UNSET) - conference_call_info: CreateGoToMeetingTaskParamsConferenceCallInfo | Unset + conference_call_info: Unset | CreateGoToMeetingTaskParamsConferenceCallInfo if isinstance(_conference_call_info, Unset): conference_call_info = UNSET else: conference_call_info = check_create_go_to_meeting_task_params_conference_call_info(_conference_call_info) - def _parse_password_required(data: object) -> bool | None | Unset: + def _parse_password_required(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) password_required = _parse_password_required(d.pop("password_required", UNSET)) post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateGoToMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateGoToMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateGoToMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_go_to_meeting_task_params = cls( subject=subject, diff --git a/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py index f666dea2..fdc0eebb 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGoToMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_calendar_event_task_params.py b/rootly_sdk/models/create_google_calendar_event_task_params.py index 0ea08aee..fe8900b0 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,19 +32,19 @@ class CreateGoogleCalendarEventTaskParams: meeting_duration (str): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. summary (str): The event summary description (str): The event description - task_type (CreateGoogleCalendarEventTaskParamsTaskType | Unset): - attendees (list[str] | Unset): Emails of attendees - time_zone (None | str | Unset): A valid IANA time zone name. - calendar_id (None | str | Unset): Default: 'primary'. - send_updates (bool | Unset): Send an email to the attendees notifying them of the event - can_guests_modify_event (bool | Unset): - can_guests_see_other_guests (bool | Unset): - can_guests_invite_others (bool | Unset): - exclude_weekends (bool | Unset): - conference_solution_key (CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset): Sets the video + task_type (Union[Unset, CreateGoogleCalendarEventTaskParamsTaskType]): + attendees (Union[Unset, list[str]]): Emails of attendees + time_zone (Union[None, Unset, str]): A valid IANA time zone name. + calendar_id (Union[None, Unset, str]): Default: 'primary'. + send_updates (Union[Unset, bool]): Send an email to the attendees notifying them of the event + can_guests_modify_event (Union[Unset, bool]): + can_guests_see_other_guests (Union[Unset, bool]): + can_guests_invite_others (Union[Unset, bool]): + exclude_weekends (Union[Unset, bool]): + conference_solution_key (Union[Unset, CreateGoogleCalendarEventTaskParamsConferenceSolutionKey]): Sets the video conference type attached to the meeting - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem']]): """ days_until_meeting: int @@ -54,22 +52,21 @@ class CreateGoogleCalendarEventTaskParams: meeting_duration: str summary: str description: str - task_type: CreateGoogleCalendarEventTaskParamsTaskType | Unset = UNSET - attendees: list[str] | Unset = UNSET - time_zone: None | str | Unset = UNSET - calendar_id: None | str | Unset = "primary" - send_updates: bool | Unset = UNSET - can_guests_modify_event: bool | Unset = UNSET - can_guests_see_other_guests: bool | Unset = UNSET - can_guests_invite_others: bool | Unset = UNSET - exclude_weekends: bool | Unset = UNSET - conference_solution_key: CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateGoogleCalendarEventTaskParamsTaskType = UNSET + attendees: Unset | list[str] = UNSET + time_zone: None | Unset | str = UNSET + calendar_id: None | Unset | str = "primary" + send_updates: Unset | bool = UNSET + can_guests_modify_event: Unset | bool = UNSET + can_guests_see_other_guests: Unset | bool = UNSET + can_guests_invite_others: Unset | bool = UNSET + exclude_weekends: Unset | bool = UNSET + conference_solution_key: Unset | CreateGoogleCalendarEventTaskParamsConferenceSolutionKey = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - days_until_meeting = self.days_until_meeting time_of_meeting = self.time_of_meeting @@ -80,21 +77,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: list[str] | Unset = UNSET + attendees: Unset | list[str] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - calendar_id: None | str | Unset + calendar_id: None | Unset | str if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -110,13 +107,13 @@ def to_dict(self) -> dict[str, Any]: exclude_weekends = self.exclude_weekends - conference_solution_key: str | Unset = UNSET + conference_solution_key: Unset | str = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -179,7 +176,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleCalendarEventTaskParamsTaskType | Unset + task_type: Unset | CreateGoogleCalendarEventTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -187,21 +184,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attendees = cast(list[str], d.pop("attendees", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_calendar_id(data: object) -> None | str | Unset: + def _parse_calendar_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -216,7 +213,7 @@ def _parse_calendar_id(data: object) -> None | str | Unset: exclude_weekends = d.pop("exclude_weekends", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset + conference_solution_key: Unset | CreateGoogleCalendarEventTaskParamsConferenceSolutionKey if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -226,16 +223,14 @@ def _parse_calendar_id(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_google_calendar_event_task_params = cls( days_until_meeting=days_until_meeting, diff --git a/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py index 0720c337..bd006c20 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_chat_space_task_params.py b/rootly_sdk/models/create_google_chat_space_task_params.py index ff6a09f3..ae1d1521 100644 --- a/rootly_sdk/models/create_google_chat_space_task_params.py +++ b/rootly_sdk/models/create_google_chat_space_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,21 +18,22 @@ class CreateGoogleChatSpaceTaskParams: """ Attributes: title (str): - task_type (CreateGoogleChatSpaceTaskParamsTaskType | Unset): - description (str | Unset): - audience (str | Unset): Target audience resource name (e.g. audiences/default). Leave blank for private space. + task_type (Union[Unset, CreateGoogleChatSpaceTaskParamsTaskType]): + description (Union[Unset, str]): + audience (Union[Unset, str]): Target audience resource name (e.g. audiences/default). Leave blank for private + space. """ title: str - task_type: CreateGoogleChatSpaceTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - audience: str | Unset = UNSET + task_type: Unset | CreateGoogleChatSpaceTaskParamsTaskType = UNSET + description: Unset | str = UNSET + audience: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleChatSpaceTaskParamsTaskType | Unset + task_type: Unset | CreateGoogleChatSpaceTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_docs_page_task_params.py b/rootly_sdk/models/create_google_docs_page_task_params.py index 3b931d6f..aa755541 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params.py +++ b/rootly_sdk/models/create_google_docs_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,36 +23,37 @@ class CreateGoogleDocsPageTaskParams: """ Attributes: title (str): The page title - task_type (CreateGoogleDocsPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - drive (CreateGoogleDocsPageTaskParamsDrive | Unset): - parent_folder (CreateGoogleDocsPageTaskParamsParentFolder | Unset): - content (str | Unset): The page content - template_id (str | Unset): The Google Doc file ID to use as a template - permissions (str | Unset): Page permissions JSON - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. + task_type (Union[Unset, CreateGoogleDocsPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + drive (Union[Unset, CreateGoogleDocsPageTaskParamsDrive]): + parent_folder (Union[Unset, CreateGoogleDocsPageTaskParamsParentFolder]): + content (Union[Unset, str]): The page content + template_id (Union[Unset, str]): The Google Doc file ID to use as a template + permissions (Union[Unset, str]): Page permissions JSON + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. """ title: str - task_type: CreateGoogleDocsPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - drive: CreateGoogleDocsPageTaskParamsDrive | Unset = UNSET - parent_folder: CreateGoogleDocsPageTaskParamsParentFolder | Unset = UNSET - content: str | Unset = UNSET - template_id: str | Unset = UNSET - permissions: str | Unset = UNSET - include_overview: bool | Unset = True - include_timeline: bool | Unset = True + task_type: Unset | CreateGoogleDocsPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + drive: Union[Unset, "CreateGoogleDocsPageTaskParamsDrive"] = UNSET + parent_folder: Union[Unset, "CreateGoogleDocsPageTaskParamsParentFolder"] = UNSET + content: Unset | str = UNSET + template_id: Unset | str = UNSET + permissions: Unset | str = UNSET + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,11 +61,11 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - drive: dict[str, Any] | Unset = UNSET + drive: Unset | dict[str, Any] = UNSET if not isinstance(self.drive, Unset): drive = self.drive.to_dict() - parent_folder: dict[str, Any] | Unset = UNSET + parent_folder: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -80,6 +79,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -107,6 +108,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups return field_dict @@ -121,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleDocsPageTaskParamsTaskType | Unset + task_type: Unset | CreateGoogleDocsPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -132,14 +135,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _drive = d.pop("drive", UNSET) - drive: CreateGoogleDocsPageTaskParamsDrive | Unset + drive: Unset | CreateGoogleDocsPageTaskParamsDrive if isinstance(_drive, Unset): drive = UNSET else: drive = CreateGoogleDocsPageTaskParamsDrive.from_dict(_drive) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: CreateGoogleDocsPageTaskParamsParentFolder | Unset + parent_folder: Unset | CreateGoogleDocsPageTaskParamsParentFolder if isinstance(_parent_folder, Unset): parent_folder = UNSET else: @@ -155,6 +158,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + create_google_docs_page_task_params = cls( title=title, task_type=task_type, @@ -167,6 +172,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions=permissions, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, ) create_google_docs_page_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_google_docs_page_task_params_drive.py b/rootly_sdk/models/create_google_docs_page_task_params_drive.py index ed347ba9..9bc8cd93 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_drive.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_drive.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGoogleDocsPageTaskParamsDrive: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py b/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py index 0f00ca78..aa73628a 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGoogleDocsPageTaskParamsParentFolder: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_docs_permissions_task_params.py b/rootly_sdk/models/create_google_docs_permissions_task_params.py index f685b609..90211d3f 100644 --- a/rootly_sdk/models/create_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/create_google_docs_permissions_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,16 +19,16 @@ class CreateGoogleDocsPermissionsTaskParams: Attributes: file_id (str): The Google Doc file ID permissions (str): Page permissions JSON - task_type (CreateGoogleDocsPermissionsTaskParamsTaskType | Unset): - send_notification_email (bool | Unset): - email_message (None | str | Unset): Email message notification + task_type (Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType]): + send_notification_email (Union[Unset, bool]): + email_message (Union[None, Unset, str]): Email message notification """ file_id: str permissions: str - task_type: CreateGoogleDocsPermissionsTaskParamsTaskType | Unset = UNSET - send_notification_email: bool | Unset = UNSET - email_message: None | str | Unset = UNSET + task_type: Unset | CreateGoogleDocsPermissionsTaskParamsTaskType = UNSET + send_notification_email: Unset | bool = UNSET + email_message: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,13 +36,13 @@ def to_dict(self) -> dict[str, Any]: permissions = self.permissions - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type send_notification_email = self.send_notification_email - email_message: None | str | Unset + email_message: None | Unset | str if isinstance(self.email_message, Unset): email_message = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions = d.pop("permissions") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleDocsPermissionsTaskParamsTaskType | Unset + task_type: Unset | CreateGoogleDocsPermissionsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -83,12 +81,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: send_notification_email = d.pop("send_notification_email", UNSET) - def _parse_email_message(data: object) -> None | str | Unset: + def _parse_email_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_message = _parse_email_message(d.pop("email_message", UNSET)) diff --git a/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py index ad8a81b6..87e49bf1 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,23 +25,22 @@ class CreateGoogleGeminiChatCompletionTaskParams: Attributes: model (CreateGoogleGeminiChatCompletionTaskParamsModel): The Gemini model. eg: gemini-2.0-flash prompt (str): The prompt to send to Gemini - task_type (CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to Gemini (optional) + task_type (Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to Gemini (optional) """ - model: CreateGoogleGeminiChatCompletionTaskParamsModel + model: "CreateGoogleGeminiChatCompletionTaskParamsModel" prompt: str - task_type: CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET + task_type: Unset | CreateGoogleGeminiChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset + task_type: Unset | CreateGoogleGeminiChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py index 9eb379c8..c0099766 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateGoogleGeminiChatCompletionTaskParamsModel: """The Gemini model. eg: gemini-2.0-flash Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_meeting_task_params.py b/rootly_sdk/models/create_google_meeting_task_params.py index 2bf70afb..89e2e1e3 100644 --- a/rootly_sdk/models/create_google_meeting_task_params.py +++ b/rootly_sdk/models/create_google_meeting_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -33,54 +31,53 @@ class CreateGoogleMeetingTaskParams: """ Attributes: - summary (None | str): [DEPRECATED] The meeting summary - description (None | str): [DEPRECATED] The meeting description - task_type (CreateGoogleMeetingTaskParamsTaskType | Unset): - conference_solution_key (CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset): [DEPRECATED] Sets the - video conference type attached to the meeting - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateGoogleMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's recording - (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateGoogleMeetingTaskParamsPostToSlackChannelsItem] | Unset): + summary (Union[None, str]): [DEPRECATED] The meeting summary + description (Union[None, str]): [DEPRECATED] The meeting description + task_type (Union[Unset, CreateGoogleMeetingTaskParamsTaskType]): + conference_solution_key (Union[Unset, CreateGoogleMeetingTaskParamsConferenceSolutionKey]): [DEPRECATED] Sets + the video conference type attached to the meeting + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateGoogleMeetingTaskParamsRecordingMode]): The video layout for the bot's + recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateGoogleMeetingTaskParamsPostToSlackChannelsItem']]): """ summary: None | str description: None | str - task_type: CreateGoogleMeetingTaskParamsTaskType | Unset = UNSET - conference_solution_key: CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset = UNSET - record_meeting: bool | Unset = UNSET - recording_mode: CreateGoogleMeetingTaskParamsRecordingMode | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateGoogleMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateGoogleMeetingTaskParamsTaskType = UNSET + conference_solution_key: Unset | CreateGoogleMeetingTaskParamsConferenceSolutionKey = UNSET + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateGoogleMeetingTaskParamsRecordingMode = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateGoogleMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - summary: None | str summary = self.summary description: None | str description = self.description - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_solution_key: str | Unset = UNSET + conference_solution_key: Unset | str = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -133,14 +130,14 @@ def _parse_description(data: object) -> None | str: description = _parse_description(d.pop("description")) _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleMeetingTaskParamsTaskType | Unset + task_type: Unset | CreateGoogleMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_google_meeting_task_params_task_type(_task_type) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset + conference_solution_key: Unset | CreateGoogleMeetingTaskParamsConferenceSolutionKey if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -151,7 +148,7 @@ def _parse_description(data: object) -> None | str: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateGoogleMeetingTaskParamsRecordingMode | Unset + recording_mode: Unset | CreateGoogleMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -159,16 +156,14 @@ def _parse_description(data: object) -> None | str: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateGoogleMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateGoogleMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateGoogleMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_google_meeting_task_params = cls( summary=summary, diff --git a/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py index 091a9f63..596f6f21 100644 --- a/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateGoogleMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_incident_postmortem_task_params.py b/rootly_sdk/models/create_incident_postmortem_task_params.py index 8c8d0253..1a875f38 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,16 +25,16 @@ class CreateIncidentPostmortemTaskParams: Attributes: incident_id (str): UUID of the incident that needs a retrospective title (str): The retrospective title - task_type (CreateIncidentPostmortemTaskParamsTaskType | Unset): - status (None | str | Unset): - template (CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset): Retrospective template to use + task_type (Union[Unset, CreateIncidentPostmortemTaskParamsTaskType]): + status (Union[None, Unset, str]): + template (Union['CreateIncidentPostmortemTaskParamsTemplateType0', None, Unset]): Retrospective template to use """ incident_id: str title: str - task_type: CreateIncidentPostmortemTaskParamsTaskType | Unset = UNSET - status: None | str | Unset = UNSET - template: CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset = UNSET + task_type: Unset | CreateIncidentPostmortemTaskParamsTaskType = UNSET + status: None | Unset | str = UNSET + template: Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,17 +46,17 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - status: None | str | Unset + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: status = self.status - template: dict[str, Any] | None | Unset + template: None | Unset | dict[str, Any] if isinstance(self.template, Unset): template = UNSET elif isinstance(self.template, CreateIncidentPostmortemTaskParamsTemplateType0): @@ -95,22 +93,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateIncidentPostmortemTaskParamsTaskType | Unset + task_type: Unset | CreateIncidentPostmortemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_incident_postmortem_task_params_task_type(_task_type) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_template(data: object) -> CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset: + def _parse_template(data: object) -> Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -121,9 +119,9 @@ def _parse_template(data: object) -> CreateIncidentPostmortemTaskParamsTemplateT template_type_0 = CreateIncidentPostmortemTaskParamsTemplateType0.from_dict(data) return template_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset, data) + return cast(Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset], data) template = _parse_template(d.pop("template", UNSET)) diff --git a/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py b/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py index 5baec603..c5ad478e 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateIncidentPostmortemTaskParamsTemplateType0: """Retrospective template to use Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_incident_task_params.py b/rootly_sdk/models/create_incident_task_params.py index 0431e24c..1065a82a 100644 --- a/rootly_sdk/models/create_incident_task_params.py +++ b/rootly_sdk/models/create_incident_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,36 +18,36 @@ class CreateIncidentTaskParams: """ Attributes: title (str): The incident title - task_type (CreateIncidentTaskParamsTaskType | Unset): - summary (str | Unset): The incident summary - severity_id (str | Unset): - incident_type_ids (list[str] | Unset): - service_ids (list[str] | Unset): Array of service UUIDs - functionality_ids (list[str] | Unset): Array of functionality UUIDs - environment_ids (list[str] | Unset): - group_ids (list[str] | Unset): Array of group/team UUIDs - private (bool | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateIncidentTaskParamsTaskType]): + summary (Union[Unset, str]): The incident summary + severity_id (Union[Unset, str]): + incident_type_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): Array of service UUIDs + functionality_ids (Union[Unset, list[str]]): Array of functionality UUIDs + environment_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): Array of group/team UUIDs + private (Union[Unset, bool]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON. Use 'services', 'functionalities', or 'groups' keys with arrays of names/slugs for name/slug lookup """ title: str - task_type: CreateIncidentTaskParamsTaskType | Unset = UNSET - summary: str | Unset = UNSET - severity_id: str | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - private: bool | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Unset | CreateIncidentTaskParamsTaskType = UNSET + summary: Unset | str = UNSET + severity_id: Unset | str = UNSET + incident_type_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + private: Unset | bool = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,29 +55,29 @@ def to_dict(self) -> dict[str, Any]: severity_id = self.severity_id - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids private = self.private - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -121,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateIncidentTaskParamsTaskType | Unset + task_type: Unset | CreateIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -143,12 +141,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_jira_issue_task_params.py b/rootly_sdk/models/create_jira_issue_task_params.py index 83f02914..462fc455 100644 --- a/rootly_sdk/models/create_jira_issue_task_params.py +++ b/rootly_sdk/models/create_jira_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,50 +27,55 @@ class CreateJiraIssueTaskParams: title (str): The issue title project_key (str): The project key issue_type (CreateJiraIssueTaskParamsIssueType): The issue type id and display name - task_type (CreateJiraIssueTaskParamsTaskType | Unset): - integration (CreateJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have more than one - Jira instance - description (str | Unset): The issue description - labels (str | Unset): The issue labels - assign_user_email (str | Unset): The assigned user's email - reporter_user_email (str | Unset): The reporter user's email - due_date (str | Unset): The due date - priority (CreateJiraIssueTaskParamsPriority | Unset): The priority id and display name - status (CreateJiraIssueTaskParamsStatus | Unset): The status id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateJiraIssueTaskParamsTaskType]): + integration (Union[Unset, CreateJiraIssueTaskParamsIntegration]): Specify integration id if you have more than + one Jira instance + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + assign_user_email (Union[Unset, str]): The assigned user's email + reporter_user_email (Union[Unset, str]): The reporter user's email + due_date (Union[Unset, str]): The due date + priority (Union[Unset, CreateJiraIssueTaskParamsPriority]): The priority id and display name + status (Union[Unset, CreateJiraIssueTaskParamsStatus]): The status id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + update_payload (Union[None, Unset, str]): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (Union[Unset, int]): Number of times to retry on rate-limit (HTTP 429) responses (0-4). 0 disables + retry. Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ title: str project_key: str - issue_type: CreateJiraIssueTaskParamsIssueType - task_type: CreateJiraIssueTaskParamsTaskType | Unset = UNSET - integration: CreateJiraIssueTaskParamsIntegration | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - reporter_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - priority: CreateJiraIssueTaskParamsPriority | Unset = UNSET - status: CreateJiraIssueTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - update_payload: None | str | Unset = UNSET + issue_type: "CreateJiraIssueTaskParamsIssueType" + task_type: Unset | CreateJiraIssueTaskParamsTaskType = UNSET + integration: Union[Unset, "CreateJiraIssueTaskParamsIntegration"] = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + reporter_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + priority: Union[Unset, "CreateJiraIssueTaskParamsPriority"] = UNSET + status: Union[Unset, "CreateJiraIssueTaskParamsStatus"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + update_payload: None | Unset | str = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title project_key = self.project_key issue_type = self.issue_type.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -86,26 +89,30 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | str | Unset + update_payload: None | Unset | str if isinstance(self.update_payload, Unset): update_payload = UNSET else: update_payload = self.update_payload + retry_count = self.retry_count + + retry_wait_time = self.retry_wait_time + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -137,6 +144,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_fields_mapping"] = custom_fields_mapping if update_payload is not UNSET: field_dict["update_payload"] = update_payload + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if retry_wait_time is not UNSET: + field_dict["retry_wait_time"] = retry_wait_time return field_dict @@ -155,14 +166,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_type = CreateJiraIssueTaskParamsIssueType.from_dict(d.pop("issue_type")) _task_type = d.pop("task_type", UNSET) - task_type: CreateJiraIssueTaskParamsTaskType | Unset + task_type: Unset | CreateJiraIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: CreateJiraIssueTaskParamsIntegration | Unset + integration: Unset | CreateJiraIssueTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -179,37 +190,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateJiraIssueTaskParamsPriority | Unset + priority: Unset | CreateJiraIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: CreateJiraIssueTaskParamsStatus | Unset + status: Unset | CreateJiraIssueTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = CreateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | str | Unset: + def _parse_update_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + create_jira_issue_task_params = cls( title=title, project_key=project_key, @@ -225,6 +240,8 @@ def _parse_update_payload(data: object) -> None | str | Unset: status=status, custom_fields_mapping=custom_fields_mapping, update_payload=update_payload, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_jira_issue_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_jira_issue_task_params_integration.py b/rootly_sdk/models/create_jira_issue_task_params_integration.py index 9537af66..b3fe98a6 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/create_jira_issue_task_params_integration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_issue_type.py b/rootly_sdk/models/create_jira_issue_task_params_issue_type.py index c774aed2..8e6dfd69 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_jira_issue_task_params_issue_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsIssueType: """The issue type id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_priority.py b/rootly_sdk/models/create_jira_issue_task_params_priority.py index cca943f4..7f761ba0 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/create_jira_issue_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_status.py b/rootly_sdk/models/create_jira_issue_task_params_status.py index 719aa1ff..1fbaa1b7 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_status.py +++ b/rootly_sdk/models/create_jira_issue_task_params_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsStatus: """The status id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params.py b/rootly_sdk/models/create_jira_subtask_task_params.py index f94a8ba6..ce6f02e8 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params.py +++ b/rootly_sdk/models/create_jira_subtask_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,40 +28,45 @@ class CreateJiraSubtaskTaskParams: parent_issue_id (str): The parent issue title (str): The issue title subtask_issue_type (CreateJiraSubtaskTaskParamsSubtaskIssueType): The issue type id and display name - task_type (CreateJiraSubtaskTaskParamsTaskType | Unset): - integration (CreateJiraSubtaskTaskParamsIntegration | Unset): Specify integration id if you have more than one - Jira instance - description (str | Unset): The issue description - labels (str | Unset): The issue labels - due_date (str | Unset): The due date - assign_user_email (str | Unset): The assigned user's email - reporter_user_email (str | Unset): The reporter user's email - priority (CreateJiraSubtaskTaskParamsPriority | Unset): The priority id and display name - status (CreateJiraSubtaskTaskParamsStatus | Unset): The status id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateJiraSubtaskTaskParamsTaskType]): + integration (Union[Unset, CreateJiraSubtaskTaskParamsIntegration]): Specify integration id if you have more than + one Jira instance + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + due_date (Union[Unset, str]): The due date + assign_user_email (Union[Unset, str]): The assigned user's email + reporter_user_email (Union[Unset, str]): The reporter user's email + priority (Union[Unset, CreateJiraSubtaskTaskParamsPriority]): The priority id and display name + status (Union[Unset, CreateJiraSubtaskTaskParamsStatus]): The status id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + update_payload (Union[None, Unset, str]): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (Union[Unset, int]): Number of times to retry on rate-limit (HTTP 429) responses (0-4). 0 disables + retry. Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ project_key: str parent_issue_id: str title: str - subtask_issue_type: CreateJiraSubtaskTaskParamsSubtaskIssueType - task_type: CreateJiraSubtaskTaskParamsTaskType | Unset = UNSET - integration: CreateJiraSubtaskTaskParamsIntegration | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - reporter_user_email: str | Unset = UNSET - priority: CreateJiraSubtaskTaskParamsPriority | Unset = UNSET - status: CreateJiraSubtaskTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - update_payload: None | str | Unset = UNSET + subtask_issue_type: "CreateJiraSubtaskTaskParamsSubtaskIssueType" + task_type: Unset | CreateJiraSubtaskTaskParamsTaskType = UNSET + integration: Union[Unset, "CreateJiraSubtaskTaskParamsIntegration"] = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + reporter_user_email: Unset | str = UNSET + priority: Union[Unset, "CreateJiraSubtaskTaskParamsPriority"] = UNSET + status: Union[Unset, "CreateJiraSubtaskTaskParamsStatus"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + update_payload: None | Unset | str = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - project_key = self.project_key parent_issue_id = self.parent_issue_id @@ -72,11 +75,11 @@ def to_dict(self) -> dict[str, Any]: subtask_issue_type = self.subtask_issue_type.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -90,26 +93,30 @@ def to_dict(self) -> dict[str, Any]: reporter_user_email = self.reporter_user_email - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | str | Unset + update_payload: None | Unset | str if isinstance(self.update_payload, Unset): update_payload = UNSET else: update_payload = self.update_payload + retry_count = self.retry_count + + retry_wait_time = self.retry_wait_time + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -142,6 +149,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_fields_mapping"] = custom_fields_mapping if update_payload is not UNSET: field_dict["update_payload"] = update_payload + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if retry_wait_time is not UNSET: + field_dict["retry_wait_time"] = retry_wait_time return field_dict @@ -164,14 +175,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subtask_issue_type = CreateJiraSubtaskTaskParamsSubtaskIssueType.from_dict(d.pop("subtask_issue_type")) _task_type = d.pop("task_type", UNSET) - task_type: CreateJiraSubtaskTaskParamsTaskType | Unset + task_type: Unset | CreateJiraSubtaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jira_subtask_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: CreateJiraSubtaskTaskParamsIntegration | Unset + integration: Unset | CreateJiraSubtaskTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -188,37 +199,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: reporter_user_email = d.pop("reporter_user_email", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateJiraSubtaskTaskParamsPriority | Unset + priority: Unset | CreateJiraSubtaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraSubtaskTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: CreateJiraSubtaskTaskParamsStatus | Unset + status: Unset | CreateJiraSubtaskTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = CreateJiraSubtaskTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | str | Unset: + def _parse_update_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + create_jira_subtask_task_params = cls( project_key=project_key, parent_issue_id=parent_issue_id, @@ -235,6 +250,8 @@ def _parse_update_payload(data: object) -> None | str | Unset: status=status, custom_fields_mapping=custom_fields_mapping, update_payload=update_payload, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_jira_subtask_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_jira_subtask_task_params_integration.py b/rootly_sdk/models/create_jira_subtask_task_params_integration.py index 7ce38be3..da42dd97 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_integration.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_integration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_priority.py b/rootly_sdk/models/create_jira_subtask_task_params_priority.py index d6f31b38..0c90227e 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_priority.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_status.py b/rootly_sdk/models/create_jira_subtask_task_params_status.py index 5c9cbdd1..3bc133f4 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_status.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsStatus: """The status id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py b/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py index a99b33ac..dd079064 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsSubtaskIssueType: """The issue type id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params.py b/rootly_sdk/models/create_jsmops_alert_task_params.py index 5fa7699e..1d88845f 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -31,75 +29,74 @@ class CreateJsmopsAlertTaskParams: """ Attributes: message (str): Message of the alert - task_type (CreateJsmopsAlertTaskParamsTaskType | Unset): - description (None | str | Unset): Description field of the alert that is generally used to provide a detailed - information about the alert - teams (list[CreateJsmopsAlertTaskParamsTeamsItem] | Unset): - users (list[CreateJsmopsAlertTaskParamsUsersItem] | Unset): - schedules (list[CreateJsmopsAlertTaskParamsSchedulesItem] | Unset): - escalations (list[CreateJsmopsAlertTaskParamsEscalationsItem] | Unset): - priority (CreateJsmopsAlertTaskParamsPriority | Unset): Default: 'P3'. - details (None | str | Unset): Details payload. Can contain liquid markup and need to be valid JSON + task_type (Union[Unset, CreateJsmopsAlertTaskParamsTaskType]): + description (Union[None, Unset, str]): Description field of the alert that is generally used to provide a + detailed information about the alert + teams (Union[Unset, list['CreateJsmopsAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['CreateJsmopsAlertTaskParamsUsersItem']]): + schedules (Union[Unset, list['CreateJsmopsAlertTaskParamsSchedulesItem']]): + escalations (Union[Unset, list['CreateJsmopsAlertTaskParamsEscalationsItem']]): + priority (Union[Unset, CreateJsmopsAlertTaskParamsPriority]): Default: 'P3'. + details (Union[None, Unset, str]): Details payload. Can contain liquid markup and need to be valid JSON """ message: str - task_type: CreateJsmopsAlertTaskParamsTaskType | Unset = UNSET - description: None | str | Unset = UNSET - teams: list[CreateJsmopsAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[CreateJsmopsAlertTaskParamsUsersItem] | Unset = UNSET - schedules: list[CreateJsmopsAlertTaskParamsSchedulesItem] | Unset = UNSET - escalations: list[CreateJsmopsAlertTaskParamsEscalationsItem] | Unset = UNSET - priority: CreateJsmopsAlertTaskParamsPriority | Unset = "P3" - details: None | str | Unset = UNSET + task_type: Unset | CreateJsmopsAlertTaskParamsTaskType = UNSET + description: None | Unset | str = UNSET + teams: Unset | list["CreateJsmopsAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["CreateJsmopsAlertTaskParamsUsersItem"] = UNSET + schedules: Unset | list["CreateJsmopsAlertTaskParamsSchedulesItem"] = UNSET + escalations: Unset | list["CreateJsmopsAlertTaskParamsEscalationsItem"] = UNSET + priority: Unset | CreateJsmopsAlertTaskParamsPriority = "P3" + details: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - message = self.message - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - schedules: list[dict[str, Any]] | Unset = UNSET + schedules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.schedules, Unset): schedules = [] for schedules_item_data in self.schedules: schedules_item = schedules_item_data.to_dict() schedules.append(schedules_item) - escalations: list[dict[str, Any]] | Unset = UNSET + escalations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalations, Unset): escalations = [] for escalations_item_data in self.escalations: escalations_item = escalations_item_data.to_dict() escalations.append(escalations_item) - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: None | str | Unset + details: None | Unset | str if isinstance(self.details, Unset): details = UNSET else: @@ -142,70 +139,62 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: CreateJsmopsAlertTaskParamsTaskType | Unset + task_type: Unset | CreateJsmopsAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jsmops_alert_task_params_task_type(_task_type) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[CreateJsmopsAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = CreateJsmopsAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = CreateJsmopsAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[CreateJsmopsAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = CreateJsmopsAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = CreateJsmopsAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) + schedules = [] _schedules = d.pop("schedules", UNSET) - schedules: list[CreateJsmopsAlertTaskParamsSchedulesItem] | Unset = UNSET - if _schedules is not UNSET: - schedules = [] - for schedules_item_data in _schedules: - schedules_item = CreateJsmopsAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) + for schedules_item_data in _schedules or []: + schedules_item = CreateJsmopsAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) - schedules.append(schedules_item) + schedules.append(schedules_item) + escalations = [] _escalations = d.pop("escalations", UNSET) - escalations: list[CreateJsmopsAlertTaskParamsEscalationsItem] | Unset = UNSET - if _escalations is not UNSET: - escalations = [] - for escalations_item_data in _escalations: - escalations_item = CreateJsmopsAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) + for escalations_item_data in _escalations or []: + escalations_item = CreateJsmopsAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) - escalations.append(escalations_item) + escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: CreateJsmopsAlertTaskParamsPriority | Unset + priority: Unset | CreateJsmopsAlertTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_jsmops_alert_task_params_priority(_priority) - def _parse_details(data: object) -> None | str | Unset: + def _parse_details(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) details = _parse_details(d.pop("details", UNSET)) diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py index 933c82bf..c1b887fa 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsEscalationsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py index 0ab25c3f..d17d7e27 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsSchedulesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py index 802141da..8b6fd019 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py index 92d7c0a2..32e54d1d 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_comment_task_params.py b/rootly_sdk/models/create_linear_issue_comment_task_params.py index 7bd6f8ce..85aa5e0e 100644 --- a/rootly_sdk/models/create_linear_issue_comment_task_params.py +++ b/rootly_sdk/models/create_linear_issue_comment_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class CreateLinearIssueCommentTaskParams: Attributes: issue_id (str): The issue id body (str): The issue description - task_type (CreateLinearIssueCommentTaskParamsTaskType | Unset): + task_type (Union[Unset, CreateLinearIssueCommentTaskParamsTaskType]): """ issue_id: str body: str - task_type: CreateLinearIssueCommentTaskParamsTaskType | Unset = UNSET + task_type: Unset | CreateLinearIssueCommentTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: body = self.body - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") _task_type = d.pop("task_type", UNSET) - task_type: CreateLinearIssueCommentTaskParamsTaskType | Unset + task_type: Unset | CreateLinearIssueCommentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_linear_issue_task_params.py b/rootly_sdk/models/create_linear_issue_task_params.py index df69a9e7..ac4336dc 100644 --- a/rootly_sdk/models/create_linear_issue_task_params.py +++ b/rootly_sdk/models/create_linear_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,60 +28,59 @@ class CreateLinearIssueTaskParams: title (str): The issue title team (CreateLinearIssueTaskParamsTeam): The team id and display name state (CreateLinearIssueTaskParamsState): The state id and display name - task_type (CreateLinearIssueTaskParamsTaskType | Unset): - description (str | Unset): The issue description - project (CreateLinearIssueTaskParamsProject | Unset): The project id and display name - labels (list[CreateLinearIssueTaskParamsLabelsItem] | Unset): - priority (CreateLinearIssueTaskParamsPriority | Unset): The priority id and display name - assign_user_email (str | Unset): The assigned user's email - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateLinearIssueTaskParamsTaskType]): + description (Union[Unset, str]): The issue description + project (Union[Unset, CreateLinearIssueTaskParamsProject]): The project id and display name + labels (Union[Unset, list['CreateLinearIssueTaskParamsLabelsItem']]): + priority (Union[Unset, CreateLinearIssueTaskParamsPriority]): The priority id and display name + assign_user_email (Union[Unset, str]): The assigned user's email + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ title: str - team: CreateLinearIssueTaskParamsTeam - state: CreateLinearIssueTaskParamsState - task_type: CreateLinearIssueTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - project: CreateLinearIssueTaskParamsProject | Unset = UNSET - labels: list[CreateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - priority: CreateLinearIssueTaskParamsPriority | Unset = UNSET - assign_user_email: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + team: "CreateLinearIssueTaskParamsTeam" + state: "CreateLinearIssueTaskParamsState" + task_type: Unset | CreateLinearIssueTaskParamsTaskType = UNSET + description: Unset | str = UNSET + project: Union[Unset, "CreateLinearIssueTaskParamsProject"] = UNSET + labels: Unset | list["CreateLinearIssueTaskParamsLabelsItem"] = UNSET + priority: Union[Unset, "CreateLinearIssueTaskParamsPriority"] = UNSET + assign_user_email: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title team = self.team.to_dict() state = self.state.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - project: dict[str, Any] | Unset = UNSET + project: Unset | dict[str, Any] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -131,7 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = CreateLinearIssueTaskParamsState.from_dict(d.pop("state")) _task_type = d.pop("task_type", UNSET) - task_type: CreateLinearIssueTaskParamsTaskType | Unset + task_type: Unset | CreateLinearIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -140,23 +137,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _project = d.pop("project", UNSET) - project: CreateLinearIssueTaskParamsProject | Unset + project: Unset | CreateLinearIssueTaskParamsProject if isinstance(_project, Unset): project = UNSET else: project = CreateLinearIssueTaskParamsProject.from_dict(_project) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: CreateLinearIssueTaskParamsPriority | Unset + priority: Unset | CreateLinearIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -164,12 +159,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_linear_issue_task_params_labels_item.py b/rootly_sdk/models/create_linear_issue_task_params_labels_item.py index d2c67738..7caa9c5c 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_linear_issue_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateLinearIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_priority.py b/rootly_sdk/models/create_linear_issue_task_params_priority.py index d281895e..fd8fe0cb 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_issue_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_project.py b/rootly_sdk/models/create_linear_issue_task_params_project.py index 02bf0115..44dcbb73 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_project.py +++ b/rootly_sdk/models/create_linear_issue_task_params_project.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsProject: """The project id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_state.py b/rootly_sdk/models/create_linear_issue_task_params_state.py index 4bbea5fa..8b9b28bb 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_issue_task_params_state.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsState: """The state id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_team.py b/rootly_sdk/models/create_linear_issue_task_params_team.py index 6a4aaa55..b87cee57 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_team.py +++ b/rootly_sdk/models/create_linear_issue_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsTeam: """The team id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params.py b/rootly_sdk/models/create_linear_subtask_issue_task_params.py index aa6a3465..62bf2363 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,45 +28,44 @@ class CreateLinearSubtaskIssueTaskParams: parent_issue_id (str): The parent issue title (str): The issue title state (CreateLinearSubtaskIssueTaskParamsState): The state id and display name - task_type (CreateLinearSubtaskIssueTaskParamsTaskType | Unset): - description (str | Unset): The issue description - priority (CreateLinearSubtaskIssueTaskParamsPriority | Unset): The priority id and display name - labels (list[CreateLinearSubtaskIssueTaskParamsLabelsItem] | Unset): - assign_user_email (str | Unset): The assigned user's email - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateLinearSubtaskIssueTaskParamsTaskType]): + description (Union[Unset, str]): The issue description + priority (Union[Unset, CreateLinearSubtaskIssueTaskParamsPriority]): The priority id and display name + labels (Union[Unset, list['CreateLinearSubtaskIssueTaskParamsLabelsItem']]): + assign_user_email (Union[Unset, str]): The assigned user's email + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ parent_issue_id: str title: str - state: CreateLinearSubtaskIssueTaskParamsState - task_type: CreateLinearSubtaskIssueTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - priority: CreateLinearSubtaskIssueTaskParamsPriority | Unset = UNSET - labels: list[CreateLinearSubtaskIssueTaskParamsLabelsItem] | Unset = UNSET - assign_user_email: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + state: "CreateLinearSubtaskIssueTaskParamsState" + task_type: Unset | CreateLinearSubtaskIssueTaskParamsTaskType = UNSET + description: Unset | str = UNSET + priority: Union[Unset, "CreateLinearSubtaskIssueTaskParamsPriority"] = UNSET + labels: Unset | list["CreateLinearSubtaskIssueTaskParamsLabelsItem"] = UNSET + assign_user_email: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - parent_issue_id = self.parent_issue_id title = self.title state = self.state.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -77,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: assign_user_email = self.assign_user_email - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -123,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = CreateLinearSubtaskIssueTaskParamsState.from_dict(d.pop("state")) _task_type = d.pop("task_type", UNSET) - task_type: CreateLinearSubtaskIssueTaskParamsTaskType | Unset + task_type: Unset | CreateLinearSubtaskIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -132,29 +129,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateLinearSubtaskIssueTaskParamsPriority | Unset + priority: Unset | CreateLinearSubtaskIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateLinearSubtaskIssueTaskParamsPriority.from_dict(_priority) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateLinearSubtaskIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateLinearSubtaskIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateLinearSubtaskIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py index ca04ec13..21339bcd 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateLinearSubtaskIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py index d605d101..93f710e2 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateLinearSubtaskIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py index 8c1e27be..1a12777e 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateLinearSubtaskIssueTaskParamsState: """The state id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py index a52cb327..f991a56e 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,31 +27,30 @@ class CreateMicrosoftTeamsChannelTaskParams: Attributes: team (CreateMicrosoftTeamsChannelTaskParamsTeam): title (str): Microsoft Team channel title - task_type (CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset): - description (str | Unset): Microsoft Team channel description - private (CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset): Default: 'auto'. + task_type (Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType]): + description (Union[Unset, str]): Microsoft Team channel description + private (Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate]): Default: 'auto'. """ - team: CreateMicrosoftTeamsChannelTaskParamsTeam + team: "CreateMicrosoftTeamsChannelTaskParamsTeam" title: str - task_type: CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - private: CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset = "auto" + task_type: Unset | CreateMicrosoftTeamsChannelTaskParamsTaskType = UNSET + description: Unset | str = UNSET + private: Unset | CreateMicrosoftTeamsChannelTaskParamsPrivate = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - private: str | Unset = UNSET + private: Unset | str = UNSET if not isinstance(self.private, Unset): private = self.private @@ -84,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset + task_type: Unset | CreateMicrosoftTeamsChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -93,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _private = d.pop("private", UNSET) - private: CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset + private: Unset | CreateMicrosoftTeamsChannelTaskParamsPrivate if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py index 3d7128e5..32f51411 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py index 28cf2434..b02e3b4a 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -29,36 +27,35 @@ class CreateMicrosoftTeamsChatTaskParams: """ Attributes: - members (list[CreateMicrosoftTeamsChatTaskParamsMembersItem]): Array of members to include in the chat - task_type (CreateMicrosoftTeamsChatTaskParamsTaskType | Unset): - topic (None | str | Unset): Chat topic (only for group chats) - chat_type (CreateMicrosoftTeamsChatTaskParamsChatType | Unset): Type of chat to create Default: 'group'. + members (list['CreateMicrosoftTeamsChatTaskParamsMembersItem']): Array of members to include in the chat + task_type (Union[Unset, CreateMicrosoftTeamsChatTaskParamsTaskType]): + topic (Union[None, Unset, str]): Chat topic (only for group chats) + chat_type (Union[Unset, CreateMicrosoftTeamsChatTaskParamsChatType]): Type of chat to create Default: 'group'. """ - members: list[CreateMicrosoftTeamsChatTaskParamsMembersItem] - task_type: CreateMicrosoftTeamsChatTaskParamsTaskType | Unset = UNSET - topic: None | str | Unset = UNSET - chat_type: CreateMicrosoftTeamsChatTaskParamsChatType | Unset = "group" + members: list["CreateMicrosoftTeamsChatTaskParamsMembersItem"] + task_type: Unset | CreateMicrosoftTeamsChatTaskParamsTaskType = UNSET + topic: None | Unset | str = UNSET + chat_type: Unset | CreateMicrosoftTeamsChatTaskParamsChatType = "group" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - members = [] for members_item_data in self.members: members_item = members_item_data.to_dict() members.append(members_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - topic: None | str | Unset + topic: None | Unset | str if isinstance(self.topic, Unset): topic = UNSET else: topic = self.topic - chat_type: str | Unset = UNSET + chat_type: Unset | str = UNSET if not isinstance(self.chat_type, Unset): chat_type = self.chat_type @@ -93,23 +90,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: members.append(members_item) _task_type = d.pop("task_type", UNSET) - task_type: CreateMicrosoftTeamsChatTaskParamsTaskType | Unset + task_type: Unset | CreateMicrosoftTeamsChatTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_microsoft_teams_chat_task_params_task_type(_task_type) - def _parse_topic(data: object) -> None | str | Unset: + def _parse_topic(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) topic = _parse_topic(d.pop("topic", UNSET)) _chat_type = d.pop("chat_type", UNSET) - chat_type: CreateMicrosoftTeamsChatTaskParamsChatType | Unset + chat_type: Unset | CreateMicrosoftTeamsChatTaskParamsChatType if isinstance(_chat_type, Unset): chat_type = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py index 714d243e..5c2b3733 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateMicrosoftTeamsChatTaskParamsMembersItem: """ Attributes: - email (str | Unset): - name (str | Unset): + email (Union[Unset, str]): + name (Union[Unset, str]): """ - email: str | Unset = UNSET - name: str | Unset = UNSET + email: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py index 02fb935f..af680a85 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,43 +29,42 @@ class CreateMicrosoftTeamsMeetingTaskParams: Attributes: name (str): The meeting name subject (str): The meeting subject - task_type (CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset): - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's - recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsTaskType]): + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsRecordingMode]): The video layout for the + bot's recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem']]): """ name: str subject: str - task_type: CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset = UNSET - record_meeting: bool | Unset = UNSET - recording_mode: CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateMicrosoftTeamsMeetingTaskParamsTaskType = UNSET + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateMicrosoftTeamsMeetingTaskParamsRecordingMode = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name subject = self.subject - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -107,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset + task_type: Unset | CreateMicrosoftTeamsMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -116,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset + recording_mode: Unset | CreateMicrosoftTeamsMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -124,16 +121,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_microsoft_teams_meeting_task_params = cls( name=name, diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py index dc99a191..7e910bdb 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_mistral_chat_completion_task_params.py b/rootly_sdk/models/create_mistral_chat_completion_task_params.py index 2747acd8..efd67bc9 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,29 +23,28 @@ class CreateMistralChatCompletionTaskParams: Attributes: model (CreateMistralChatCompletionTaskParamsModel): The Mistral model. eg: mistral-large-latest prompt (str): The prompt to send to Mistral - task_type (CreateMistralChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to Mistral (optional) - temperature (float | Unset): Sampling temperature (0.0-1.5). Higher values make output more random. - max_tokens (int | Unset): Maximum number of tokens to generate - top_p (float | Unset): Nucleus sampling parameter (0.0-1.0) + task_type (Union[Unset, CreateMistralChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to Mistral (optional) + temperature (Union[Unset, float]): Sampling temperature (0.0-1.5). Higher values make output more random. + max_tokens (Union[Unset, int]): Maximum number of tokens to generate + top_p (Union[Unset, float]): Nucleus sampling parameter (0.0-1.0) """ - model: CreateMistralChatCompletionTaskParamsModel + model: "CreateMistralChatCompletionTaskParamsModel" prompt: str - task_type: CreateMistralChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET - temperature: float | Unset = UNSET - max_tokens: int | Unset = UNSET - top_p: float | Unset = UNSET + task_type: Unset | CreateMistralChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET + temperature: Unset | float = UNSET + max_tokens: Unset | int = UNSET + top_p: Unset | float = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateMistralChatCompletionTaskParamsTaskType | Unset + task_type: Unset | CreateMistralChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py b/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py index 7cda8fef..aa4b56d8 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateMistralChatCompletionTaskParamsModel: """The Mistral model. eg: mistral-large-latest Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params.py b/rootly_sdk/models/create_motion_task_task_params.py index f266e09a..287d06ef 100644 --- a/rootly_sdk/models/create_motion_task_task_params.py +++ b/rootly_sdk/models/create_motion_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,53 +26,50 @@ class CreateMotionTaskTaskParams: Attributes: workspace (CreateMotionTaskTaskParamsWorkspace): title (str): The task title - task_type (CreateMotionTaskTaskParamsTaskType | Unset): - project (CreateMotionTaskTaskParamsProject | Unset): - status (CreateMotionTaskTaskParamsStatus | Unset): - description (str | Unset): The task description - labels (list[str] | Unset): - priority (CreateMotionTaskTaskParamsPriority | Unset): The priority id and display name - duration (str | Unset): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. - due_date (str | Unset): The due date + task_type (Union[Unset, CreateMotionTaskTaskParamsTaskType]): + project (Union[Unset, CreateMotionTaskTaskParamsProject]): + status (Union[Unset, CreateMotionTaskTaskParamsStatus]): + description (Union[Unset, str]): The task description + labels (Union[Unset, str]): The task labels + priority (Union[Unset, CreateMotionTaskTaskParamsPriority]): The priority id and display name + duration (Union[Unset, str]): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. + due_date (Union[Unset, str]): The due date """ - workspace: CreateMotionTaskTaskParamsWorkspace + workspace: "CreateMotionTaskTaskParamsWorkspace" title: str - task_type: CreateMotionTaskTaskParamsTaskType | Unset = UNSET - project: CreateMotionTaskTaskParamsProject | Unset = UNSET - status: CreateMotionTaskTaskParamsStatus | Unset = UNSET - description: str | Unset = UNSET - labels: list[str] | Unset = UNSET - priority: CreateMotionTaskTaskParamsPriority | Unset = UNSET - duration: str | Unset = UNSET - due_date: str | Unset = UNSET + task_type: Unset | CreateMotionTaskTaskParamsTaskType = UNSET + project: Union[Unset, "CreateMotionTaskTaskParamsProject"] = UNSET + status: Union[Unset, "CreateMotionTaskTaskParamsStatus"] = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + priority: Union[Unset, "CreateMotionTaskTaskParamsPriority"] = UNSET + duration: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workspace = self.workspace.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - project: dict[str, Any] | Unset = UNSET + project: Unset | dict[str, Any] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() description = self.description - labels: list[str] | Unset = UNSET - if not isinstance(self.labels, Unset): - labels = self.labels + labels = self.labels - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -122,21 +117,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateMotionTaskTaskParamsTaskType | Unset + task_type: Unset | CreateMotionTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_motion_task_task_params_task_type(_task_type) _project = d.pop("project", UNSET) - project: CreateMotionTaskTaskParamsProject | Unset + project: Unset | CreateMotionTaskTaskParamsProject if isinstance(_project, Unset): project = UNSET else: project = CreateMotionTaskTaskParamsProject.from_dict(_project) _status = d.pop("status", UNSET) - status: CreateMotionTaskTaskParamsStatus | Unset + status: Unset | CreateMotionTaskTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: @@ -144,10 +139,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - labels = cast(list[str], d.pop("labels", UNSET)) + labels = d.pop("labels", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateMotionTaskTaskParamsPriority | Unset + priority: Unset | CreateMotionTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/create_motion_task_task_params_priority.py b/rootly_sdk/models/create_motion_task_task_params_priority.py index 493c01f5..e8a31af7 100644 --- a/rootly_sdk/models/create_motion_task_task_params_priority.py +++ b/rootly_sdk/models/create_motion_task_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateMotionTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_project.py b/rootly_sdk/models/create_motion_task_task_params_project.py index 4843b381..a76a9455 100644 --- a/rootly_sdk/models/create_motion_task_task_params_project.py +++ b/rootly_sdk/models/create_motion_task_task_params_project.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateMotionTaskTaskParamsProject: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_status.py b/rootly_sdk/models/create_motion_task_task_params_status.py index 97abb0ea..43522fa2 100644 --- a/rootly_sdk/models/create_motion_task_task_params_status.py +++ b/rootly_sdk/models/create_motion_task_task_params_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateMotionTaskTaskParamsStatus: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_workspace.py b/rootly_sdk/models/create_motion_task_task_params_workspace.py index 13cf3220..ff425137 100644 --- a/rootly_sdk/models/create_motion_task_task_params_workspace.py +++ b/rootly_sdk/models/create_motion_task_task_params_workspace.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateMotionTaskTaskParamsWorkspace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_notion_page_task_params.py b/rootly_sdk/models/create_notion_page_task_params.py index aa2d8930..28bae0df 100644 --- a/rootly_sdk/models/create_notion_page_task_params.py +++ b/rootly_sdk/models/create_notion_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,32 +23,31 @@ class CreateNotionPageTaskParams: Attributes: title (str): The Notion page title parent_page (CreateNotionPageTaskParamsParentPage): The parent page id and display name - task_type (CreateNotionPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page task, if desired - content (str | Unset): Custom page content with liquid templating support. When provided, only this content will - be rendered (no default sections) - mark_post_mortem_as_published (bool | Unset): Default: True. - show_timeline_as_table (bool | Unset): - show_action_items_as_table (bool | Unset): + task_type (Union[Unset, CreateNotionPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page task, if desired + content (Union[Unset, str]): Custom page content with liquid templating support. When provided, only this + content will be rendered (no default sections) + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + show_timeline_as_table (Union[Unset, bool]): + show_action_items_as_table (Union[Unset, bool]): """ title: str - parent_page: CreateNotionPageTaskParamsParentPage - task_type: CreateNotionPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - content: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - show_timeline_as_table: bool | Unset = UNSET - show_action_items_as_table: bool | Unset = UNSET + parent_page: "CreateNotionPageTaskParamsParentPage" + task_type: Unset | CreateNotionPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + content: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + show_timeline_as_table: Unset | bool = UNSET + show_action_items_as_table: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title parent_page = self.parent_page.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -97,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parent_page = CreateNotionPageTaskParamsParentPage.from_dict(d.pop("parent_page")) _task_type = d.pop("task_type", UNSET) - task_type: CreateNotionPageTaskParamsTaskType | Unset + task_type: Unset | CreateNotionPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_notion_page_task_params_parent_page.py b/rootly_sdk/models/create_notion_page_task_params_parent_page.py index 08a6d60c..21c4244a 100644 --- a/rootly_sdk/models/create_notion_page_task_params_parent_page.py +++ b/rootly_sdk/models/create_notion_page_task_params_parent_page.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateNotionPageTaskParamsParentPage: """The parent page id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params.py b/rootly_sdk/models/create_openai_chat_completion_task_params.py index fbe1281e..a917e34d 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -33,35 +31,34 @@ class CreateOpenaiChatCompletionTaskParams: Attributes: model (CreateOpenaiChatCompletionTaskParamsModel): The OpenAI model. eg: gpt-5-nano prompt (str): The prompt to send to OpenAI - task_type (CreateOpenaiChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to OpenAI (optional) - temperature (float | Unset): Controls randomness in the response. Higher values make output more random - max_tokens (int | Unset): Maximum number of tokens to generate in the response - top_p (float | Unset): Controls diversity via nucleus sampling. Lower values make output more focused - reasoning_effort (CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset): Constrains effort on reasoning - for GPT-5 and o-series models - reasoning_summary (CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset): Summary of the reasoning + task_type (Union[Unset, CreateOpenaiChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to OpenAI (optional) + temperature (Union[Unset, float]): Controls randomness in the response. Higher values make output more random + max_tokens (Union[Unset, int]): Maximum number of tokens to generate in the response + top_p (Union[Unset, float]): Controls diversity via nucleus sampling. Lower values make output more focused + reasoning_effort (Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningEffort]): Constrains effort on + reasoning for GPT-5 and o-series models + reasoning_summary (Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningSummary]): Summary of the reasoning performed by the model for GPT-5 and o-series models """ - model: CreateOpenaiChatCompletionTaskParamsModel + model: "CreateOpenaiChatCompletionTaskParamsModel" prompt: str - task_type: CreateOpenaiChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET - temperature: float | Unset = UNSET - max_tokens: int | Unset = UNSET - top_p: float | Unset = UNSET - reasoning_effort: CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset = UNSET - reasoning_summary: CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset = UNSET + task_type: Unset | CreateOpenaiChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET + temperature: Unset | float = UNSET + max_tokens: Unset | int = UNSET + top_p: Unset | float = UNSET + reasoning_effort: Unset | CreateOpenaiChatCompletionTaskParamsReasoningEffort = UNSET + reasoning_summary: Unset | CreateOpenaiChatCompletionTaskParamsReasoningSummary = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: top_p = self.top_p - reasoning_effort: str | Unset = UNSET + reasoning_effort: Unset | str = UNSET if not isinstance(self.reasoning_effort, Unset): reasoning_effort = self.reasoning_effort - reasoning_summary: str | Unset = UNSET + reasoning_summary: Unset | str = UNSET if not isinstance(self.reasoning_summary, Unset): reasoning_summary = self.reasoning_summary @@ -116,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateOpenaiChatCompletionTaskParamsTaskType | Unset + task_type: Unset | CreateOpenaiChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -131,14 +128,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: top_p = d.pop("top_p", UNSET) _reasoning_effort = d.pop("reasoning_effort", UNSET) - reasoning_effort: CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset + reasoning_effort: Unset | CreateOpenaiChatCompletionTaskParamsReasoningEffort if isinstance(_reasoning_effort, Unset): reasoning_effort = UNSET else: reasoning_effort = check_create_openai_chat_completion_task_params_reasoning_effort(_reasoning_effort) _reasoning_summary = d.pop("reasoning_summary", UNSET) - reasoning_summary: CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset + reasoning_summary: Unset | CreateOpenaiChatCompletionTaskParamsReasoningSummary if isinstance(_reasoning_summary, Unset): reasoning_summary = UNSET else: diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params_model.py b/rootly_sdk/models/create_openai_chat_completion_task_params_model.py index 927f4f61..9e40d263 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params_model.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateOpenaiChatCompletionTaskParamsModel: """The OpenAI model. eg: gpt-5-nano Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params.py b/rootly_sdk/models/create_opsgenie_alert_task_params.py index b1e7967b..fa9ee991 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -31,71 +29,70 @@ class CreateOpsgenieAlertTaskParams: """ Attributes: message (str): Message of the alert - task_type (CreateOpsgenieAlertTaskParamsTaskType | Unset): - description (str | Unset): Description field of the alert that is generally used to provide a detailed + task_type (Union[Unset, CreateOpsgenieAlertTaskParamsTaskType]): + description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed information about the alert - teams (list[CreateOpsgenieAlertTaskParamsTeamsItem] | Unset): - users (list[CreateOpsgenieAlertTaskParamsUsersItem] | Unset): - schedules (list[CreateOpsgenieAlertTaskParamsSchedulesItem] | Unset): - escalations (list[CreateOpsgenieAlertTaskParamsEscalationsItem] | Unset): - priority (CreateOpsgenieAlertTaskParamsPriority | Unset): Default: 'P1'. - details (None | str | Unset): Details payload. Can contain liquid markup and need to be valid JSON + teams (Union[Unset, list['CreateOpsgenieAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['CreateOpsgenieAlertTaskParamsUsersItem']]): + schedules (Union[Unset, list['CreateOpsgenieAlertTaskParamsSchedulesItem']]): + escalations (Union[Unset, list['CreateOpsgenieAlertTaskParamsEscalationsItem']]): + priority (Union[Unset, CreateOpsgenieAlertTaskParamsPriority]): Default: 'P1'. + details (Union[None, Unset, str]): Details payload. Can contain liquid markup and need to be valid JSON """ message: str - task_type: CreateOpsgenieAlertTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - teams: list[CreateOpsgenieAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[CreateOpsgenieAlertTaskParamsUsersItem] | Unset = UNSET - schedules: list[CreateOpsgenieAlertTaskParamsSchedulesItem] | Unset = UNSET - escalations: list[CreateOpsgenieAlertTaskParamsEscalationsItem] | Unset = UNSET - priority: CreateOpsgenieAlertTaskParamsPriority | Unset = "P1" - details: None | str | Unset = UNSET + task_type: Unset | CreateOpsgenieAlertTaskParamsTaskType = UNSET + description: Unset | str = UNSET + teams: Unset | list["CreateOpsgenieAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["CreateOpsgenieAlertTaskParamsUsersItem"] = UNSET + schedules: Unset | list["CreateOpsgenieAlertTaskParamsSchedulesItem"] = UNSET + escalations: Unset | list["CreateOpsgenieAlertTaskParamsEscalationsItem"] = UNSET + priority: Unset | CreateOpsgenieAlertTaskParamsPriority = "P1" + details: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - message = self.message - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - schedules: list[dict[str, Any]] | Unset = UNSET + schedules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.schedules, Unset): schedules = [] for schedules_item_data in self.schedules: schedules_item = schedules_item_data.to_dict() schedules.append(schedules_item) - escalations: list[dict[str, Any]] | Unset = UNSET + escalations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalations, Unset): escalations = [] for escalations_item_data in self.escalations: escalations_item = escalations_item_data.to_dict() escalations.append(escalations_item) - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: None | str | Unset + details: None | Unset | str if isinstance(self.details, Unset): details = UNSET else: @@ -140,7 +137,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: CreateOpsgenieAlertTaskParamsTaskType | Unset + task_type: Unset | CreateOpsgenieAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -148,55 +145,47 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[CreateOpsgenieAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = CreateOpsgenieAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = CreateOpsgenieAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[CreateOpsgenieAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = CreateOpsgenieAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = CreateOpsgenieAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) + schedules = [] _schedules = d.pop("schedules", UNSET) - schedules: list[CreateOpsgenieAlertTaskParamsSchedulesItem] | Unset = UNSET - if _schedules is not UNSET: - schedules = [] - for schedules_item_data in _schedules: - schedules_item = CreateOpsgenieAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) + for schedules_item_data in _schedules or []: + schedules_item = CreateOpsgenieAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) - schedules.append(schedules_item) + schedules.append(schedules_item) + escalations = [] _escalations = d.pop("escalations", UNSET) - escalations: list[CreateOpsgenieAlertTaskParamsEscalationsItem] | Unset = UNSET - if _escalations is not UNSET: - escalations = [] - for escalations_item_data in _escalations: - escalations_item = CreateOpsgenieAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) + for escalations_item_data in _escalations or []: + escalations_item = CreateOpsgenieAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) - escalations.append(escalations_item) + escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: CreateOpsgenieAlertTaskParamsPriority | Unset + priority: Unset | CreateOpsgenieAlertTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_opsgenie_alert_task_params_priority(_priority) - def _parse_details(data: object) -> None | str | Unset: + def _parse_details(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) details = _parse_details(d.pop("details", UNSET)) diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py index 57756e03..23830de1 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsEscalationsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py index 47a772c1..8e712954 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsSchedulesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py index 4a3bbc40..9da5b53b 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py index 940b0635..f631ad3d 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_outlook_event_task_params.py b/rootly_sdk/models/create_outlook_event_task_params.py index a5bcdd67..ff18c799 100644 --- a/rootly_sdk/models/create_outlook_event_task_params.py +++ b/rootly_sdk/models/create_outlook_event_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,32 +30,31 @@ class CreateOutlookEventTaskParams: meeting_duration (str): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. summary (str): The event summary description (str): The event description - task_type (CreateOutlookEventTaskParamsTaskType | Unset): - attendees (list[str] | Unset): Emails of attendees - time_zone (None | str | Unset): A valid IANA time zone name. - exclude_weekends (bool | Unset): - enable_online_meeting (bool | Unset): Enable Microsoft Teams online meeting - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateOutlookEventTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateOutlookEventTaskParamsTaskType]): + attendees (Union[Unset, list[str]]): Emails of attendees + time_zone (Union[None, Unset, str]): A valid IANA time zone name. + exclude_weekends (Union[Unset, bool]): + enable_online_meeting (Union[Unset, bool]): Enable Microsoft Teams online meeting + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateOutlookEventTaskParamsPostToSlackChannelsItem']]): """ - calendar: CreateOutlookEventTaskParamsCalendar + calendar: "CreateOutlookEventTaskParamsCalendar" days_until_meeting: int time_of_meeting: str meeting_duration: str summary: str description: str - task_type: CreateOutlookEventTaskParamsTaskType | Unset = UNSET - attendees: list[str] | Unset = UNSET - time_zone: None | str | Unset = UNSET - exclude_weekends: bool | Unset = UNSET - enable_online_meeting: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateOutlookEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateOutlookEventTaskParamsTaskType = UNSET + attendees: Unset | list[str] = UNSET + time_zone: None | Unset | str = UNSET + exclude_weekends: Unset | bool = UNSET + enable_online_meeting: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateOutlookEventTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - calendar = self.calendar.to_dict() days_until_meeting = self.days_until_meeting @@ -70,15 +67,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: list[str] | Unset = UNSET + attendees: Unset | list[str] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -90,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -147,7 +144,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: CreateOutlookEventTaskParamsTaskType | Unset + task_type: Unset | CreateOutlookEventTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -155,12 +152,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attendees = cast(list[str], d.pop("attendees", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) @@ -170,16 +167,14 @@ def _parse_time_zone(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateOutlookEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateOutlookEventTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateOutlookEventTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_outlook_event_task_params = cls( calendar=calendar, diff --git a/rootly_sdk/models/create_outlook_event_task_params_calendar.py b/rootly_sdk/models/create_outlook_event_task_params_calendar.py index 887dfaf4..5f79c9ee 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_calendar.py +++ b/rootly_sdk/models/create_outlook_event_task_params_calendar.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateOutlookEventTaskParamsCalendar: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py index fefe788e..2349ee5e 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateOutlookEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_pagerduty_status_update_task_params.py b/rootly_sdk/models/create_pagerduty_status_update_task_params.py index f40fb4aa..f836a566 100644 --- a/rootly_sdk/models/create_pagerduty_status_update_task_params.py +++ b/rootly_sdk/models/create_pagerduty_status_update_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class CreatePagerdutyStatusUpdateTaskParams: Attributes: pagerduty_incident_id (str): PagerDuty incident id message (str): A message outlining the incident's resolution in PagerDuty - task_type (CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset): + task_type (Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType]): """ pagerduty_incident_id: str message: str - task_type: CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset = UNSET + task_type: Unset | CreatePagerdutyStatusUpdateTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset + task_type: Unset | CreatePagerdutyStatusUpdateTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params.py b/rootly_sdk/models/create_pagertree_alert_task_params.py index 599a1b7b..78a31a09 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,29 +30,28 @@ class CreatePagertreeAlertTaskParams: """ Attributes: - task_type (CreatePagertreeAlertTaskParamsTaskType | Unset): - title (str | Unset): Title of alert as text - description (str | Unset): Description of alert as text - urgency (CreatePagertreeAlertTaskParamsUrgency | Unset): - severity (CreatePagertreeAlertTaskParamsSeverity | Unset): - teams (list[CreatePagertreeAlertTaskParamsTeamsItem] | Unset): - users (list[CreatePagertreeAlertTaskParamsUsersItem] | Unset): - incident (bool | Unset): Setting to true makes an alert a Pagertree incident + task_type (Union[Unset, CreatePagertreeAlertTaskParamsTaskType]): + title (Union[Unset, str]): Title of alert as text + description (Union[Unset, str]): Description of alert as text + urgency (Union[Unset, CreatePagertreeAlertTaskParamsUrgency]): + severity (Union[Unset, CreatePagertreeAlertTaskParamsSeverity]): + teams (Union[Unset, list['CreatePagertreeAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['CreatePagertreeAlertTaskParamsUsersItem']]): + incident (Union[Unset, bool]): Setting to true makes an alert a Pagertree incident """ - task_type: CreatePagertreeAlertTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - urgency: CreatePagertreeAlertTaskParamsUrgency | Unset = UNSET - severity: CreatePagertreeAlertTaskParamsSeverity | Unset = UNSET - teams: list[CreatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[CreatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - incident: bool | Unset = UNSET + task_type: Unset | CreatePagertreeAlertTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + urgency: Unset | CreatePagertreeAlertTaskParamsUrgency = UNSET + severity: Unset | CreatePagertreeAlertTaskParamsSeverity = UNSET + teams: Unset | list["CreatePagertreeAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["CreatePagertreeAlertTaskParamsUsersItem"] = UNSET + incident: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,22 +59,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: str | Unset = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: str | Unset = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: list[dict[str, Any]] | Unset = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -115,7 +112,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: CreatePagertreeAlertTaskParamsTaskType | Unset + task_type: Unset | CreatePagertreeAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -126,36 +123,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: CreatePagertreeAlertTaskParamsUrgency | Unset + urgency: Unset | CreatePagertreeAlertTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_create_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: CreatePagertreeAlertTaskParamsSeverity | Unset + severity: Unset | CreatePagertreeAlertTaskParamsSeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_create_pagertree_alert_task_params_severity(_severity) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[CreatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = CreatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = CreatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[CreatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = CreatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = CreatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) incident = d.pop("incident", UNSET) diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py b/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py index 5d81a118..b863b3bb 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreatePagertreeAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py b/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py index bfe6bbb0..2855febc 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreatePagertreeAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_quip_page_task_params.py b/rootly_sdk/models/create_quip_page_task_params.py index 9265d881..619a1f99 100644 --- a/rootly_sdk/models/create_quip_page_task_params.py +++ b/rootly_sdk/models/create_quip_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,27 +18,27 @@ class CreateQuipPageTaskParams: """ Attributes: title (str): The page title - task_type (CreateQuipPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - parent_folder_id (str | Unset): The parent folder id - content (str | Unset): The page content - template_id (str | Unset): The Quip file ID to use as a template - mark_post_mortem_as_published (bool | Unset): Default: True. + task_type (Union[Unset, CreateQuipPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + parent_folder_id (Union[Unset, str]): The parent folder id + content (Union[Unset, str]): The page content + template_id (Union[Unset, str]): The Quip file ID to use as a template + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. """ title: str - task_type: CreateQuipPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - parent_folder_id: str | Unset = UNSET - content: str | Unset = UNSET - template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True + task_type: Unset | CreateQuipPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + parent_folder_id: Unset | str = UNSET + content: Unset | str = UNSET + template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -82,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateQuipPageTaskParamsTaskType | Unset + task_type: Unset | CreateQuipPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_service_now_incident_task_params.py b/rootly_sdk/models/create_service_now_incident_task_params.py index 0f10232b..14cdd261 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params.py +++ b/rootly_sdk/models/create_service_now_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,41 +23,40 @@ class CreateServiceNowIncidentTaskParams: """ Attributes: title (str): The incident title - task_type (CreateServiceNowIncidentTaskParamsTaskType | Unset): - description (str | Unset): The incident description - priority (CreateServiceNowIncidentTaskParamsPriority | Unset): The priority id and display name - completion (CreateServiceNowIncidentTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateServiceNowIncidentTaskParamsTaskType]): + description (Union[Unset, str]): The incident description + priority (Union[Unset, CreateServiceNowIncidentTaskParamsPriority]): The priority id and display name + completion (Union[Unset, CreateServiceNowIncidentTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ title: str - task_type: CreateServiceNowIncidentTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - priority: CreateServiceNowIncidentTaskParamsPriority | Unset = UNSET - completion: CreateServiceNowIncidentTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Unset | CreateServiceNowIncidentTaskParamsTaskType = UNSET + description: Unset | str = UNSET + priority: Union[Unset, "CreateServiceNowIncidentTaskParamsPriority"] = UNSET + completion: Union[Unset, "CreateServiceNowIncidentTaskParamsCompletion"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -96,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateServiceNowIncidentTaskParamsTaskType | Unset + task_type: Unset | CreateServiceNowIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -105,25 +102,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateServiceNowIncidentTaskParamsPriority | Unset + priority: Unset | CreateServiceNowIncidentTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: CreateServiceNowIncidentTaskParamsCompletion | Unset + completion: Unset | CreateServiceNowIncidentTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = CreateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_service_now_incident_task_params_completion.py b/rootly_sdk/models/create_service_now_incident_task_params_completion.py index 550f0f18..ec01454d 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_completion.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateServiceNowIncidentTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_service_now_incident_task_params_priority.py b/rootly_sdk/models/create_service_now_incident_task_params_priority.py index 186be050..b1d196e4 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_priority.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateServiceNowIncidentTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params.py b/rootly_sdk/models/create_sharepoint_page_task_params.py index f76d8f61..b75eb1f2 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,34 +26,33 @@ class CreateSharepointPageTaskParams: title (str): The page title site (CreateSharepointPageTaskParamsSite): drive (CreateSharepointPageTaskParamsDrive): - task_type (CreateSharepointPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - parent_folder (CreateSharepointPageTaskParamsParentFolder | Unset): - content (str | Unset): The page content - template_id (str | Unset): The SharePoint file ID to use as a template + task_type (Union[Unset, CreateSharepointPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + parent_folder (Union[Unset, CreateSharepointPageTaskParamsParentFolder]): + content (Union[Unset, str]): The page content + template_id (Union[Unset, str]): The SharePoint file ID to use as a template """ title: str - site: CreateSharepointPageTaskParamsSite - drive: CreateSharepointPageTaskParamsDrive - task_type: CreateSharepointPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - parent_folder: CreateSharepointPageTaskParamsParentFolder | Unset = UNSET - content: str | Unset = UNSET - template_id: str | Unset = UNSET + site: "CreateSharepointPageTaskParamsSite" + drive: "CreateSharepointPageTaskParamsDrive" + task_type: Unset | CreateSharepointPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + parent_folder: Union[Unset, "CreateSharepointPageTaskParamsParentFolder"] = UNSET + content: Unset | str = UNSET + template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title site = self.site.to_dict() drive = self.drive.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - parent_folder: dict[str, Any] | Unset = UNSET + parent_folder: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -109,7 +106,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: drive = CreateSharepointPageTaskParamsDrive.from_dict(d.pop("drive")) _task_type = d.pop("task_type", UNSET) - task_type: CreateSharepointPageTaskParamsTaskType | Unset + task_type: Unset | CreateSharepointPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -120,7 +117,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: CreateSharepointPageTaskParamsParentFolder | Unset + parent_folder: Unset | CreateSharepointPageTaskParamsParentFolder if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py index cbf15f10..eb8f611c 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateSharepointPageTaskParamsDrive: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py b/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py index 16f35526..8bf706ee 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateSharepointPageTaskParamsParentFolder: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_site.py b/rootly_sdk/models/create_sharepoint_page_task_params_site.py index 638cc4f0..10269545 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_site.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_site.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateSharepointPageTaskParamsSite: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py b/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py index 1f749fa3..b27655da 100644 --- a/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py +++ b/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateShortcutStoryTaskParamsType0Project: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py b/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py index cf311fb3..ee086426 100644 --- a/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py +++ b/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateShortcutStoryTaskParamsType1WorkflowState: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_task_task_params.py b/rootly_sdk/models/create_shortcut_task_task_params.py index 2b27b227..13958785 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params.py +++ b/rootly_sdk/models/create_shortcut_task_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,24 +24,23 @@ class CreateShortcutTaskTaskParams: parent_story_id (str): The parent story description (str): The task description completion (CreateShortcutTaskTaskParamsCompletion): The completion id and display name - task_type (CreateShortcutTaskTaskParamsTaskType | Unset): + task_type (Union[Unset, CreateShortcutTaskTaskParamsTaskType]): """ parent_story_id: str description: str - completion: CreateShortcutTaskTaskParamsCompletion - task_type: CreateShortcutTaskTaskParamsTaskType | Unset = UNSET + completion: "CreateShortcutTaskTaskParamsCompletion" + task_type: Unset | CreateShortcutTaskTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - parent_story_id = self.parent_story_id description = self.description completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateShortcutTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: CreateShortcutTaskTaskParamsTaskType | Unset + task_type: Unset | CreateShortcutTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_shortcut_task_task_params_completion.py b/rootly_sdk/models/create_shortcut_task_task_params_completion.py index 01333610..be24cd42 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/create_shortcut_task_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateShortcutTaskTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_slack_channel_task_params.py b/rootly_sdk/models/create_slack_channel_task_params.py index 4587c12a..18954329 100644 --- a/rootly_sdk/models/create_slack_channel_task_params.py +++ b/rootly_sdk/models/create_slack_channel_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,27 +27,26 @@ class CreateSlackChannelTaskParams: Attributes: workspace (CreateSlackChannelTaskParamsWorkspace): title (str): Slack channel title - task_type (CreateSlackChannelTaskParamsTaskType | Unset): - private (CreateSlackChannelTaskParamsPrivate | Unset): Default: 'auto'. + task_type (Union[Unset, CreateSlackChannelTaskParamsTaskType]): + private (Union[Unset, CreateSlackChannelTaskParamsPrivate]): Default: 'auto'. """ - workspace: CreateSlackChannelTaskParamsWorkspace + workspace: "CreateSlackChannelTaskParamsWorkspace" title: str - task_type: CreateSlackChannelTaskParamsTaskType | Unset = UNSET - private: CreateSlackChannelTaskParamsPrivate | Unset = "auto" + task_type: Unset | CreateSlackChannelTaskParamsTaskType = UNSET + private: Unset | CreateSlackChannelTaskParamsPrivate = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workspace = self.workspace.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - private: str | Unset = UNSET + private: Unset | str = UNSET if not isinstance(self.private, Unset): private = self.private @@ -78,14 +75,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateSlackChannelTaskParamsTaskType | Unset + task_type: Unset | CreateSlackChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_slack_channel_task_params_task_type(_task_type) _private = d.pop("private", UNSET) - private: CreateSlackChannelTaskParamsPrivate | Unset + private: Unset | CreateSlackChannelTaskParamsPrivate if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_slack_channel_task_params_workspace.py b/rootly_sdk/models/create_slack_channel_task_params_workspace.py index 6c6f4e33..c2f64805 100644 --- a/rootly_sdk/models/create_slack_channel_task_params_workspace.py +++ b/rootly_sdk/models/create_slack_channel_task_params_workspace.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateSlackChannelTaskParamsWorkspace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sub_incident_task_params.py b/rootly_sdk/models/create_sub_incident_task_params.py index 0f2a0359..4a0a9236 100644 --- a/rootly_sdk/models/create_sub_incident_task_params.py +++ b/rootly_sdk/models/create_sub_incident_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,19 +18,19 @@ class CreateSubIncidentTaskParams: """ Attributes: title (str): The sub incident title - task_type (CreateSubIncidentTaskParamsTaskType | Unset): - summary (str | Unset): The sub incident summary + task_type (Union[Unset, CreateSubIncidentTaskParamsTaskType]): + summary (Union[Unset, str]): The sub incident summary """ title: str - task_type: CreateSubIncidentTaskParamsTaskType | Unset = UNSET - summary: str | Unset = UNSET + task_type: Unset | CreateSubIncidentTaskParamsTaskType = UNSET + summary: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,7 +56,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateSubIncidentTaskParamsTaskType | Unset + task_type: Unset | CreateSubIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_trello_card_task_params.py b/rootly_sdk/models/create_trello_card_task_params.py index b1d2e73f..af6370a8 100644 --- a/rootly_sdk/models/create_trello_card_task_params.py +++ b/rootly_sdk/models/create_trello_card_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,32 +27,31 @@ class CreateTrelloCardTaskParams: title (str): The card title board (CreateTrelloCardTaskParamsBoard): The board id and display name list_ (CreateTrelloCardTaskParamsList): The list id and display name - task_type (CreateTrelloCardTaskParamsTaskType | Unset): - description (str | Unset): The card description - due_date (str | Unset): The due date - labels (list[CreateTrelloCardTaskParamsLabelsItem] | Unset): - archivation (CreateTrelloCardTaskParamsArchivation | Unset): The archivation id and display name + task_type (Union[Unset, CreateTrelloCardTaskParamsTaskType]): + description (Union[Unset, str]): The card description + due_date (Union[Unset, str]): The due date + labels (Union[Unset, list['CreateTrelloCardTaskParamsLabelsItem']]): + archivation (Union[Unset, CreateTrelloCardTaskParamsArchivation]): The archivation id and display name """ title: str - board: CreateTrelloCardTaskParamsBoard - list_: CreateTrelloCardTaskParamsList - task_type: CreateTrelloCardTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - due_date: str | Unset = UNSET - labels: list[CreateTrelloCardTaskParamsLabelsItem] | Unset = UNSET - archivation: CreateTrelloCardTaskParamsArchivation | Unset = UNSET + board: "CreateTrelloCardTaskParamsBoard" + list_: "CreateTrelloCardTaskParamsList" + task_type: Unset | CreateTrelloCardTaskParamsTaskType = UNSET + description: Unset | str = UNSET + due_date: Unset | str = UNSET + labels: Unset | list["CreateTrelloCardTaskParamsLabelsItem"] = UNSET + archivation: Union[Unset, "CreateTrelloCardTaskParamsArchivation"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title board = self.board.to_dict() list_ = self.list_.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,14 +59,14 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - archivation: dict[str, Any] | Unset = UNSET + archivation: Unset | dict[str, Any] = UNSET if not isinstance(self.archivation, Unset): archivation = self.archivation.to_dict() @@ -110,7 +107,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: list_ = CreateTrelloCardTaskParamsList.from_dict(d.pop("list")) _task_type = d.pop("task_type", UNSET) - task_type: CreateTrelloCardTaskParamsTaskType | Unset + task_type: Unset | CreateTrelloCardTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -120,17 +117,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateTrelloCardTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _archivation = d.pop("archivation", UNSET) - archivation: CreateTrelloCardTaskParamsArchivation | Unset + archivation: Unset | CreateTrelloCardTaskParamsArchivation if isinstance(_archivation, Unset): archivation = UNSET else: diff --git a/rootly_sdk/models/create_trello_card_task_params_archivation.py b/rootly_sdk/models/create_trello_card_task_params_archivation.py index 156c86c7..34647fb8 100644 --- a/rootly_sdk/models/create_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/create_trello_card_task_params_archivation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateTrelloCardTaskParamsArchivation: """The archivation id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_board.py b/rootly_sdk/models/create_trello_card_task_params_board.py index 358d9808..792a44b2 100644 --- a/rootly_sdk/models/create_trello_card_task_params_board.py +++ b/rootly_sdk/models/create_trello_card_task_params_board.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateTrelloCardTaskParamsBoard: """The board id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_labels_item.py b/rootly_sdk/models/create_trello_card_task_params_labels_item.py index 42ad31bb..75cb16c4 100644 --- a/rootly_sdk/models/create_trello_card_task_params_labels_item.py +++ b/rootly_sdk/models/create_trello_card_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateTrelloCardTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_list.py b/rootly_sdk/models/create_trello_card_task_params_list.py index 6c584b6b..7c2b9197 100644 --- a/rootly_sdk/models/create_trello_card_task_params_list.py +++ b/rootly_sdk/models/create_trello_card_task_params_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateTrelloCardTaskParamsList: """The list id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py index 0524c92d..ecf53077 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,26 +24,25 @@ class CreateWatsonxChatCompletionTaskParams: model (CreateWatsonxChatCompletionTaskParamsModel): The WatsonX model. eg: ibm/granite-3-b8b-instruct prompt (str): The prompt to send to WatsonX project_id (str): - task_type (CreateWatsonxChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to WatsonX (optional) + task_type (Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to WatsonX (optional) """ - model: CreateWatsonxChatCompletionTaskParamsModel + model: "CreateWatsonxChatCompletionTaskParamsModel" prompt: str project_id: str - task_type: CreateWatsonxChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET + task_type: Unset | CreateWatsonxChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt project_id = self.project_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_id = d.pop("project_id") _task_type = d.pop("task_type", UNSET) - task_type: CreateWatsonxChatCompletionTaskParamsTaskType | Unset + task_type: Unset | CreateWatsonxChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py index e26a08fb..1a1b5d64 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateWatsonxChatCompletionTaskParamsModel: """The WatsonX model. eg: ibm/granite-3-b8b-instruct Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_webex_meeting_task_params.py b/rootly_sdk/models/create_webex_meeting_task_params.py index 20afbca5..895ac35f 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params.py +++ b/rootly_sdk/models/create_webex_meeting_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,30 +28,29 @@ class CreateWebexMeetingTaskParams: """ Attributes: topic (str): The meeting topic - task_type (CreateWebexMeetingTaskParamsTaskType | Unset): - password (str | Unset): The meeting password - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateWebexMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's recording - (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateWebexMeetingTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateWebexMeetingTaskParamsTaskType]): + password (Union[Unset, str]): The meeting password + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateWebexMeetingTaskParamsRecordingMode]): The video layout for the bot's + recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateWebexMeetingTaskParamsPostToSlackChannelsItem']]): """ topic: str - task_type: CreateWebexMeetingTaskParamsTaskType | Unset = UNSET - password: str | Unset = UNSET - record_meeting: bool | Unset = UNSET - recording_mode: CreateWebexMeetingTaskParamsRecordingMode | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateWebexMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateWebexMeetingTaskParamsTaskType = UNSET + password: Unset | str = UNSET + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateWebexMeetingTaskParamsRecordingMode = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateWebexMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - topic = self.topic - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -106,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: CreateWebexMeetingTaskParamsTaskType | Unset + task_type: Unset | CreateWebexMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -117,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateWebexMeetingTaskParamsRecordingMode | Unset + recording_mode: Unset | CreateWebexMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -125,16 +122,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateWebexMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateWebexMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateWebexMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_webex_meeting_task_params = cls( topic=topic, diff --git a/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py index 6e3cd47d..8ed5a6db 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateWebexMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zendesk_jira_link_task_params.py b/rootly_sdk/models/create_zendesk_jira_link_task_params.py index 79171b39..26ac50a0 100644 --- a/rootly_sdk/models/create_zendesk_jira_link_task_params.py +++ b/rootly_sdk/models/create_zendesk_jira_link_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -22,13 +20,13 @@ class CreateZendeskJiraLinkTaskParams: jira_issue_id (str): Jira Issue Id. jira_issue_key (str): Jira Issue Key. zendesk_ticket_id (str): Zendesk Ticket Id. - task_type (CreateZendeskJiraLinkTaskParamsTaskType | Unset): + task_type (Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType]): """ jira_issue_id: str jira_issue_key: str zendesk_ticket_id: str - task_type: CreateZendeskJiraLinkTaskParamsTaskType | Unset = UNSET + task_type: Unset | CreateZendeskJiraLinkTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: zendesk_ticket_id = self.zendesk_ticket_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: zendesk_ticket_id = d.pop("zendesk_ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: CreateZendeskJiraLinkTaskParamsTaskType | Unset + task_type: Unset | CreateZendeskJiraLinkTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params.py b/rootly_sdk/models/create_zendesk_ticket_task_params.py index ecf79ca3..8e5038ed 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,35 +28,34 @@ class CreateZendeskTicketTaskParams: Attributes: kind (CreateZendeskTicketTaskParamsKind): subject (str): The ticket subject - task_type (CreateZendeskTicketTaskParamsTaskType | Unset): - comment (str | Unset): The ticket comment - tags (str | Unset): The ticket tags - priority (CreateZendeskTicketTaskParamsPriority | Unset): The priority id and display name - completion (CreateZendeskTicketTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateZendeskTicketTaskParamsTaskType]): + comment (Union[Unset, str]): The ticket comment + tags (Union[Unset, str]): The ticket tags + priority (Union[Unset, CreateZendeskTicketTaskParamsPriority]): The priority id and display name + completion (Union[Unset, CreateZendeskTicketTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - ticket_payload (None | str | Unset): Additional Zendesk ticket attributes. Will be merged into whatever was + ticket_payload (Union[None, Unset, str]): Additional Zendesk ticket attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ kind: CreateZendeskTicketTaskParamsKind subject: str - task_type: CreateZendeskTicketTaskParamsTaskType | Unset = UNSET - comment: str | Unset = UNSET - tags: str | Unset = UNSET - priority: CreateZendeskTicketTaskParamsPriority | Unset = UNSET - completion: CreateZendeskTicketTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - ticket_payload: None | str | Unset = UNSET + task_type: Unset | CreateZendeskTicketTaskParamsTaskType = UNSET + comment: Unset | str = UNSET + tags: Unset | str = UNSET + priority: Union[Unset, "CreateZendeskTicketTaskParamsPriority"] = UNSET + completion: Union[Unset, "CreateZendeskTicketTaskParamsCompletion"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + ticket_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str = self.kind subject = self.subject - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,21 +63,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: None | str | Unset + ticket_payload: None | Unset | str if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -122,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: CreateZendeskTicketTaskParamsTaskType | Unset + task_type: Unset | CreateZendeskTicketTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -133,34 +130,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateZendeskTicketTaskParamsPriority | Unset + priority: Unset | CreateZendeskTicketTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: CreateZendeskTicketTaskParamsCompletion | Unset + completion: Unset | CreateZendeskTicketTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = CreateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> None | str | Unset: + def _parse_ticket_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ticket_payload = _parse_ticket_payload(d.pop("ticket_payload", UNSET)) diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py index 2554ba85..e6192bfd 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateZendeskTicketTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py index 8a7902cb..eaeb09b3 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class CreateZendeskTicketTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zoom_meeting_task_params.py b/rootly_sdk/models/create_zoom_meeting_task_params.py index 835f6ef5..9aa314b4 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,39 +32,38 @@ class CreateZoomMeetingTaskParams: """ Attributes: topic (str): The meeting topic - task_type (CreateZoomMeetingTaskParamsTaskType | Unset): - password (str | Unset): The meeting password - create_as_email (str | Unset): The email to use if creating as email - alternative_hosts (list[str] | Unset): - auto_recording (CreateZoomMeetingTaskParamsAutoRecording | Unset): Default: 'none'. - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateZoomMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's recording - (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - enable_zoom_bot_auto_join (bool | Unset): Allow the Rootly bot to start recording without waiting for host + task_type (Union[Unset, CreateZoomMeetingTaskParamsTaskType]): + password (Union[Unset, str]): The meeting password + create_as_email (Union[Unset, str]): The email to use if creating as email + alternative_hosts (Union[Unset, list[str]]): + auto_recording (Union[Unset, CreateZoomMeetingTaskParamsAutoRecording]): Default: 'none'. + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateZoomMeetingTaskParamsRecordingMode]): The video layout for the bot's + recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + enable_zoom_bot_auto_join (Union[Unset, bool]): Allow the Rootly bot to start recording without waiting for host approval - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateZoomMeetingTaskParamsPostToSlackChannelsItem']]): """ topic: str - task_type: CreateZoomMeetingTaskParamsTaskType | Unset = UNSET - password: str | Unset = UNSET - create_as_email: str | Unset = UNSET - alternative_hosts: list[str] | Unset = UNSET - auto_recording: CreateZoomMeetingTaskParamsAutoRecording | Unset = "none" - record_meeting: bool | Unset = UNSET - recording_mode: CreateZoomMeetingTaskParamsRecordingMode | Unset = UNSET - enable_zoom_bot_auto_join: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | CreateZoomMeetingTaskParamsTaskType = UNSET + password: Unset | str = UNSET + create_as_email: Unset | str = UNSET + alternative_hosts: Unset | list[str] = UNSET + auto_recording: Unset | CreateZoomMeetingTaskParamsAutoRecording = "none" + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateZoomMeetingTaskParamsRecordingMode = UNSET + enable_zoom_bot_auto_join: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateZoomMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - topic = self.topic - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,17 +71,17 @@ def to_dict(self) -> dict[str, Any]: create_as_email = self.create_as_email - alternative_hosts: list[str] | Unset = UNSET + alternative_hosts: Unset | list[str] = UNSET if not isinstance(self.alternative_hosts, Unset): alternative_hosts = self.alternative_hosts - auto_recording: str | Unset = UNSET + auto_recording: Unset | str = UNSET if not isinstance(self.auto_recording, Unset): auto_recording = self.auto_recording record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode @@ -92,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -139,7 +136,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: CreateZoomMeetingTaskParamsTaskType | Unset + task_type: Unset | CreateZoomMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -152,7 +149,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alternative_hosts = cast(list[str], d.pop("alternative_hosts", UNSET)) _auto_recording = d.pop("auto_recording", UNSET) - auto_recording: CreateZoomMeetingTaskParamsAutoRecording | Unset + auto_recording: Unset | CreateZoomMeetingTaskParamsAutoRecording if isinstance(_auto_recording, Unset): auto_recording = UNSET else: @@ -161,7 +158,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateZoomMeetingTaskParamsRecordingMode | Unset + recording_mode: Unset | CreateZoomMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -171,16 +168,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateZoomMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateZoomMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_zoom_meeting_task_params = cls( topic=topic, diff --git a/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py index 7a669f7c..e468c08c 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class CreateZoomMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/custom_field.py b/rootly_sdk/models/custom_field.py index b4fbada2..3396bd0b 100644 --- a/rootly_sdk/models/custom_field.py +++ b/rootly_sdk/models/custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -10,6 +8,7 @@ CustomFieldRequiredType0Item, check_custom_field_required_type_0_item, ) +from ..models.custom_field_resource_type import CustomFieldResourceType, check_custom_field_resource_type from ..models.custom_field_shown_item import CustomFieldShownItem, check_custom_field_shown_item from ..types import UNSET, Unset @@ -22,28 +21,30 @@ class CustomField: Attributes: label (str): The name of the custom_field shown (list[CustomFieldShownItem]): - required (list[CustomFieldRequiredType0Item] | None): + required (Union[None, list[CustomFieldRequiredType0Item]]): position (int): The position of the custom_field created_at (str): Date of creation updated_at (str): Date of last update - kind (str | Unset): The kind of the custom_field - enabled (bool | Unset): Whether the custom_field is enabled - slug (str | Unset): The slug of the custom_field - description (None | str | Unset): The description of the custom_field - default (None | str | Unset): The default value for text field kinds + kind (Union[Unset, str]): The kind of the custom_field + enabled (Union[Unset, bool]): Whether the custom_field is enabled + slug (Union[Unset, str]): The slug of the custom_field + resource_type (Union[Unset, CustomFieldResourceType]): The resource type this field belongs to + description (Union[None, Unset, str]): The description of the custom_field + default (Union[None, Unset, str]): The default value for text field kinds """ label: str shown: list[CustomFieldShownItem] - required: list[CustomFieldRequiredType0Item] | None + required: None | list[CustomFieldRequiredType0Item] position: int created_at: str updated_at: str - kind: str | Unset = UNSET - enabled: bool | Unset = UNSET - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - default: None | str | Unset = UNSET + kind: Unset | str = UNSET + enabled: Unset | bool = UNSET + slug: Unset | str = UNSET + resource_type: Unset | CustomFieldResourceType = UNSET + description: None | Unset | str = UNSET + default: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: shown_item: str = shown_item_data shown.append(shown_item) - required: list[str] | None + required: None | list[str] if isinstance(self.required, list): required = [] for required_type_0_item_data in self.required: @@ -76,13 +77,17 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + resource_type: Unset | str = UNSET + if not isinstance(self.resource_type, Unset): + resource_type = self.resource_type + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | str | Unset + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: @@ -106,6 +111,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["enabled"] = enabled if slug is not UNSET: field_dict["slug"] = slug + if resource_type is not UNSET: + field_dict["resource_type"] = resource_type if description is not UNSET: field_dict["description"] = description if default is not UNSET: @@ -125,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shown.append(shown_item) - def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: + def _parse_required(data: object) -> None | list[CustomFieldRequiredType0Item]: if data is None: return data try: @@ -139,9 +146,9 @@ def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: required_type_0.append(required_type_0_item) return required_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CustomFieldRequiredType0Item] | None, data) + return cast(None | list[CustomFieldRequiredType0Item], data) required = _parse_required(d.pop("required")) @@ -157,21 +164,28 @@ def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + _resource_type = d.pop("resource_type", UNSET) + resource_type: Unset | CustomFieldResourceType + if isinstance(_resource_type, Unset): + resource_type = UNSET + else: + resource_type = check_custom_field_resource_type(_resource_type) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) @@ -185,6 +199,7 @@ def _parse_default(data: object) -> None | str | Unset: kind=kind, enabled=enabled, slug=slug, + resource_type=resource_type, description=description, default=default, ) diff --git a/rootly_sdk/models/custom_field_list.py b/rootly_sdk/models/custom_field_list.py index fe97544e..6e733b5a 100644 --- a/rootly_sdk/models/custom_field_list.py +++ b/rootly_sdk/models/custom_field_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CustomFieldList: """ Attributes: - data (list[CustomFieldListDataItem]): + data (list['CustomFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CustomFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CustomFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_list = cls( data=data, diff --git a/rootly_sdk/models/custom_field_list_data_item.py b/rootly_sdk/models/custom_field_list_data_item.py index fffd241a..608b0c38 100644 --- a/rootly_sdk/models/custom_field_list_data_item.py +++ b/rootly_sdk/models/custom_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CustomFieldListDataItem: id: str type_: CustomFieldListDataItemType - attributes: CustomField + attributes: "CustomField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_field_option.py b/rootly_sdk/models/custom_field_option.py index 74f9d516..68edd831 100644 --- a/rootly_sdk/models/custom_field_option.py +++ b/rootly_sdk/models/custom_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,8 +18,8 @@ class CustomFieldOption: position (int): The position of the custom_field_option created_at (str): Date of creation updated_at (str): Date of last update - custom_field_id (int | Unset): The ID of the parent custom field - default (bool | Unset): + custom_field_id (Union[Unset, int]): The ID of the parent custom field + default (Union[Unset, bool]): """ value: str @@ -29,8 +27,8 @@ class CustomFieldOption: position: int created_at: str updated_at: str - custom_field_id: int | Unset = UNSET - default: bool | Unset = UNSET + custom_field_id: Unset | int = UNSET + default: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/custom_field_option_list.py b/rootly_sdk/models/custom_field_option_list.py index 8a317936..c6152167 100644 --- a/rootly_sdk/models/custom_field_option_list.py +++ b/rootly_sdk/models/custom_field_option_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CustomFieldOptionList: """ Attributes: - data (list[CustomFieldOptionListDataItem]): + data (list['CustomFieldOptionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CustomFieldOptionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CustomFieldOptionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_option_list = cls( data=data, diff --git a/rootly_sdk/models/custom_field_option_list_data_item.py b/rootly_sdk/models/custom_field_option_list_data_item.py index a4f0144a..1807c6b6 100644 --- a/rootly_sdk/models/custom_field_option_list_data_item.py +++ b/rootly_sdk/models/custom_field_option_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CustomFieldOptionListDataItem: id: str type_: CustomFieldOptionListDataItemType - attributes: CustomFieldOption + attributes: "CustomFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_field_option_response.py b/rootly_sdk/models/custom_field_option_response.py index 88160965..3e9da894 100644 --- a/rootly_sdk/models/custom_field_option_response.py +++ b/rootly_sdk/models/custom_field_option_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CustomFieldOptionResponse: """ Attributes: data (CustomFieldOptionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CustomFieldOptionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CustomFieldOptionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CustomFieldOptionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_option_response = cls( data=data, diff --git a/rootly_sdk/models/custom_field_option_response_data.py b/rootly_sdk/models/custom_field_option_response_data.py index d715f128..93ea8892 100644 --- a/rootly_sdk/models/custom_field_option_response_data.py +++ b/rootly_sdk/models/custom_field_option_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CustomFieldOptionResponseData: id: str type_: CustomFieldOptionResponseDataType - attributes: CustomFieldOption + attributes: "CustomFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_field_resource_type.py b/rootly_sdk/models/custom_field_resource_type.py new file mode 100644 index 00000000..b3fab9ba --- /dev/null +++ b/rootly_sdk/models/custom_field_resource_type.py @@ -0,0 +1,16 @@ +from typing import Literal, cast + +CustomFieldResourceType = Literal["incident", "problem"] + +CUSTOM_FIELD_RESOURCE_TYPE_VALUES: set[CustomFieldResourceType] = { + "incident", + "problem", +} + + +def check_custom_field_resource_type(value: str | None) -> CustomFieldResourceType | None: + if value is None: + return None + if value in CUSTOM_FIELD_RESOURCE_TYPE_VALUES: + return cast(CustomFieldResourceType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_RESOURCE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_response.py b/rootly_sdk/models/custom_field_response.py index 502d3f37..751fb9c3 100644 --- a/rootly_sdk/models/custom_field_response.py +++ b/rootly_sdk/models/custom_field_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CustomFieldResponse: """ Attributes: data (CustomFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CustomFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CustomFieldResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CustomFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_response = cls( data=data, diff --git a/rootly_sdk/models/custom_field_response_data.py b/rootly_sdk/models/custom_field_response_data.py index 54454627..a33f5985 100644 --- a/rootly_sdk/models/custom_field_response_data.py +++ b/rootly_sdk/models/custom_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CustomFieldResponseData: id: str type_: CustomFieldResponseDataType - attributes: CustomField + attributes: "CustomField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_form.py b/rootly_sdk/models/custom_form.py index 78ee24bb..5e5b7092 100644 --- a/rootly_sdk/models/custom_form.py +++ b/rootly_sdk/models/custom_form.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,9 +18,9 @@ class CustomForm: command (str): The Slack command used to trigger this form. created_at (str): Date of creation. updated_at (str): Date of last update. - slug (str | Unset): The custom form slug. Add this to form_field.shown or form_field.required to associate form - fields with custom forms. - description (None | str | Unset): + slug (Union[Unset, str]): The custom form slug. Add this to form_field.shown or form_field.required to associate + form fields with custom forms. + description (Union[None, Unset, str]): """ name: str @@ -30,8 +28,8 @@ class CustomForm: command: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -86,12 +84,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/custom_form_list.py b/rootly_sdk/models/custom_form_list.py index 8c429938..4f876e98 100644 --- a/rootly_sdk/models/custom_form_list.py +++ b/rootly_sdk/models/custom_form_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class CustomFormList: """ Attributes: - data (list[CustomFormListDataItem]): + data (list['CustomFormListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CustomFormListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CustomFormListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_form_list = cls( data=data, diff --git a/rootly_sdk/models/custom_form_list_data_item.py b/rootly_sdk/models/custom_form_list_data_item.py index 3aba2bac..3f36ae0d 100644 --- a/rootly_sdk/models/custom_form_list_data_item.py +++ b/rootly_sdk/models/custom_form_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CustomFormListDataItem: id: str type_: CustomFormListDataItemType - attributes: CustomForm + attributes: "CustomForm" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_form_response.py b/rootly_sdk/models/custom_form_response.py index f1bfe51b..1d2dd1cc 100644 --- a/rootly_sdk/models/custom_form_response.py +++ b/rootly_sdk/models/custom_form_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class CustomFormResponse: """ Attributes: data (CustomFormResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CustomFormResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CustomFormResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CustomFormResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_form_response = cls( data=data, diff --git a/rootly_sdk/models/custom_form_response_data.py b/rootly_sdk/models/custom_form_response_data.py index 3ea9ebe9..ae29c003 100644 --- a/rootly_sdk/models/custom_form_response_data.py +++ b/rootly_sdk/models/custom_form_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CustomFormResponseData: id: str type_: CustomFormResponseDataType - attributes: CustomForm + attributes: "CustomForm" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard.py b/rootly_sdk/models/dashboard.py index f83fc0c9..ce1b6222 100644 --- a/rootly_sdk/models/dashboard.py +++ b/rootly_sdk/models/dashboard.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,31 +18,31 @@ class Dashboard: name (str): The name of the dashboard owner (DashboardOwner): The owner type of the dashboard public (bool): Whether the dashboard is public - team_id (int | Unset): The dashboard team - user_id (int | None | Unset): The dashboard user owner if owner is of type user - description (None | str | Unset): The description of the dashboard - range_ (None | str | Unset): The date range for dashboard panel data - period (None | str | Unset): The grouping period for dashboard panel data - auto_refresh (bool | Unset): Whether the dashboard auto-updates the UI with new data. - color (DashboardColor | Unset): The hex color of the dashboard - icon (str | Unset): The emoji icon of the dashboard - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + team_id (Union[Unset, int]): The dashboard team + user_id (Union[None, Unset, int]): The dashboard user owner if owner is of type user + description (Union[None, Unset, str]): The description of the dashboard + range_ (Union[None, Unset, str]): The date range for dashboard panel data + period (Union[None, Unset, str]): The grouping period for dashboard panel data + auto_refresh (Union[Unset, bool]): Whether the dashboard auto-updates the UI with new data. + color (Union[Unset, DashboardColor]): The hex color of the dashboard + icon (Union[Unset, str]): The emoji icon of the dashboard + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ name: str owner: DashboardOwner public: bool - team_id: int | Unset = UNSET - user_id: int | None | Unset = UNSET - description: None | str | Unset = UNSET - range_: None | str | Unset = UNSET - period: None | str | Unset = UNSET - auto_refresh: bool | Unset = UNSET - color: DashboardColor | Unset = UNSET - icon: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + team_id: Unset | int = UNSET + user_id: None | Unset | int = UNSET + description: None | Unset | str = UNSET + range_: None | Unset | str = UNSET + period: None | Unset | str = UNSET + auto_refresh: Unset | bool = UNSET + color: Unset | DashboardColor = UNSET + icon: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,25 +54,25 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - user_id: int | None | Unset + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - range_: None | str | Unset + range_: None | Unset | str if isinstance(self.range_, Unset): range_ = UNSET else: range_ = self.range_ - period: None | str | Unset + period: None | Unset | str if isinstance(self.period, Unset): period = UNSET else: @@ -82,7 +80,7 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: str | Unset = UNSET + color: Unset | str = UNSET if not isinstance(self.color, Unset): color = self.color @@ -135,46 +133,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team_id = d.pop("team_id", UNSET) - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_range_(data: object) -> None | str | Unset: + def _parse_range_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) range_ = _parse_range_(d.pop("range", UNSET)) - def _parse_period(data: object) -> None | str | Unset: + def _parse_period(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) period = _parse_period(d.pop("period", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: DashboardColor | Unset + color: Unset | DashboardColor if isinstance(_color, Unset): color = UNSET else: diff --git a/rootly_sdk/models/dashboard_list.py b/rootly_sdk/models/dashboard_list.py index 265ba250..ff4b99da 100644 --- a/rootly_sdk/models/dashboard_list.py +++ b/rootly_sdk/models/dashboard_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class DashboardList: """ Attributes: - data (list[DashboardListDataItem]): + data (list['DashboardListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[DashboardListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["DashboardListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_list = cls( data=data, diff --git a/rootly_sdk/models/dashboard_list_data_item.py b/rootly_sdk/models/dashboard_list_data_item.py index 8950eaf7..86d1b13b 100644 --- a/rootly_sdk/models/dashboard_list_data_item.py +++ b/rootly_sdk/models/dashboard_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class DashboardListDataItem: id: str type_: DashboardListDataItemType - attributes: Dashboard + attributes: "Dashboard" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard_panel.py b/rootly_sdk/models/dashboard_panel.py index 4cd0dbe5..26995283 100644 --- a/rootly_sdk/models/dashboard_panel.py +++ b/rootly_sdk/models/dashboard_panel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,17 +20,17 @@ class DashboardPanel: """ Attributes: params (DashboardPanelParams): - dashboard_id (str | Unset): The panel dashboard - name (None | str | Unset): The name of the dashboard_panel - position (DashboardPanelPositionType0 | None | Unset): - data (list[DashboardPanelDataItem] | Unset): + dashboard_id (Union[Unset, str]): The panel dashboard + name (Union[None, Unset, str]): The name of the dashboard_panel + position (Union['DashboardPanelPositionType0', None, Unset]): + data (Union[Unset, list['DashboardPanelDataItem']]): """ - params: DashboardPanelParams - dashboard_id: str | Unset = UNSET - name: None | str | Unset = UNSET - position: DashboardPanelPositionType0 | None | Unset = UNSET - data: list[DashboardPanelDataItem] | Unset = UNSET + params: "DashboardPanelParams" + dashboard_id: Unset | str = UNSET + name: None | Unset | str = UNSET + position: Union["DashboardPanelPositionType0", None, Unset] = UNSET + data: Unset | list["DashboardPanelDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +40,13 @@ def to_dict(self) -> dict[str, Any]: dashboard_id = self.dashboard_id - name: None | str | Unset + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: dict[str, Any] | None | Unset + position: None | Unset | dict[str, Any] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, DashboardPanelPositionType0): @@ -56,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: else: position = self.position - data: list[dict[str, Any]] | Unset = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -92,16 +90,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboard_id = d.pop("dashboard_id", UNSET) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_position(data: object) -> DashboardPanelPositionType0 | None | Unset: + def _parse_position(data: object) -> Union["DashboardPanelPositionType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -112,20 +110,18 @@ def _parse_position(data: object) -> DashboardPanelPositionType0 | None | Unset: position_type_0 = DashboardPanelPositionType0.from_dict(data) return position_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(DashboardPanelPositionType0 | None | Unset, data) + return cast(Union["DashboardPanelPositionType0", None, Unset], data) position = _parse_position(d.pop("position", UNSET)) + data = [] _data = d.pop("data", UNSET) - data: list[DashboardPanelDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = DashboardPanelDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = DashboardPanelDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) dashboard_panel = cls( params=params, diff --git a/rootly_sdk/models/dashboard_panel_data_item.py b/rootly_sdk/models/dashboard_panel_data_item.py index 3e9c8030..67ba809f 100644 --- a/rootly_sdk/models/dashboard_panel_data_item.py +++ b/rootly_sdk/models/dashboard_panel_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class DashboardPanelDataItem: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/dashboard_panel_list.py b/rootly_sdk/models/dashboard_panel_list.py index bde2df38..fa664bcd 100644 --- a/rootly_sdk/models/dashboard_panel_list.py +++ b/rootly_sdk/models/dashboard_panel_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class DashboardPanelList: """ Attributes: - data (list[DashboardPanelListDataItem]): + data (list['DashboardPanelListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[DashboardPanelListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["DashboardPanelListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_panel_list = cls( data=data, diff --git a/rootly_sdk/models/dashboard_panel_list_data_item.py b/rootly_sdk/models/dashboard_panel_list_data_item.py index bd1dc5f7..e773636f 100644 --- a/rootly_sdk/models/dashboard_panel_list_data_item.py +++ b/rootly_sdk/models/dashboard_panel_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class DashboardPanelListDataItem: id: str type_: DashboardPanelListDataItemType - attributes: DashboardPanel + attributes: "DashboardPanel" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard_panel_params.py b/rootly_sdk/models/dashboard_panel_params.py index 66aed2da..14a50bbc 100644 --- a/rootly_sdk/models/dashboard_panel_params.py +++ b/rootly_sdk/models/dashboard_panel_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,43 +20,42 @@ class DashboardPanelParams: """ Attributes: - display (DashboardPanelParamsDisplay | Unset): - description (str | Unset): - table_fields (list[str] | Unset): - legend (DashboardPanelParamsLegend | Unset): - datalabels (DashboardPanelParamsDatalabels | Unset): - datasets (list[DashboardPanelParamsDatasetsItem] | Unset): + display (Union[Unset, DashboardPanelParamsDisplay]): + description (Union[Unset, str]): + table_fields (Union[Unset, list[str]]): + legend (Union[Unset, DashboardPanelParamsLegend]): + datalabels (Union[Unset, DashboardPanelParamsDatalabels]): + datasets (Union[Unset, list['DashboardPanelParamsDatasetsItem']]): """ - display: DashboardPanelParamsDisplay | Unset = UNSET - description: str | Unset = UNSET - table_fields: list[str] | Unset = UNSET - legend: DashboardPanelParamsLegend | Unset = UNSET - datalabels: DashboardPanelParamsDatalabels | Unset = UNSET - datasets: list[DashboardPanelParamsDatasetsItem] | Unset = UNSET + display: Unset | DashboardPanelParamsDisplay = UNSET + description: Unset | str = UNSET + table_fields: Unset | list[str] = UNSET + legend: Union[Unset, "DashboardPanelParamsLegend"] = UNSET + datalabels: Union[Unset, "DashboardPanelParamsDatalabels"] = UNSET + datasets: Unset | list["DashboardPanelParamsDatasetsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - display: str | Unset = UNSET + display: Unset | str = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: list[str] | Unset = UNSET + table_fields: Unset | list[str] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: dict[str, Any] | Unset = UNSET + legend: Unset | dict[str, Any] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: dict[str, Any] | Unset = UNSET + datalabels: Unset | dict[str, Any] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: list[dict[str, Any]] | Unset = UNSET + datasets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -91,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: DashboardPanelParamsDisplay | Unset + display: Unset | DashboardPanelParamsDisplay if isinstance(_display, Unset): display = UNSET else: @@ -102,27 +99,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: DashboardPanelParamsLegend | Unset + legend: Unset | DashboardPanelParamsLegend if isinstance(_legend, Unset): legend = UNSET else: legend = DashboardPanelParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: DashboardPanelParamsDatalabels | Unset + datalabels: Unset | DashboardPanelParamsDatalabels if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = DashboardPanelParamsDatalabels.from_dict(_datalabels) + datasets = [] _datasets = d.pop("datasets", UNSET) - datasets: list[DashboardPanelParamsDatasetsItem] | Unset = UNSET - if _datasets is not UNSET: - datasets = [] - for datasets_item_data in _datasets: - datasets_item = DashboardPanelParamsDatasetsItem.from_dict(datasets_item_data) + for datasets_item_data in _datasets or []: + datasets_item = DashboardPanelParamsDatasetsItem.from_dict(datasets_item_data) - datasets.append(datasets_item) + datasets.append(datasets_item) dashboard_panel_params = cls( display=display, diff --git a/rootly_sdk/models/dashboard_panel_params_datalabels.py b/rootly_sdk/models/dashboard_panel_params_datalabels.py index be9de80e..c1e1055e 100644 --- a/rootly_sdk/models/dashboard_panel_params_datalabels.py +++ b/rootly_sdk/models/dashboard_panel_params_datalabels.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class DashboardPanelParamsDatalabels: """ Attributes: - enabled (bool | Unset): + enabled (Union[Unset, bool]): """ - enabled: bool | Unset = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item.py index 21e85bab..36291daf 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,18 +27,18 @@ class DashboardPanelParamsDatasetsItem: """ Attributes: - name (None | str | Unset): - collection (DashboardPanelParamsDatasetsItemCollection | Unset): - filter_ (list[DashboardPanelParamsDatasetsItemFilterItem] | Unset): - group_by (DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset): - aggregate (DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset): + name (Union[None, Unset, str]): + collection (Union[Unset, DashboardPanelParamsDatasetsItemCollection]): + filter_ (Union[Unset, list['DashboardPanelParamsDatasetsItemFilterItem']]): + group_by (Union['DashboardPanelParamsDatasetsItemGroupByType1Type0', None, Unset, str]): + aggregate (Union['DashboardPanelParamsDatasetsItemAggregateType0', None, Unset]): """ - name: None | str | Unset = UNSET - collection: DashboardPanelParamsDatasetsItemCollection | Unset = UNSET - filter_: list[DashboardPanelParamsDatasetsItemFilterItem] | Unset = UNSET - group_by: DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset = UNSET - aggregate: DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset = UNSET + name: None | Unset | str = UNSET + collection: Unset | DashboardPanelParamsDatasetsItemCollection = UNSET + filter_: Unset | list["DashboardPanelParamsDatasetsItemFilterItem"] = UNSET + group_by: Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET + aggregate: Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,24 +49,24 @@ def to_dict(self) -> dict[str, Any]: DashboardPanelParamsDatasetsItemGroupByType1Type0, ) - name: None | str | Unset + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: str | Unset = UNSET + collection: Unset | str = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: list[dict[str, Any]] | Unset = UNSET + filter_: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: dict[str, Any] | None | str | Unset + group_by: None | Unset | dict[str, Any] | str if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, DashboardPanelParamsDatasetsItemGroupByType1Type0): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: dict[str, Any] | None | Unset + aggregate: None | Unset | dict[str, Any] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, DashboardPanelParamsDatasetsItemAggregateType0): @@ -112,32 +110,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: DashboardPanelParamsDatasetsItemCollection | Unset + collection: Unset | DashboardPanelParamsDatasetsItemCollection if isinstance(_collection, Unset): collection = UNSET else: collection = check_dashboard_panel_params_datasets_item_collection(_collection) + filter_ = [] _filter_ = d.pop("filter", UNSET) - filter_: list[DashboardPanelParamsDatasetsItemFilterItem] | Unset = UNSET - if _filter_ is not UNSET: - filter_ = [] - for filter_item_data in _filter_: - filter_item = DashboardPanelParamsDatasetsItemFilterItem.from_dict(filter_item_data) + for filter_item_data in _filter_ or []: + filter_item = DashboardPanelParamsDatasetsItemFilterItem.from_dict(filter_item_data) - filter_.append(filter_item) + filter_.append(filter_item) - def _parse_group_by(data: object) -> DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset: + def _parse_group_by( + data: object, + ) -> Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str]: if data is None: return data if isinstance(data, Unset): @@ -148,13 +146,13 @@ def _parse_group_by(data: object) -> DashboardPanelParamsDatasetsItemGroupByType group_by_type_1_type_0 = DashboardPanelParamsDatasetsItemGroupByType1Type0.from_dict(data) return group_by_type_1_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset, data) + return cast(Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str], data) group_by = _parse_group_by(d.pop("group_by", UNSET)) - def _parse_aggregate(data: object) -> DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset: + def _parse_aggregate(data: object) -> Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -165,9 +163,9 @@ def _parse_aggregate(data: object) -> DashboardPanelParamsDatasetsItemAggregateT aggregate_type_0 = DashboardPanelParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset, data) + return cast(Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset], data) aggregate = _parse_aggregate(d.pop("aggregate", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py index 1c0d2a95..3cd5dba9 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,28 +17,28 @@ class DashboardPanelParamsDatasetsItemAggregateType0: """ Attributes: - operation (DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset): - key (None | str | Unset): - cumulative (bool | None | Unset): + operation (Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation]): + key (Union[None, Unset, str]): + cumulative (Union[None, Unset, bool]): """ - operation: DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset = UNSET - key: None | str | Unset = UNSET - cumulative: bool | None | Unset = UNSET + operation: Unset | DashboardPanelParamsDatasetsItemAggregateType0Operation = UNSET + key: None | Unset | str = UNSET + cumulative: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | str | Unset + key: None | Unset | str if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: bool | None | Unset + cumulative: None | Unset | bool if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -62,27 +60,27 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset + operation: Unset | DashboardPanelParamsDatasetsItemAggregateType0Operation if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_aggregate_type_0_operation(_operation) - def _parse_key(data: object) -> None | str | Unset: + def _parse_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> bool | None | Unset: + def _parse_cumulative(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py index 1eaceebe..fc6cf609 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class DashboardPanelParamsDatasetsItemFilterItem: """ Attributes: - operation (DashboardPanelParamsDatasetsItemFilterItemOperation | Unset): - rules (list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset): + operation (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation]): + rules (Union[Unset, list['DashboardPanelParamsDatasetsItemFilterItemRulesItem']]): """ - operation: DashboardPanelParamsDatasetsItemFilterItemOperation | Unset = UNSET - rules: list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemOperation = UNSET + rules: Unset | list["DashboardPanelParamsDatasetsItemFilterItemRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -64,20 +61,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: DashboardPanelParamsDatasetsItemFilterItemOperation | Unset + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemOperation if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_filter_item_operation(_operation) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = DashboardPanelParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = DashboardPanelParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) dashboard_panel_params_datasets_item_filter_item = cls( operation=operation, diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py index 8358c43c..172edea7 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,24 +21,24 @@ class DashboardPanelParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset): - condition (DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset): - key (str | Unset): - value (str | Unset): + operation (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation]): + condition (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition]): + key (Union[Unset, str]): + value (Union[Unset, str]): """ - operation: DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET - condition: DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET - key: str | Unset = UNSET - value: str | Unset = UNSET + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation = UNSET + condition: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition = UNSET + key: Unset | str = UNSET + value: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: str | Unset = UNSET + condition: Unset | str = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -66,14 +64,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_filter_item_rules_item_operation(_operation) _condition = d.pop("condition", UNSET) - condition: DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset + condition: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py index 2bbe0ace..cbafb095 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/dashboard_panel_params_legend.py b/rootly_sdk/models/dashboard_panel_params_legend.py index e39a194f..51b35f9d 100644 --- a/rootly_sdk/models/dashboard_panel_params_legend.py +++ b/rootly_sdk/models/dashboard_panel_params_legend.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,14 +17,14 @@ class DashboardPanelParamsLegend: """ Attributes: - groups (DashboardPanelParamsLegendGroups | Unset): Default: 'all'. + groups (Union[Unset, DashboardPanelParamsLegendGroups]): Default: 'all'. """ - groups: DashboardPanelParamsLegendGroups | Unset = "all" + groups: Unset | DashboardPanelParamsLegendGroups = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: str | Unset = UNSET + groups: Unset | str = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: DashboardPanelParamsLegendGroups | Unset + groups: Unset | DashboardPanelParamsLegendGroups if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_position_type_0.py b/rootly_sdk/models/dashboard_panel_position_type_0.py index f64f7720..29f03cc9 100644 --- a/rootly_sdk/models/dashboard_panel_position_type_0.py +++ b/rootly_sdk/models/dashboard_panel_position_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/dashboard_panel_response.py b/rootly_sdk/models/dashboard_panel_response.py index 53b175e2..f4667135 100644 --- a/rootly_sdk/models/dashboard_panel_response.py +++ b/rootly_sdk/models/dashboard_panel_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class DashboardPanelResponse: """ Attributes: data (DashboardPanelResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: DashboardPanelResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "DashboardPanelResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = DashboardPanelResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_panel_response = cls( data=data, diff --git a/rootly_sdk/models/dashboard_panel_response_data.py b/rootly_sdk/models/dashboard_panel_response_data.py index 17f3d2bc..f60ca138 100644 --- a/rootly_sdk/models/dashboard_panel_response_data.py +++ b/rootly_sdk/models/dashboard_panel_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class DashboardPanelResponseData: id: str type_: DashboardPanelResponseDataType - attributes: DashboardPanel + attributes: "DashboardPanel" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard_response.py b/rootly_sdk/models/dashboard_response.py index 8ccf9235..8f5c6935 100644 --- a/rootly_sdk/models/dashboard_response.py +++ b/rootly_sdk/models/dashboard_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class DashboardResponse: """ Attributes: data (DashboardResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: DashboardResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "DashboardResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = DashboardResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_response = cls( data=data, diff --git a/rootly_sdk/models/dashboard_response_data.py b/rootly_sdk/models/dashboard_response_data.py index 2ba914b5..cf64ee80 100644 --- a/rootly_sdk/models/dashboard_response_data.py +++ b/rootly_sdk/models/dashboard_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class DashboardResponseData: id: str type_: DashboardResponseDataType - attributes: Dashboard + attributes: "Dashboard" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/delete_alert_route_response_200.py b/rootly_sdk/models/delete_alert_route_response_200.py index dfee77b3..01c2a996 100644 --- a/rootly_sdk/models/delete_alert_route_response_200.py +++ b/rootly_sdk/models/delete_alert_route_response_200.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class DeleteAlertRouteResponse200: """ Attributes: - data (DeleteAlertRouteResponse200Data | Unset): + data (Union[Unset, DeleteAlertRouteResponse200Data]): """ - data: DeleteAlertRouteResponse200Data | Unset = UNSET + data: Union[Unset, "DeleteAlertRouteResponse200Data"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: DeleteAlertRouteResponse200Data | Unset + data: Unset | DeleteAlertRouteResponse200Data if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/delete_alert_route_response_200_data.py b/rootly_sdk/models/delete_alert_route_response_200_data.py index 95d7b221..4d975e7f 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,23 +17,22 @@ class DeleteAlertRouteResponse200Data: """ Attributes: - id (str | Unset): - type_ (str | Unset): - attributes (DeleteAlertRouteResponse200DataAttributes | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, str]): + attributes (Union[Unset, DeleteAlertRouteResponse200DataAttributes]): """ - id: str | Unset = UNSET - type_: str | Unset = UNSET - attributes: DeleteAlertRouteResponse200DataAttributes | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | str = UNSET + attributes: Union[Unset, "DeleteAlertRouteResponse200DataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -61,7 +58,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: DeleteAlertRouteResponse200DataAttributes | Unset + attributes: Unset | DeleteAlertRouteResponse200DataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py b/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py index a811a57e..1010554d 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class DeleteAlertRouteResponse200DataAttributes: """ Attributes: - deleted (bool | Unset): + deleted (Union[Unset, bool]): """ - deleted: bool | Unset = UNSET + deleted: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/duplicate_incident.py b/rootly_sdk/models/duplicate_incident.py index 55260f94..f750b447 100644 --- a/rootly_sdk/models/duplicate_incident.py +++ b/rootly_sdk/models/duplicate_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class DuplicateIncident: data (DuplicateIncidentData): """ - data: DuplicateIncidentData + data: "DuplicateIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/duplicate_incident_data.py b/rootly_sdk/models/duplicate_incident_data.py index 8b075bd7..aab0a6cb 100644 --- a/rootly_sdk/models/duplicate_incident_data.py +++ b/rootly_sdk/models/duplicate_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class DuplicateIncidentData: """ type_: DuplicateIncidentDataType - attributes: DuplicateIncidentDataAttributes + attributes: "DuplicateIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/duplicate_incident_data_attributes.py b/rootly_sdk/models/duplicate_incident_data_attributes.py index 61946c43..3ff52dac 100644 --- a/rootly_sdk/models/duplicate_incident_data_attributes.py +++ b/rootly_sdk/models/duplicate_incident_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,25 +12,25 @@ class DuplicateIncidentDataAttributes: """ Attributes: - duplicate_incident_id (str | Unset): - auto_cancel_incident (bool | None | Unset): Default: True. - reason_for_cancellation (None | str | Unset): Why was the incident cancelled? + duplicate_incident_id (Union[Unset, str]): + auto_cancel_incident (Union[None, Unset, bool]): Default: True. + reason_for_cancellation (Union[None, Unset, str]): Why was the incident cancelled? """ - duplicate_incident_id: str | Unset = UNSET - auto_cancel_incident: bool | None | Unset = True - reason_for_cancellation: None | str | Unset = UNSET + duplicate_incident_id: Unset | str = UNSET + auto_cancel_incident: None | Unset | bool = True + reason_for_cancellation: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: duplicate_incident_id = self.duplicate_incident_id - auto_cancel_incident: bool | None | Unset + auto_cancel_incident: None | Unset | bool if isinstance(self.auto_cancel_incident, Unset): auto_cancel_incident = UNSET else: auto_cancel_incident = self.auto_cancel_incident - reason_for_cancellation: None | str | Unset + reason_for_cancellation: None | Unset | str if isinstance(self.reason_for_cancellation, Unset): reason_for_cancellation = UNSET else: @@ -55,21 +53,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) duplicate_incident_id = d.pop("duplicate_incident_id", UNSET) - def _parse_auto_cancel_incident(data: object) -> bool | None | Unset: + def _parse_auto_cancel_incident(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) auto_cancel_incident = _parse_auto_cancel_incident(d.pop("auto_cancel_incident", UNSET)) - def _parse_reason_for_cancellation(data: object) -> None | str | Unset: + def _parse_reason_for_cancellation(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) reason_for_cancellation = _parse_reason_for_cancellation(d.pop("reason_for_cancellation", UNSET)) diff --git a/rootly_sdk/models/edge_connector.py b/rootly_sdk/models/edge_connector.py index 09054d23..d58e562c 100644 --- a/rootly_sdk/models/edge_connector.py +++ b/rootly_sdk/models/edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class EdgeConnector: data (EdgeConnectorData): """ - data: EdgeConnectorData + data: "EdgeConnectorData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/edge_connector_action.py b/rootly_sdk/models/edge_connector_action.py index 4480e034..9876c156 100644 --- a/rootly_sdk/models/edge_connector_action.py +++ b/rootly_sdk/models/edge_connector_action.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class EdgeConnectorAction: data (EdgeConnectorActionData): """ - data: EdgeConnectorActionData + data: "EdgeConnectorActionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/edge_connector_action_data.py b/rootly_sdk/models/edge_connector_action_data.py index e87a97a7..591a761b 100644 --- a/rootly_sdk/models/edge_connector_action_data.py +++ b/rootly_sdk/models/edge_connector_action_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,11 +25,10 @@ class EdgeConnectorActionData: type_: EdgeConnectorActionDataType id: UUID - attributes: EdgeConnectorActionDataAttributes + attributes: "EdgeConnectorActionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ id = str(self.id) diff --git a/rootly_sdk/models/edge_connector_action_data_attributes.py b/rootly_sdk/models/edge_connector_action_data_attributes.py index 6c67eee5..4ab3bd1f 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -33,53 +31,53 @@ class EdgeConnectorActionDataAttributes: Attributes: name (str): Action name action_type (EdgeConnectorActionDataAttributesActionType): Action type - slug (str | Unset): Action slug - icon (EdgeConnectorActionDataAttributesIcon | Unset): Action icon - description (None | str | Unset): Action description - timeout (int | None | Unset): Timeout in seconds - parameters (list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset): Parameter definitions - last_executed_at (datetime.datetime | None | Unset): - created_at (datetime.datetime | Unset): - updated_at (datetime.datetime | Unset): + slug (Union[Unset, str]): Action slug + icon (Union[Unset, EdgeConnectorActionDataAttributesIcon]): Action icon + description (Union[None, Unset, str]): Action description + timeout (Union[None, Unset, int]): Timeout in seconds + parameters (Union[None, Unset, list['EdgeConnectorActionDataAttributesParametersType0Item']]): Parameter + definitions + last_executed_at (Union[None, Unset, datetime.datetime]): + created_at (Union[Unset, datetime.datetime]): + updated_at (Union[Unset, datetime.datetime]): """ name: str action_type: EdgeConnectorActionDataAttributesActionType - slug: str | Unset = UNSET - icon: EdgeConnectorActionDataAttributesIcon | Unset = UNSET - description: None | str | Unset = UNSET - timeout: int | None | Unset = UNSET - parameters: list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset = UNSET - last_executed_at: datetime.datetime | None | Unset = UNSET - created_at: datetime.datetime | Unset = UNSET - updated_at: datetime.datetime | Unset = UNSET + slug: Unset | str = UNSET + icon: Unset | EdgeConnectorActionDataAttributesIcon = UNSET + description: None | Unset | str = UNSET + timeout: None | Unset | int = UNSET + parameters: None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"] = UNSET + last_executed_at: None | Unset | datetime.datetime = UNSET + created_at: Unset | datetime.datetime = UNSET + updated_at: Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name action_type: str = self.action_type slug = self.slug - icon: str | Unset = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: int | None | Unset + timeout: None | Unset | int if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - parameters: list[dict[str, Any]] | None | Unset + parameters: None | Unset | list[dict[str, Any]] if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -91,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: parameters = self.parameters - last_executed_at: None | str | Unset + last_executed_at: None | Unset | str if isinstance(self.last_executed_at, Unset): last_executed_at = UNSET elif isinstance(self.last_executed_at, datetime.datetime): @@ -99,11 +97,11 @@ def to_dict(self) -> dict[str, Any]: else: last_executed_at = self.last_executed_at - created_at: str | Unset = UNSET + created_at: Unset | str = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: str | Unset = UNSET + updated_at: Unset | str = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -148,33 +146,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _icon = d.pop("icon", UNSET) - icon: EdgeConnectorActionDataAttributesIcon | Unset + icon: Unset | EdgeConnectorActionDataAttributesIcon if isinstance(_icon, Unset): icon = UNSET else: icon = check_edge_connector_action_data_attributes_icon(_icon) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> int | None | Unset: + def _parse_timeout(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) timeout = _parse_timeout(d.pop("timeout", UNSET)) def _parse_parameters( data: object, - ) -> list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset: + ) -> None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -192,13 +190,13 @@ def _parse_parameters( parameters_type_0.append(parameters_type_0_item) return parameters_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset, data) + return cast(None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"], data) parameters = _parse_parameters(d.pop("parameters", UNSET)) - def _parse_last_executed_at(data: object) -> datetime.datetime | None | Unset: + def _parse_last_executed_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -209,21 +207,21 @@ def _parse_last_executed_at(data: object) -> datetime.datetime | None | Unset: last_executed_at_type_0 = isoparse(data) return last_executed_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) last_executed_at = _parse_last_executed_at(d.pop("last_executed_at", UNSET)) _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset + created_at: Unset | datetime.datetime if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: datetime.datetime | Unset + updated_at: Unset | datetime.datetime if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py index b7212cb9..1f89cdc2 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,44 +17,44 @@ class EdgeConnectorActionDataAttributesParametersType0Item: """ Attributes: - name (str | Unset): - type_ (EdgeConnectorActionDataAttributesParametersType0ItemType | Unset): - required (bool | Unset): - description (None | str | Unset): - default (None | str | Unset): Default value (any type) - options (list[str] | None | Unset): + name (Union[Unset, str]): + type_ (Union[Unset, EdgeConnectorActionDataAttributesParametersType0ItemType]): + required (Union[Unset, bool]): + description (Union[None, Unset, str]): + default (Union[None, Unset, str]): Default value (any type) + options (Union[None, Unset, list[str]]): """ - name: str | Unset = UNSET - type_: EdgeConnectorActionDataAttributesParametersType0ItemType | Unset = UNSET - required: bool | Unset = UNSET - description: None | str | Unset = UNSET - default: None | str | Unset = UNSET - options: list[str] | None | Unset = UNSET + name: Unset | str = UNSET + type_: Unset | EdgeConnectorActionDataAttributesParametersType0ItemType = UNSET + required: Unset | bool = UNSET + description: None | Unset | str = UNSET + default: None | Unset | str = UNSET + options: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | str | Unset + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: list[str] | None | Unset + options: None | Unset | list[str] if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -89,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: EdgeConnectorActionDataAttributesParametersType0ItemType | Unset + type_: Unset | EdgeConnectorActionDataAttributesParametersType0ItemType if isinstance(_type_, Unset): type_ = UNSET else: @@ -97,25 +95,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> list[str] | None | Unset: + def _parse_options(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -126,9 +124,9 @@ def _parse_options(data: object) -> list[str] | None | Unset: options_type_0 = cast(list[str], data) return options_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/edge_connector_data.py b/rootly_sdk/models/edge_connector_data.py index 1264673c..be9d7e20 100644 --- a/rootly_sdk/models/edge_connector_data.py +++ b/rootly_sdk/models/edge_connector_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,11 +25,10 @@ class EdgeConnectorData: type_: EdgeConnectorDataType id: UUID - attributes: EdgeConnectorDataAttributes + attributes: "EdgeConnectorDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ id = str(self.id) diff --git a/rootly_sdk/models/edge_connector_data_attributes.py b/rootly_sdk/models/edge_connector_data_attributes.py index 8281a4d4..07ae460c 100644 --- a/rootly_sdk/models/edge_connector_data_attributes.py +++ b/rootly_sdk/models/edge_connector_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,32 +21,32 @@ class EdgeConnectorDataAttributes: Attributes: name (str): Connector name status (EdgeConnectorDataAttributesStatus): Connector status - description (None | str | Unset): Connector description - subscriptions (list[str] | Unset): Array of event types to subscribe to - last_poll_at (datetime.datetime | None | Unset): Last time connector polled - online (bool | Unset): Whether connector is currently online - deliveries_count (int | Unset): Total number of deliveries - deliveries_queued_count (int | Unset): Number of queued deliveries - deliveries_running_count (int | Unset): Number of running deliveries - deliveries_completed_count (int | Unset): Number of completed deliveries - deliveries_failed_count (int | Unset): Number of failed deliveries - created_at (datetime.datetime | Unset): - updated_at (datetime.datetime | Unset): + description (Union[None, Unset, str]): Connector description + subscriptions (Union[Unset, list[str]]): Array of event types to subscribe to + last_poll_at (Union[None, Unset, datetime.datetime]): Last time connector polled + online (Union[Unset, bool]): Whether connector is currently online + deliveries_count (Union[Unset, int]): Total number of deliveries + deliveries_queued_count (Union[Unset, int]): Number of queued deliveries + deliveries_running_count (Union[Unset, int]): Number of running deliveries + deliveries_completed_count (Union[Unset, int]): Number of completed deliveries + deliveries_failed_count (Union[Unset, int]): Number of failed deliveries + created_at (Union[Unset, datetime.datetime]): + updated_at (Union[Unset, datetime.datetime]): """ name: str status: EdgeConnectorDataAttributesStatus - description: None | str | Unset = UNSET - subscriptions: list[str] | Unset = UNSET - last_poll_at: datetime.datetime | None | Unset = UNSET - online: bool | Unset = UNSET - deliveries_count: int | Unset = UNSET - deliveries_queued_count: int | Unset = UNSET - deliveries_running_count: int | Unset = UNSET - deliveries_completed_count: int | Unset = UNSET - deliveries_failed_count: int | Unset = UNSET - created_at: datetime.datetime | Unset = UNSET - updated_at: datetime.datetime | Unset = UNSET + description: None | Unset | str = UNSET + subscriptions: Unset | list[str] = UNSET + last_poll_at: None | Unset | datetime.datetime = UNSET + online: Unset | bool = UNSET + deliveries_count: Unset | int = UNSET + deliveries_queued_count: Unset | int = UNSET + deliveries_running_count: Unset | int = UNSET + deliveries_completed_count: Unset | int = UNSET + deliveries_failed_count: Unset | int = UNSET + created_at: Unset | datetime.datetime = UNSET + updated_at: Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,17 +54,17 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - subscriptions: list[str] | Unset = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - last_poll_at: None | str | Unset + last_poll_at: None | Unset | str if isinstance(self.last_poll_at, Unset): last_poll_at = UNSET elif isinstance(self.last_poll_at, datetime.datetime): @@ -86,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: deliveries_failed_count = self.deliveries_failed_count - created_at: str | Unset = UNSET + created_at: Unset | str = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: str | Unset = UNSET + updated_at: Unset | str = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -134,18 +132,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_edge_connector_data_attributes_status(d.pop("status")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) - def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: + def _parse_last_poll_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -156,9 +154,9 @@ def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: last_poll_at_type_0 = isoparse(data) return last_poll_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) last_poll_at = _parse_last_poll_at(d.pop("last_poll_at", UNSET)) @@ -175,14 +173,14 @@ def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: deliveries_failed_count = d.pop("deliveries_failed_count", UNSET) _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset + created_at: Unset | datetime.datetime if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: datetime.datetime | Unset + updated_at: Unset | datetime.datetime if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/environment.py b/rootly_sdk/models/environment.py index 652d2359..06b0a454 100644 --- a/rootly_sdk/models/environment.py +++ b/rootly_sdk/models/environment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,38 +23,40 @@ class Environment: name (str): The name of the environment created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the environment - managed_by (EnvironmentManagedBy | Unset): How this environment is managed (provenance): web, api, terraform, - etc. Read-only. - external_id (None | str | Unset): The external id associated to this environment - description (None | str | Unset): The description of the environment - notify_emails (list[str] | None | Unset): Emails attached to the environment - color (None | str | Unset): The hex color of the environment - position (int | None | Unset): Position of the environment - slack_channels (list[EnvironmentSlackChannelsType0Item] | None | Unset): Slack Channels associated with this - environment - slack_aliases (list[EnvironmentSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this + slug (Union[Unset, str]): The slug of the environment + managed_by (Union[Unset, EnvironmentManagedBy]): How this environment is managed (provenance): web, api, + terraform, etc. Read-only. + external_id (Union[None, Unset, str]): The external id associated to this environment + description (Union[None, Unset, str]): The description of the environment + public_description (Union[None, Unset, str]): The status page description of the environment + notify_emails (Union[None, Unset, list[str]]): Emails attached to the environment + color (Union[None, Unset, str]): The hex color of the environment + position (Union[None, Unset, int]): Position of the environment + slack_channels (Union[None, Unset, list['EnvironmentSlackChannelsType0Item']]): Slack Channels associated with + this environment + slack_aliases (Union[None, Unset, list['EnvironmentSlackAliasesType0Item']]): Slack Aliases associated with this environment - properties (list[EnvironmentPropertiesType0Item] | None | Unset): Array of property values for this environment. + properties (Union[None, Unset, list['EnvironmentPropertiesType0Item']]): Array of property values for this + environment. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: EnvironmentManagedBy | Unset = UNSET - external_id: None | str | Unset = UNSET - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - slack_channels: list[EnvironmentSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[EnvironmentSlackAliasesType0Item] | None | Unset = UNSET - properties: list[EnvironmentPropertiesType0Item] | None | Unset = UNSET + slug: Unset | str = UNSET + managed_by: Unset | EnvironmentManagedBy = UNSET + external_id: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + slack_channels: None | Unset | list["EnvironmentSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["EnvironmentSlackAliasesType0Item"] = UNSET + properties: None | Unset | list["EnvironmentPropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -65,23 +65,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -90,19 +96,19 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -114,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -126,7 +132,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | None | Unset + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -155,6 +161,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["external_id"] = external_id if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -186,31 +194,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: EnvironmentManagedBy | Unset + managed_by: Unset | EnvironmentManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_environment_managed_by(_managed_by) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -221,31 +238,31 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_slack_channels(data: object) -> list[EnvironmentSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> None | Unset | list["EnvironmentSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -263,13 +280,13 @@ def _parse_slack_channels(data: object) -> list[EnvironmentSlackChannelsType0Ite slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["EnvironmentSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[EnvironmentSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> None | Unset | list["EnvironmentSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -287,13 +304,13 @@ def _parse_slack_aliases(data: object) -> list[EnvironmentSlackAliasesType0Item] slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["EnvironmentSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> None | Unset | list["EnvironmentPropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -309,9 +326,9 @@ def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | No properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentPropertiesType0Item] | None | Unset, data) + return cast(None | Unset | list["EnvironmentPropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) @@ -323,6 +340,7 @@ def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | No managed_by=managed_by, external_id=external_id, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/environment_list.py b/rootly_sdk/models/environment_list.py index 28818d4b..2df8b7b3 100644 --- a/rootly_sdk/models/environment_list.py +++ b/rootly_sdk/models/environment_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class EnvironmentList: """ Attributes: - data (list[EnvironmentListDataItem]): + data (list['EnvironmentListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EnvironmentListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EnvironmentListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) environment_list = cls( data=data, diff --git a/rootly_sdk/models/environment_list_data_item.py b/rootly_sdk/models/environment_list_data_item.py index 9cd8698e..b139edc2 100644 --- a/rootly_sdk/models/environment_list_data_item.py +++ b/rootly_sdk/models/environment_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class EnvironmentListDataItem: id: str type_: EnvironmentListDataItemType - attributes: Environment + attributes: "Environment" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/environment_properties_type_0_item.py b/rootly_sdk/models/environment_properties_type_0_item.py index 1e6c007a..a45b603f 100644 --- a/rootly_sdk/models/environment_properties_type_0_item.py +++ b/rootly_sdk/models/environment_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/environment_response.py b/rootly_sdk/models/environment_response.py index 9bc22e2b..de2f9bd3 100644 --- a/rootly_sdk/models/environment_response.py +++ b/rootly_sdk/models/environment_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class EnvironmentResponse: """ Attributes: data (EnvironmentResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EnvironmentResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EnvironmentResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EnvironmentResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) environment_response = cls( data=data, diff --git a/rootly_sdk/models/environment_response_data.py b/rootly_sdk/models/environment_response_data.py index b2a242c7..96dfb328 100644 --- a/rootly_sdk/models/environment_response_data.py +++ b/rootly_sdk/models/environment_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class EnvironmentResponseData: id: str type_: EnvironmentResponseDataType - attributes: Environment + attributes: "Environment" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/environment_slack_aliases_type_0_item.py b/rootly_sdk/models/environment_slack_aliases_type_0_item.py index 35b6c464..01439b1b 100644 --- a/rootly_sdk/models/environment_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/environment_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/environment_slack_channels_type_0_item.py b/rootly_sdk/models/environment_slack_channels_type_0_item.py index aab61759..9d2d54a7 100644 --- a/rootly_sdk/models/environment_slack_channels_type_0_item.py +++ b/rootly_sdk/models/environment_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/errors_list.py b/rootly_sdk/models/errors_list.py index 51274091..af2abffb 100644 --- a/rootly_sdk/models/errors_list.py +++ b/rootly_sdk/models/errors_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,15 +17,14 @@ class ErrorsList: """ Attributes: - errors (list[ErrorsListErrorsItem] | Unset): + errors (Union[Unset, list['ErrorsListErrorsItem']]): """ - errors: list[ErrorsListErrorsItem] | Unset = UNSET + errors: Unset | list["ErrorsListErrorsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - errors: list[dict[str, Any]] | Unset = UNSET + errors: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.errors, Unset): errors = [] for errors_item_data in self.errors: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.errors_list_errors_item import ErrorsListErrorsItem d = dict(src_dict) + errors = [] _errors = d.pop("errors", UNSET) - errors: list[ErrorsListErrorsItem] | Unset = UNSET - if _errors is not UNSET: - errors = [] - for errors_item_data in _errors: - errors_item = ErrorsListErrorsItem.from_dict(errors_item_data) + for errors_item_data in _errors or []: + errors_item = ErrorsListErrorsItem.from_dict(errors_item_data) - errors.append(errors_item) + errors.append(errors_item) errors_list = cls( errors=errors, diff --git a/rootly_sdk/models/errors_list_errors_item.py b/rootly_sdk/models/errors_list_errors_item.py index 55c41afb..d4a4f5c2 100644 --- a/rootly_sdk/models/errors_list_errors_item.py +++ b/rootly_sdk/models/errors_list_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,14 +15,14 @@ class ErrorsListErrorsItem: Attributes: title (str): status (str): - code (None | str | Unset): - detail (None | str | Unset): + code (Union[None, Unset, str]): + detail (Union[None, Unset, str]): """ title: str status: str - code: None | str | Unset = UNSET - detail: None | str | Unset = UNSET + code: None | Unset | str = UNSET + detail: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,13 +30,13 @@ def to_dict(self) -> dict[str, Any]: status = self.status - code: None | str | Unset + code: None | Unset | str if isinstance(self.code, Unset): code = UNSET else: code = self.code - detail: None | str | Unset + detail: None | Unset | str if isinstance(self.detail, Unset): detail = UNSET else: @@ -66,21 +64,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status") - def _parse_code(data: object) -> None | str | Unset: + def _parse_code(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) code = _parse_code(d.pop("code", UNSET)) - def _parse_detail(data: object) -> None | str | Unset: + def _parse_detail(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) detail = _parse_detail(d.pop("detail", UNSET)) diff --git a/rootly_sdk/models/escalate_alert.py b/rootly_sdk/models/escalate_alert.py index ecd3882d..a42c7953 100644 --- a/rootly_sdk/models/escalate_alert.py +++ b/rootly_sdk/models/escalate_alert.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class EscalateAlert: """ Attributes: - data (EscalateAlertData | Unset): + data (Union[Unset, EscalateAlertData]): """ - data: EscalateAlertData | Unset = UNSET + data: Union[Unset, "EscalateAlertData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: EscalateAlertData | Unset + data: Unset | EscalateAlertData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/escalate_alert_data.py b/rootly_sdk/models/escalate_alert_data.py index beb705bc..8f065bd2 100644 --- a/rootly_sdk/models/escalate_alert_data.py +++ b/rootly_sdk/models/escalate_alert_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class EscalateAlertData: """ Attributes: - type_ (EscalateAlertDataType | Unset): - attributes (EscalateAlertDataAttributes | Unset): + type_ (Union[Unset, EscalateAlertDataType]): + attributes (Union[Unset, EscalateAlertDataAttributes]): """ - type_: EscalateAlertDataType | Unset = UNSET - attributes: EscalateAlertDataAttributes | Unset = UNSET + type_: Unset | EscalateAlertDataType = UNSET + attributes: Union[Unset, "EscalateAlertDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: EscalateAlertDataType | Unset + type_: Unset | EscalateAlertDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_escalate_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: EscalateAlertDataAttributes | Unset + attributes: Unset | EscalateAlertDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/escalate_alert_data_attributes.py b/rootly_sdk/models/escalate_alert_data_attributes.py index b22f75ee..5eae0b81 100644 --- a/rootly_sdk/models/escalate_alert_data_attributes.py +++ b/rootly_sdk/models/escalate_alert_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,14 +12,15 @@ class EscalateAlertDataAttributes: """ Attributes: - escalation_policy_id (str | Unset): The ID of the escalation policy to escalate to. If omitted, uses the alert's - current escalation policy from metadata. Required for resolved alerts whose metadata may have been cleared. - escalation_policy_level (int | Unset): The escalation policy level to escalate to. If omitted, defaults to the - next level (same EP) or level 1 (different EP). + escalation_policy_id (Union[Unset, str]): The ID of the escalation policy to escalate to. If omitted, uses the + alert's current escalation policy from metadata. Required for resolved alerts whose metadata may have been + cleared. + escalation_policy_level (Union[Unset, int]): The escalation policy level to escalate to. If omitted, defaults to + the next level (same EP) or level 1 (different EP). """ - escalation_policy_id: str | Unset = UNSET - escalation_policy_level: int | Unset = UNSET + escalation_policy_id: Unset | str = UNSET + escalation_policy_level: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id diff --git a/rootly_sdk/models/escalation_policy.py b/rootly_sdk/models/escalation_policy.py index 222eaa40..5e7daa37 100644 --- a/rootly_sdk/models/escalation_policy.py +++ b/rootly_sdk/models/escalation_policy.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,25 +20,25 @@ class EscalationPolicy: name (str): The name of the escalation policy repeat_count (int): The number of times this policy will be executed until someone acknowledges the alert created_by_user_id (int): User who created the escalation policy - description (None | str | Unset): The description of the escalation policy - last_updated_by_user_id (int | Unset): User who updated the escalation policy - group_ids (list[str] | Unset): Associated groups (alerting the group will trigger escalation policy) - service_ids (list[str] | Unset): Associated services (alerting the service will trigger escalation policy) - business_hours (EscalationPolicyBusinessHoursType0 | None | Unset): - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + description (Union[None, Unset, str]): The description of the escalation policy + last_updated_by_user_id (Union[Unset, int]): User who updated the escalation policy + group_ids (Union[Unset, list[str]]): Associated groups (alerting the group will trigger escalation policy) + service_ids (Union[Unset, list[str]]): Associated services (alerting the service will trigger escalation policy) + business_hours (Union['EscalationPolicyBusinessHoursType0', None, Unset]): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ name: str repeat_count: int created_by_user_id: int - description: None | str | Unset = UNSET - last_updated_by_user_id: int | Unset = UNSET - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - business_hours: EscalationPolicyBusinessHoursType0 | None | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + description: None | Unset | str = UNSET + last_updated_by_user_id: Unset | int = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + business_hours: Union["EscalationPolicyBusinessHoursType0", None, Unset] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: created_by_user_id = self.created_by_user_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -60,15 +58,15 @@ def to_dict(self) -> dict[str, Any]: last_updated_by_user_id = self.last_updated_by_user_id - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: dict[str, Any] | None | Unset + business_hours: None | Unset | dict[str, Any] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, EscalationPolicyBusinessHoursType0): @@ -117,12 +115,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_by_user_id = d.pop("created_by_user_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -132,7 +130,7 @@ def _parse_description(data: object) -> None | str | Unset: service_ids = cast(list[str], d.pop("service_ids", UNSET)) - def _parse_business_hours(data: object) -> EscalationPolicyBusinessHoursType0 | None | Unset: + def _parse_business_hours(data: object) -> Union["EscalationPolicyBusinessHoursType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -143,9 +141,9 @@ def _parse_business_hours(data: object) -> EscalationPolicyBusinessHoursType0 | business_hours_type_0 = EscalationPolicyBusinessHoursType0.from_dict(data) return business_hours_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(EscalationPolicyBusinessHoursType0 | None | Unset, data) + return cast(Union["EscalationPolicyBusinessHoursType0", None, Unset], data) business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_business_hours_type_0.py b/rootly_sdk/models/escalation_policy_business_hours_type_0.py index 2312ee81..e5081210 100644 --- a/rootly_sdk/models/escalation_policy_business_hours_type_0.py +++ b/rootly_sdk/models/escalation_policy_business_hours_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,24 +21,24 @@ class EscalationPolicyBusinessHoursType0: """ Attributes: - time_zone (EscalationPolicyBusinessHoursType0TimeZone | Unset): Time zone for business hours - days (list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset): Business days - start_time (None | str | Unset): Start time for business hours (HH:MM) - end_time (None | str | Unset): End time for business hours (HH:MM) + time_zone (Union[Unset, EscalationPolicyBusinessHoursType0TimeZone]): Time zone for business hours + days (Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]]): Business days + start_time (Union[None, Unset, str]): Start time for business hours (HH:MM) + end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: EscalationPolicyBusinessHoursType0TimeZone | Unset = UNSET - days: list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset = UNSET - start_time: None | str | Unset = UNSET - end_time: None | str | Unset = UNSET + time_zone: Unset | EscalationPolicyBusinessHoursType0TimeZone = UNSET + days: None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item] = UNSET + start_time: None | Unset | str = UNSET + end_time: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: str | Unset = UNSET + time_zone: Unset | str = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: list[str] | None | Unset + days: None | Unset | list[str] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | str | Unset + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | str | Unset + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: EscalationPolicyBusinessHoursType0TimeZone | Unset + time_zone: Unset | EscalationPolicyBusinessHoursType0TimeZone if isinstance(_time_zone, Unset): time_zone = UNSET else: time_zone = check_escalation_policy_business_hours_type_0_time_zone(_time_zone) - def _parse_days(data: object) -> list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset: + def _parse_days(data: object) -> None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item]: if data is None: return data if isinstance(data, Unset): @@ -106,27 +104,27 @@ def _parse_days(data: object) -> list[EscalationPolicyBusinessHoursType0DaysType days_type_0.append(days_type_0_item) return days_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset, data) + return cast(None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | str | Unset: + def _parse_start_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | str | Unset: + def _parse_end_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_level.py b/rootly_sdk/models/escalation_policy_level.py index 71d1397a..15e38d09 100644 --- a/rootly_sdk/models/escalation_policy_level.py +++ b/rootly_sdk/models/escalation_policy_level.py @@ -1,11 +1,17 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.escalation_policy_level_paging_strategy_configuration_repeats_mode import ( + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, + check_escalation_policy_level_paging_strategy_configuration_repeats_mode, +) +from ..models.escalation_policy_level_paging_strategy_configuration_rotation_scope import ( + EscalationPolicyLevelPagingStrategyConfigurationRotationScope, + check_escalation_policy_level_paging_strategy_configuration_rotation_scope, +) from ..models.escalation_policy_level_paging_strategy_configuration_schedule_strategy import ( EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy, check_escalation_policy_level_paging_strategy_configuration_schedule_strategy, @@ -32,29 +38,47 @@ class EscalationPolicyLevel: escalation_policy_id (str): The ID of the escalation policy delay (int): Delay before notifying targets in the next Escalation Level. position (int): Position of the escalation policy level - notification_target_params (list[EscalationPolicyLevelNotificationTargetParamsItemType0 | None]): Escalation - level's notification targets - escalation_policy_path_id (None | str | Unset): The ID of the dynamic escalation policy path the level will + notification_target_params (list[Union['EscalationPolicyLevelNotificationTargetParamsItemType0', None]]): + Escalation level's notification targets + escalation_policy_path_id (Union[None, Unset, str]): The ID of the dynamic escalation policy path the level will belong to. If nothing is specified it will add the level to your default path. - paging_strategy_configuration_strategy (EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset): + paging_strategy_configuration_strategy (Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy]): Default: 'default'. - paging_strategy_configuration_schedule_strategy - (EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset): Default: 'on_call_only'. - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + paging_strategy_configuration_schedule_strategy (Union[Unset, + EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy]): Default: 'on_call_only'. + paging_strategy_configuration_repeats (Union[None, Unset, int]): Number of times to rotate through the roster + (cycle-based round robin). + paging_strategy_configuration_repeats_mode (Union[Unset, + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode]): Controls how repeats are interpreted: 'users' + pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (Union[Unset, + EscalationPolicyLevelPagingStrategyConfigurationRotationScope]): Scope of rotation ordering: active rotation + members only, or entire schedule. + paging_strategy_configuration_page_users_count (Union[None, Unset, int]): Number of users to page at a time + (cycle-based round robin). + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ escalation_policy_id: str delay: int position: int - notification_target_params: list[EscalationPolicyLevelNotificationTargetParamsItemType0 | None] - escalation_policy_path_id: None | str | Unset = UNSET - paging_strategy_configuration_strategy: EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset = "default" + notification_target_params: list[Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]] + escalation_policy_path_id: None | Unset | str = UNSET + paging_strategy_configuration_strategy: Unset | EscalationPolicyLevelPagingStrategyConfigurationStrategy = "default" paging_strategy_configuration_schedule_strategy: ( - EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset + Unset | EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy ) = "on_call_only" - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats_mode: Unset | EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode = ( + UNSET + ) + paging_strategy_configuration_rotation_scope: ( + Unset | EscalationPolicyLevelPagingStrategyConfigurationRotationScope + ) = UNSET + paging_strategy_configuration_page_users_count: None | Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -70,27 +94,47 @@ def to_dict(self) -> dict[str, Any]: notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: dict[str, Any] | None + notification_target_params_item: None | dict[str, Any] if isinstance(notification_target_params_item_data, EscalationPolicyLevelNotificationTargetParamsItemType0): notification_target_params_item = notification_target_params_item_data.to_dict() else: notification_target_params_item = notification_target_params_item_data notification_target_params.append(notification_target_params_item) - escalation_policy_path_id: None | str | Unset + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - paging_strategy_configuration_strategy: str | Unset = UNSET + paging_strategy_configuration_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: str | Unset = UNSET + paging_strategy_configuration_schedule_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy + paging_strategy_configuration_repeats: None | Unset | int + if isinstance(self.paging_strategy_configuration_repeats, Unset): + paging_strategy_configuration_repeats = UNSET + else: + paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats + + paging_strategy_configuration_repeats_mode: Unset | str = UNSET + if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode + + paging_strategy_configuration_rotation_scope: Unset | str = UNSET + if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope + + paging_strategy_configuration_page_users_count: None | Unset | int + if isinstance(self.paging_strategy_configuration_page_users_count, Unset): + paging_strategy_configuration_page_users_count = UNSET + else: + paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count + created_at = self.created_at updated_at = self.updated_at @@ -113,6 +157,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["paging_strategy_configuration_schedule_strategy"] = ( paging_strategy_configuration_schedule_strategy ) + if paging_strategy_configuration_repeats is not UNSET: + field_dict["paging_strategy_configuration_repeats"] = paging_strategy_configuration_repeats + if paging_strategy_configuration_repeats_mode is not UNSET: + field_dict["paging_strategy_configuration_repeats_mode"] = paging_strategy_configuration_repeats_mode + if paging_strategy_configuration_rotation_scope is not UNSET: + field_dict["paging_strategy_configuration_rotation_scope"] = paging_strategy_configuration_rotation_scope + if paging_strategy_configuration_page_users_count is not UNSET: + field_dict["paging_strategy_configuration_page_users_count"] = ( + paging_strategy_configuration_page_users_count + ) if created_at is not UNSET: field_dict["created_at"] = created_at if updated_at is not UNSET: @@ -139,7 +193,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_notification_target_params_item( data: object, - ) -> EscalationPolicyLevelNotificationTargetParamsItemType0 | None: + ) -> Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]: if data is None: return data try: @@ -150,9 +204,9 @@ def _parse_notification_target_params_item( ) return notification_target_params_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(EscalationPolicyLevelNotificationTargetParamsItemType0 | None, data) + return cast(Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None], data) notification_target_params_item = _parse_notification_target_params_item( notification_target_params_item_data @@ -160,17 +214,17 @@ def _parse_notification_target_params_item( notification_target_params.append(notification_target_params_item) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset + paging_strategy_configuration_strategy: Unset | EscalationPolicyLevelPagingStrategyConfigurationStrategy if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -184,7 +238,7 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: "paging_strategy_configuration_schedule_strategy", UNSET ) paging_strategy_configuration_schedule_strategy: ( - EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset + Unset | EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET @@ -195,6 +249,52 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: ) ) + def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( + d.pop("paging_strategy_configuration_repeats", UNSET) + ) + + _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) + paging_strategy_configuration_repeats_mode: Unset | EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode + if isinstance(_paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = UNSET + else: + paging_strategy_configuration_repeats_mode = ( + check_escalation_policy_level_paging_strategy_configuration_repeats_mode( + _paging_strategy_configuration_repeats_mode + ) + ) + + _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) + paging_strategy_configuration_rotation_scope: ( + Unset | EscalationPolicyLevelPagingStrategyConfigurationRotationScope + ) + if isinstance(_paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = UNSET + else: + paging_strategy_configuration_rotation_scope = ( + check_escalation_policy_level_paging_strategy_configuration_rotation_scope( + _paging_strategy_configuration_rotation_scope + ) + ) + + def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( + d.pop("paging_strategy_configuration_page_users_count", UNSET) + ) + created_at = d.pop("created_at", UNSET) updated_at = d.pop("updated_at", UNSET) @@ -207,6 +307,10 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: escalation_policy_path_id=escalation_policy_path_id, paging_strategy_configuration_strategy=paging_strategy_configuration_strategy, paging_strategy_configuration_schedule_strategy=paging_strategy_configuration_schedule_strategy, + paging_strategy_configuration_repeats=paging_strategy_configuration_repeats, + paging_strategy_configuration_repeats_mode=paging_strategy_configuration_repeats_mode, + paging_strategy_configuration_rotation_scope=paging_strategy_configuration_rotation_scope, + paging_strategy_configuration_page_users_count=paging_strategy_configuration_page_users_count, created_at=created_at, updated_at=updated_at, ) diff --git a/rootly_sdk/models/escalation_policy_level_list.py b/rootly_sdk/models/escalation_policy_level_list.py index 98857100..3e8b9295 100644 --- a/rootly_sdk/models/escalation_policy_level_list.py +++ b/rootly_sdk/models/escalation_policy_level_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class EscalationPolicyLevelList: """ Attributes: - data (list[EscalationPolicyLevelListDataItem]): + data (list['EscalationPolicyLevelListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EscalationPolicyLevelListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EscalationPolicyLevelListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_level_list = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_level_list_data_item.py b/rootly_sdk/models/escalation_policy_level_list_data_item.py index 5f8d975f..478e845f 100644 --- a/rootly_sdk/models/escalation_policy_level_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_level_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class EscalationPolicyLevelListDataItem: """ id: str - attributes: EscalationPolicyLevel + attributes: "EscalationPolicyLevel" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py index da88f065..6fc369bc 100644 --- a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -25,13 +23,13 @@ class EscalationPolicyLevelNotificationTargetParamsItemType0: Attributes: id (str): The ID of notification target type_ (EscalationPolicyLevelNotificationTargetParamsItemType0Type): The type of the notification target - team_members (EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset): For targets with + team_members (Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers]): For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: EscalationPolicyLevelNotificationTargetParamsItemType0Type - team_members: EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset = UNSET + team_members: Unset | EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: str | Unset = UNSET + team_members: Unset | str = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -64,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = check_escalation_policy_level_notification_target_params_item_type_0_type(d.pop("type")) _team_members = d.pop("team_members", UNSET) - team_members: EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset + team_members: Unset | EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py new file mode 100644 index 00000000..a488a4c5 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] + +ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: set[ + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode +] = { + "all", + "users", +} + + +def check_escalation_policy_level_paging_strategy_configuration_repeats_mode( + value: str | None, +) -> EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode | None: + if value is None: + return None + if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: + return cast(EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py new file mode 100644 index 00000000..bb018dc6 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +EscalationPolicyLevelPagingStrategyConfigurationRotationScope = Literal["active_rotation", "entire_schedule"] + +ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: set[ + EscalationPolicyLevelPagingStrategyConfigurationRotationScope +] = { + "active_rotation", + "entire_schedule", +} + + +def check_escalation_policy_level_paging_strategy_configuration_rotation_scope( + value: str | None, +) -> EscalationPolicyLevelPagingStrategyConfigurationRotationScope | None: + if value is None: + return None + if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: + return cast(EscalationPolicyLevelPagingStrategyConfigurationRotationScope, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_level_response.py b/rootly_sdk/models/escalation_policy_level_response.py index 262024a3..9976067b 100644 --- a/rootly_sdk/models/escalation_policy_level_response.py +++ b/rootly_sdk/models/escalation_policy_level_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class EscalationPolicyLevelResponse: """ Attributes: data (EscalationPolicyLevelResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EscalationPolicyLevelResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EscalationPolicyLevelResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EscalationPolicyLevelResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_level_response = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_level_response_data.py b/rootly_sdk/models/escalation_policy_level_response_data.py index 34e59feb..430b5a17 100644 --- a/rootly_sdk/models/escalation_policy_level_response_data.py +++ b/rootly_sdk/models/escalation_policy_level_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class EscalationPolicyLevelResponseData: Attributes: id (str): Unique ID of the escalation policy level attributes (EscalationPolicyLevel): - type_ (EscalationPolicyLevelResponseDataType | Unset): + type_ (Union[Unset, EscalationPolicyLevelResponseDataType]): """ id: str - attributes: EscalationPolicyLevel - type_: EscalationPolicyLevelResponseDataType | Unset = UNSET + attributes: "EscalationPolicyLevel" + type_: Unset | EscalationPolicyLevelResponseDataType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = EscalationPolicyLevel.from_dict(d.pop("attributes")) _type_ = d.pop("type", UNSET) - type_: EscalationPolicyLevelResponseDataType | Unset + type_: Unset | EscalationPolicyLevelResponseDataType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_list.py b/rootly_sdk/models/escalation_policy_list.py index 98fe7348..4e153033 100644 --- a/rootly_sdk/models/escalation_policy_list.py +++ b/rootly_sdk/models/escalation_policy_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class EscalationPolicyList: """ Attributes: - data (list[EscalationPolicyListDataItem]): + data (list['EscalationPolicyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EscalationPolicyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EscalationPolicyListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_list = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_list_data_item.py b/rootly_sdk/models/escalation_policy_list_data_item.py index 36be2375..e9ef02d6 100644 --- a/rootly_sdk/models/escalation_policy_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class EscalationPolicyListDataItem: id: str type_: EscalationPolicyListDataItemType - attributes: EscalationPolicy + attributes: "EscalationPolicy" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/escalation_policy_path.py b/rootly_sdk/models/escalation_policy_path.py index def4ef06..6273b8ba 100644 --- a/rootly_sdk/models/escalation_policy_path.py +++ b/rootly_sdk/models/escalation_policy_path.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -63,81 +61,87 @@ class EscalationPolicyPath: default (bool): Whether this escalation path is the default path notification_type (str): Notification rule type escalation_policy_id (str): The ID of the escalation policy - repeat (bool | None): Whether this path should be repeated until someone acknowledges the alert - repeat_count (int | None): The number of times this path will be executed until someone acknowledges the alert - path_type (EscalationPolicyPathPathType | Unset): The type of escalation path - after_deferral_behavior (EscalationPolicyPathAfterDeferralBehavior | Unset): What happens after a deferral path - finishes - after_deferral_path_id (None | str | Unset): The escalation path to execute after this deferral path when + repeat (Union[None, bool]): Whether this path should be repeated until someone acknowledges the alert + repeat_count (Union[None, int]): The number of times this path will be executed until someone acknowledges the + alert + path_type (Union[Unset, EscalationPolicyPathPathType]): The type of escalation path + after_deferral_behavior (Union[Unset, EscalationPolicyPathAfterDeferralBehavior]): What happens after a deferral + path finishes + after_deferral_path_id (Union[None, Unset, str]): The escalation path to execute after this deferral path when after_deferral_behavior is execute_path - match_mode (EscalationPolicyPathMatchMode | Unset): How path rules are matched. - position (int | Unset): The position of this path in the paths for this EP. - initial_delay (int | Unset): Initial delay for escalation path in minutes. Maximum 1 week (10080). - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - rules (list[EscalationPolicyPathRulesItemType0 | EscalationPolicyPathRulesItemType1 | - EscalationPolicyPathRulesItemType2 | EscalationPolicyPathRulesItemType3 | EscalationPolicyPathRulesItemType4 | - EscalationPolicyPathRulesItemType5 | EscalationPolicyPathRulesItemType6 | EscalationPolicyPathRulesItemType7 | - EscalationPolicyPathRulesItemType8Type0 | EscalationPolicyPathRulesItemType8Type1 | - EscalationPolicyPathRulesItemType8Type2 | EscalationPolicyPathRulesItemType8Type3 | - EscalationPolicyPathRulesItemType8Type4 | EscalationPolicyPathRulesItemType8Type5 | - EscalationPolicyPathRulesItemType8Type6 | EscalationPolicyPathRulesItemType8Type7 | - EscalationPolicyPathRulesItemType9Type0 | EscalationPolicyPathRulesItemType9Type1 | - EscalationPolicyPathRulesItemType9Type2 | EscalationPolicyPathRulesItemType9Type3 | - EscalationPolicyPathRulesItemType9Type4 | EscalationPolicyPathRulesItemType9Type5 | - EscalationPolicyPathRulesItemType9Type6 | EscalationPolicyPathRulesItemType9Type7] | Unset): Escalation path - rules - time_restriction_time_zone (EscalationPolicyPathTimeRestrictionTimeZone | Unset): Time zone used for time + match_mode (Union[Unset, EscalationPolicyPathMatchMode]): How path rules are matched. + position (Union[Unset, int]): The position of this path in the paths for this EP. + initial_delay (Union[Unset, int]): Initial delay for escalation path in minutes. Maximum 1 week (10080). + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts on this path after N + minutes; null inherits the urgency/workspace default, negative = never. + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + rules (Union[Unset, list[Union['EscalationPolicyPathRulesItemType0', 'EscalationPolicyPathRulesItemType1', + 'EscalationPolicyPathRulesItemType2', 'EscalationPolicyPathRulesItemType3', + 'EscalationPolicyPathRulesItemType4', 'EscalationPolicyPathRulesItemType5', + 'EscalationPolicyPathRulesItemType6', 'EscalationPolicyPathRulesItemType7', + 'EscalationPolicyPathRulesItemType8Type0', 'EscalationPolicyPathRulesItemType8Type1', + 'EscalationPolicyPathRulesItemType8Type2', 'EscalationPolicyPathRulesItemType8Type3', + 'EscalationPolicyPathRulesItemType8Type4', 'EscalationPolicyPathRulesItemType8Type5', + 'EscalationPolicyPathRulesItemType8Type6', 'EscalationPolicyPathRulesItemType8Type7', + 'EscalationPolicyPathRulesItemType9Type0', 'EscalationPolicyPathRulesItemType9Type1', + 'EscalationPolicyPathRulesItemType9Type2', 'EscalationPolicyPathRulesItemType9Type3', + 'EscalationPolicyPathRulesItemType9Type4', 'EscalationPolicyPathRulesItemType9Type5', + 'EscalationPolicyPathRulesItemType9Type6', 'EscalationPolicyPathRulesItemType9Type7']]]): Escalation path rules + time_restriction_time_zone (Union[Unset, EscalationPolicyPathTimeRestrictionTimeZone]): Time zone used for time restrictions. - time_restrictions (list[EscalationPolicyPathTimeRestrictionsItem] | Unset): If time restrictions are set, alerts - will follow this path when they arrive within the specified time ranges and meet the rules. + time_restrictions (Union[Unset, list['EscalationPolicyPathTimeRestrictionsItem']]): If time restrictions are + set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ name: str default: bool notification_type: str escalation_policy_id: str - repeat: bool | None - repeat_count: int | None - path_type: EscalationPolicyPathPathType | Unset = UNSET - after_deferral_behavior: EscalationPolicyPathAfterDeferralBehavior | Unset = UNSET - after_deferral_path_id: None | str | Unset = UNSET - match_mode: EscalationPolicyPathMatchMode | Unset = UNSET - position: int | Unset = UNSET - initial_delay: int | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + repeat: None | bool + repeat_count: None | int + path_type: Unset | EscalationPolicyPathPathType = UNSET + after_deferral_behavior: Unset | EscalationPolicyPathAfterDeferralBehavior = UNSET + after_deferral_path_id: None | Unset | str = UNSET + match_mode: Unset | EscalationPolicyPathMatchMode = UNSET + position: Unset | int = UNSET + initial_delay: Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET rules: ( - list[ - EscalationPolicyPathRulesItemType0 - | EscalationPolicyPathRulesItemType1 - | EscalationPolicyPathRulesItemType2 - | EscalationPolicyPathRulesItemType3 - | EscalationPolicyPathRulesItemType4 - | EscalationPolicyPathRulesItemType5 - | EscalationPolicyPathRulesItemType6 - | EscalationPolicyPathRulesItemType7 - | EscalationPolicyPathRulesItemType8Type0 - | EscalationPolicyPathRulesItemType8Type1 - | EscalationPolicyPathRulesItemType8Type2 - | EscalationPolicyPathRulesItemType8Type3 - | EscalationPolicyPathRulesItemType8Type4 - | EscalationPolicyPathRulesItemType8Type5 - | EscalationPolicyPathRulesItemType8Type6 - | EscalationPolicyPathRulesItemType8Type7 - | EscalationPolicyPathRulesItemType9Type0 - | EscalationPolicyPathRulesItemType9Type1 - | EscalationPolicyPathRulesItemType9Type2 - | EscalationPolicyPathRulesItemType9Type3 - | EscalationPolicyPathRulesItemType9Type4 - | EscalationPolicyPathRulesItemType9Type5 - | EscalationPolicyPathRulesItemType9Type6 - | EscalationPolicyPathRulesItemType9Type7 + Unset + | list[ + Union[ + "EscalationPolicyPathRulesItemType0", + "EscalationPolicyPathRulesItemType1", + "EscalationPolicyPathRulesItemType2", + "EscalationPolicyPathRulesItemType3", + "EscalationPolicyPathRulesItemType4", + "EscalationPolicyPathRulesItemType5", + "EscalationPolicyPathRulesItemType6", + "EscalationPolicyPathRulesItemType7", + "EscalationPolicyPathRulesItemType8Type0", + "EscalationPolicyPathRulesItemType8Type1", + "EscalationPolicyPathRulesItemType8Type2", + "EscalationPolicyPathRulesItemType8Type3", + "EscalationPolicyPathRulesItemType8Type4", + "EscalationPolicyPathRulesItemType8Type5", + "EscalationPolicyPathRulesItemType8Type6", + "EscalationPolicyPathRulesItemType8Type7", + "EscalationPolicyPathRulesItemType9Type0", + "EscalationPolicyPathRulesItemType9Type1", + "EscalationPolicyPathRulesItemType9Type2", + "EscalationPolicyPathRulesItemType9Type3", + "EscalationPolicyPathRulesItemType9Type4", + "EscalationPolicyPathRulesItemType9Type5", + "EscalationPolicyPathRulesItemType9Type6", + "EscalationPolicyPathRulesItemType9Type7", + ] ] - | Unset ) = UNSET - time_restriction_time_zone: EscalationPolicyPathTimeRestrictionTimeZone | Unset = UNSET - time_restrictions: list[EscalationPolicyPathTimeRestrictionsItem] | Unset = UNSET + time_restriction_time_zone: Unset | EscalationPolicyPathTimeRestrictionTimeZone = UNSET + time_restrictions: Unset | list["EscalationPolicyPathTimeRestrictionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -173,27 +177,27 @@ def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id - repeat: bool | None + repeat: None | bool repeat = self.repeat - repeat_count: int | None + repeat_count: None | int repeat_count = self.repeat_count - path_type: str | Unset = UNSET + path_type: Unset | str = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: str | Unset = UNSET + after_deferral_behavior: Unset | str = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | str | Unset + after_deferral_path_id: None | Unset | str if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - match_mode: str | Unset = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode @@ -201,11 +205,17 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay + retrigger_timeout_minutes: None | Unset | int + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + created_at = self.created_at updated_at = self.updated_at - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -261,11 +271,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: str | Unset = UNSET + time_restriction_time_zone: Unset | str = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: list[dict[str, Any]] | Unset = UNSET + time_restrictions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -296,6 +306,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["position"] = position if initial_delay is not UNSET: field_dict["initial_delay"] = initial_delay + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if created_at is not UNSET: field_dict["created_at"] = created_at if updated_at is not UNSET: @@ -346,45 +358,45 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalation_policy_id = d.pop("escalation_policy_id") - def _parse_repeat(data: object) -> bool | None: + def _parse_repeat(data: object) -> None | bool: if data is None: return data - return cast(bool | None, data) + return cast(None | bool, data) repeat = _parse_repeat(d.pop("repeat")) - def _parse_repeat_count(data: object) -> int | None: + def _parse_repeat_count(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) repeat_count = _parse_repeat_count(d.pop("repeat_count")) _path_type = d.pop("path_type", UNSET) - path_type: EscalationPolicyPathPathType | Unset + path_type: Unset | EscalationPolicyPathPathType if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_escalation_policy_path_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: EscalationPolicyPathAfterDeferralBehavior | Unset + after_deferral_behavior: Unset | EscalationPolicyPathAfterDeferralBehavior if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: after_deferral_behavior = check_escalation_policy_path_after_deferral_behavior(_after_deferral_behavior) - def _parse_after_deferral_path_id(data: object) -> None | str | Unset: + def _parse_after_deferral_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: EscalationPolicyPathMatchMode | Unset + match_mode: Unset | EscalationPolicyPathMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -394,268 +406,247 @@ def _parse_after_deferral_path_id(data: object) -> None | str | Unset: initial_delay = d.pop("initial_delay", UNSET) + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + created_at = d.pop("created_at", UNSET) updated_at = d.pop("updated_at", UNSET) + rules = [] _rules = d.pop("rules", UNSET) - rules: ( - list[ - EscalationPolicyPathRulesItemType0 - | EscalationPolicyPathRulesItemType1 - | EscalationPolicyPathRulesItemType2 - | EscalationPolicyPathRulesItemType3 - | EscalationPolicyPathRulesItemType4 - | EscalationPolicyPathRulesItemType5 - | EscalationPolicyPathRulesItemType6 - | EscalationPolicyPathRulesItemType7 - | EscalationPolicyPathRulesItemType8Type0 - | EscalationPolicyPathRulesItemType8Type1 - | EscalationPolicyPathRulesItemType8Type2 - | EscalationPolicyPathRulesItemType8Type3 - | EscalationPolicyPathRulesItemType8Type4 - | EscalationPolicyPathRulesItemType8Type5 - | EscalationPolicyPathRulesItemType8Type6 - | EscalationPolicyPathRulesItemType8Type7 - | EscalationPolicyPathRulesItemType9Type0 - | EscalationPolicyPathRulesItemType9Type1 - | EscalationPolicyPathRulesItemType9Type2 - | EscalationPolicyPathRulesItemType9Type3 - | EscalationPolicyPathRulesItemType9Type4 - | EscalationPolicyPathRulesItemType9Type5 - | EscalationPolicyPathRulesItemType9Type6 - | EscalationPolicyPathRulesItemType9Type7 - ] - | Unset - ) = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - - def _parse_rules_item( - data: object, - ) -> ( - EscalationPolicyPathRulesItemType0 - | EscalationPolicyPathRulesItemType1 - | EscalationPolicyPathRulesItemType2 - | EscalationPolicyPathRulesItemType3 - | EscalationPolicyPathRulesItemType4 - | EscalationPolicyPathRulesItemType5 - | EscalationPolicyPathRulesItemType6 - | EscalationPolicyPathRulesItemType7 - | EscalationPolicyPathRulesItemType8Type0 - | EscalationPolicyPathRulesItemType8Type1 - | EscalationPolicyPathRulesItemType8Type2 - | EscalationPolicyPathRulesItemType8Type3 - | EscalationPolicyPathRulesItemType8Type4 - | EscalationPolicyPathRulesItemType8Type5 - | EscalationPolicyPathRulesItemType8Type6 - | EscalationPolicyPathRulesItemType8Type7 - | EscalationPolicyPathRulesItemType9Type0 - | EscalationPolicyPathRulesItemType9Type1 - | EscalationPolicyPathRulesItemType9Type2 - | EscalationPolicyPathRulesItemType9Type3 - | EscalationPolicyPathRulesItemType9Type4 - | EscalationPolicyPathRulesItemType9Type5 - | EscalationPolicyPathRulesItemType9Type6 - | EscalationPolicyPathRulesItemType9Type7 - ): - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_0 = EscalationPolicyPathRulesItemType0.from_dict(data) - - return rules_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_1 = EscalationPolicyPathRulesItemType1.from_dict(data) - - return rules_item_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_2 = EscalationPolicyPathRulesItemType2.from_dict(data) - - return rules_item_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_3 = EscalationPolicyPathRulesItemType3.from_dict(data) - - return rules_item_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_4 = EscalationPolicyPathRulesItemType4.from_dict(data) - - return rules_item_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_5 = EscalationPolicyPathRulesItemType5.from_dict(data) - - return rules_item_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_6 = EscalationPolicyPathRulesItemType6.from_dict(data) - - return rules_item_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_7 = EscalationPolicyPathRulesItemType7.from_dict(data) - - return rules_item_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_0 = EscalationPolicyPathRulesItemType8Type0.from_dict(data) - - return rules_item_type_8_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_1 = EscalationPolicyPathRulesItemType8Type1.from_dict(data) - - return rules_item_type_8_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_2 = EscalationPolicyPathRulesItemType8Type2.from_dict(data) - - return rules_item_type_8_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_3 = EscalationPolicyPathRulesItemType8Type3.from_dict(data) - - return rules_item_type_8_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_4 = EscalationPolicyPathRulesItemType8Type4.from_dict(data) - - return rules_item_type_8_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_5 = EscalationPolicyPathRulesItemType8Type5.from_dict(data) - - return rules_item_type_8_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_6 = EscalationPolicyPathRulesItemType8Type6.from_dict(data) - - return rules_item_type_8_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_7 = EscalationPolicyPathRulesItemType8Type7.from_dict(data) - - return rules_item_type_8_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_0 = EscalationPolicyPathRulesItemType9Type0.from_dict(data) - - return rules_item_type_9_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_1 = EscalationPolicyPathRulesItemType9Type1.from_dict(data) - - return rules_item_type_9_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_2 = EscalationPolicyPathRulesItemType9Type2.from_dict(data) - - return rules_item_type_9_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_3 = EscalationPolicyPathRulesItemType9Type3.from_dict(data) - - return rules_item_type_9_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_4 = EscalationPolicyPathRulesItemType9Type4.from_dict(data) - - return rules_item_type_9_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_5 = EscalationPolicyPathRulesItemType9Type5.from_dict(data) - - return rules_item_type_9_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_6 = EscalationPolicyPathRulesItemType9Type6.from_dict(data) - - return rules_item_type_9_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass + for rules_item_data in _rules or []: + + def _parse_rules_item( + data: object, + ) -> Union[ + "EscalationPolicyPathRulesItemType0", + "EscalationPolicyPathRulesItemType1", + "EscalationPolicyPathRulesItemType2", + "EscalationPolicyPathRulesItemType3", + "EscalationPolicyPathRulesItemType4", + "EscalationPolicyPathRulesItemType5", + "EscalationPolicyPathRulesItemType6", + "EscalationPolicyPathRulesItemType7", + "EscalationPolicyPathRulesItemType8Type0", + "EscalationPolicyPathRulesItemType8Type1", + "EscalationPolicyPathRulesItemType8Type2", + "EscalationPolicyPathRulesItemType8Type3", + "EscalationPolicyPathRulesItemType8Type4", + "EscalationPolicyPathRulesItemType8Type5", + "EscalationPolicyPathRulesItemType8Type6", + "EscalationPolicyPathRulesItemType8Type7", + "EscalationPolicyPathRulesItemType9Type0", + "EscalationPolicyPathRulesItemType9Type1", + "EscalationPolicyPathRulesItemType9Type2", + "EscalationPolicyPathRulesItemType9Type3", + "EscalationPolicyPathRulesItemType9Type4", + "EscalationPolicyPathRulesItemType9Type5", + "EscalationPolicyPathRulesItemType9Type6", + "EscalationPolicyPathRulesItemType9Type7", + ]: + try: if not isinstance(data, dict): raise TypeError() - rules_item_type_9_type_7 = EscalationPolicyPathRulesItemType9Type7.from_dict(data) + rules_item_type_0 = EscalationPolicyPathRulesItemType0.from_dict(data) - return rules_item_type_9_type_7 + return rules_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_1 = EscalationPolicyPathRulesItemType1.from_dict(data) + + return rules_item_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_2 = EscalationPolicyPathRulesItemType2.from_dict(data) - rules_item = _parse_rules_item(rules_item_data) + return rules_item_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_3 = EscalationPolicyPathRulesItemType3.from_dict(data) - rules.append(rules_item) + return rules_item_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_4 = EscalationPolicyPathRulesItemType4.from_dict(data) + + return rules_item_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_5 = EscalationPolicyPathRulesItemType5.from_dict(data) + + return rules_item_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_6 = EscalationPolicyPathRulesItemType6.from_dict(data) + + return rules_item_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_7 = EscalationPolicyPathRulesItemType7.from_dict(data) + + return rules_item_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_0 = EscalationPolicyPathRulesItemType8Type0.from_dict(data) + + return rules_item_type_8_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_1 = EscalationPolicyPathRulesItemType8Type1.from_dict(data) + + return rules_item_type_8_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_2 = EscalationPolicyPathRulesItemType8Type2.from_dict(data) + + return rules_item_type_8_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_3 = EscalationPolicyPathRulesItemType8Type3.from_dict(data) + + return rules_item_type_8_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_4 = EscalationPolicyPathRulesItemType8Type4.from_dict(data) + + return rules_item_type_8_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_5 = EscalationPolicyPathRulesItemType8Type5.from_dict(data) + + return rules_item_type_8_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_6 = EscalationPolicyPathRulesItemType8Type6.from_dict(data) + + return rules_item_type_8_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_7 = EscalationPolicyPathRulesItemType8Type7.from_dict(data) + + return rules_item_type_8_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_0 = EscalationPolicyPathRulesItemType9Type0.from_dict(data) + + return rules_item_type_9_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_1 = EscalationPolicyPathRulesItemType9Type1.from_dict(data) + + return rules_item_type_9_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_2 = EscalationPolicyPathRulesItemType9Type2.from_dict(data) + + return rules_item_type_9_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_3 = EscalationPolicyPathRulesItemType9Type3.from_dict(data) + + return rules_item_type_9_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_4 = EscalationPolicyPathRulesItemType9Type4.from_dict(data) + + return rules_item_type_9_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_5 = EscalationPolicyPathRulesItemType9Type5.from_dict(data) + + return rules_item_type_9_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_6 = EscalationPolicyPathRulesItemType9Type6.from_dict(data) + + return rules_item_type_9_type_6 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_7 = EscalationPolicyPathRulesItemType9Type7.from_dict(data) + + return rules_item_type_9_type_7 + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: EscalationPolicyPathTimeRestrictionTimeZone | Unset + time_restriction_time_zone: Unset | EscalationPolicyPathTimeRestrictionTimeZone if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -663,14 +654,12 @@ def _parse_rules_item( _time_restriction_time_zone ) + time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - time_restrictions: list[EscalationPolicyPathTimeRestrictionsItem] | Unset = UNSET - if _time_restrictions is not UNSET: - time_restrictions = [] - for time_restrictions_item_data in _time_restrictions: - time_restrictions_item = EscalationPolicyPathTimeRestrictionsItem.from_dict(time_restrictions_item_data) + for time_restrictions_item_data in _time_restrictions or []: + time_restrictions_item = EscalationPolicyPathTimeRestrictionsItem.from_dict(time_restrictions_item_data) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) escalation_policy_path = cls( name=name, @@ -685,6 +674,7 @@ def _parse_rules_item( match_mode=match_mode, position=position, initial_delay=initial_delay, + retrigger_timeout_minutes=retrigger_timeout_minutes, created_at=created_at, updated_at=updated_at, rules=rules, diff --git a/rootly_sdk/models/escalation_policy_path_list.py b/rootly_sdk/models/escalation_policy_path_list.py index 3c07f135..2ce01f9c 100644 --- a/rootly_sdk/models/escalation_policy_path_list.py +++ b/rootly_sdk/models/escalation_policy_path_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class EscalationPolicyPathList: """ Attributes: - data (list[EscalationPolicyPathListDataItem]): + data (list['EscalationPolicyPathListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EscalationPolicyPathListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EscalationPolicyPathListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_path_list = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_path_list_data_item.py b/rootly_sdk/models/escalation_policy_path_list_data_item.py index bcb35aac..5807ada6 100644 --- a/rootly_sdk/models/escalation_policy_path_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_path_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class EscalationPolicyPathListDataItem: """ id: str - attributes: EscalationPolicyPath + attributes: "EscalationPolicyPath" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/escalation_policy_path_response.py b/rootly_sdk/models/escalation_policy_path_response.py index 0983a792..4715e25f 100644 --- a/rootly_sdk/models/escalation_policy_path_response.py +++ b/rootly_sdk/models/escalation_policy_path_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class EscalationPolicyPathResponse: """ Attributes: data (EscalationPolicyPathResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EscalationPolicyPathResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EscalationPolicyPathResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EscalationPolicyPathResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_path_response = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_path_response_data.py b/rootly_sdk/models/escalation_policy_path_response_data.py index 0b318cc3..18916f6d 100644 --- a/rootly_sdk/models/escalation_policy_path_response_data.py +++ b/rootly_sdk/models/escalation_policy_path_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class EscalationPolicyPathResponseData: Attributes: id (str): Unique ID of the escalation policy path attributes (EscalationPolicyPath): - type_ (EscalationPolicyPathResponseDataType | Unset): + type_ (Union[Unset, EscalationPolicyPathResponseDataType]): """ id: str - attributes: EscalationPolicyPath - type_: EscalationPolicyPathResponseDataType | Unset = UNSET + attributes: "EscalationPolicyPath" + type_: Unset | EscalationPolicyPathResponseDataType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = EscalationPolicyPath.from_dict(d.pop("attributes")) _type_ = d.pop("type", UNSET) - type_: EscalationPolicyPathResponseDataType | Unset + type_: Unset | EscalationPolicyPathResponseDataType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py index f01cb69c..7ed1d883 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py index cebe2ca3..a9321684 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py index 6c37de59..567cf452 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,15 +24,15 @@ class EscalationPolicyPathRulesItemType2: rule_type (EscalationPolicyPathRulesItemType2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (EscalationPolicyPathRulesItemType2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: EscalationPolicyPathRulesItemType2RuleType json_path: str operator: EscalationPolicyPathRulesItemType2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py index 7696e1e7..3ed06c03 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,14 +25,14 @@ class EscalationPolicyPathRulesItemType3: fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field operator (EscalationPolicyPathRulesItemType3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: EscalationPolicyPathRulesItemType3RuleType fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py index 0b343c49..823b3a31 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py index e0cca146..c03dd7a2 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class EscalationPolicyPathRulesItemType5: Attributes: rule_type (EscalationPolicyPathRulesItemType5RuleType): The type of the escalation path rule time_zone (EscalationPolicyPathRulesItemType5TimeZone): Time zone for the deferral window - time_blocks (list[EscalationPolicyPathRulesItemType5TimeBlocksItem]): Time windows during which alerts are + time_blocks (list['EscalationPolicyPathRulesItemType5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: EscalationPolicyPathRulesItemType5RuleType time_zone: EscalationPolicyPathRulesItemType5TimeZone - time_blocks: list[EscalationPolicyPathRulesItemType5TimeBlocksItem] + time_blocks: list["EscalationPolicyPathRulesItemType5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py index 2c596cc9..4f035199 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class EscalationPolicyPathRulesItemType5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py index 5b56175d..35414457 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py index 76be2bb0..6f9b7ce2 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py index cac3b5ab..89172353 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py index c58ca2b9..74b34e0a 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py index 1f0b82f7..da128c49 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,15 +24,15 @@ class EscalationPolicyPathRulesItemType8Type2: rule_type (EscalationPolicyPathRulesItemType8Type2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (EscalationPolicyPathRulesItemType8Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: EscalationPolicyPathRulesItemType8Type2RuleType json_path: str operator: EscalationPolicyPathRulesItemType8Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_8_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py index 2081dba4..a632ce68 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,14 +25,14 @@ class EscalationPolicyPathRulesItemType8Type3: fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field operator (EscalationPolicyPathRulesItemType8Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: EscalationPolicyPathRulesItemType8Type3RuleType fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType8Type3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py index ffbf6f87..8821029c 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py index 1143016f..01145569 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class EscalationPolicyPathRulesItemType8Type5: Attributes: rule_type (EscalationPolicyPathRulesItemType8Type5RuleType): The type of the escalation path rule time_zone (EscalationPolicyPathRulesItemType8Type5TimeZone): Time zone for the deferral window - time_blocks (list[EscalationPolicyPathRulesItemType8Type5TimeBlocksItem]): Time windows during which alerts are - deferred + time_blocks (list['EscalationPolicyPathRulesItemType8Type5TimeBlocksItem']): Time windows during which alerts + are deferred """ rule_type: EscalationPolicyPathRulesItemType8Type5RuleType time_zone: EscalationPolicyPathRulesItemType8Type5TimeZone - time_blocks: list[EscalationPolicyPathRulesItemType8Type5TimeBlocksItem] + time_blocks: list["EscalationPolicyPathRulesItemType8Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py index 78acd66d..98a58ca4 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class EscalationPolicyPathRulesItemType8Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py index c83904aa..24acc55b 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py index 435bdc44..757912d8 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py index ec39d280..aba4b2e1 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py index 6ba315ef..90b2784d 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py index 97d1442c..6e441992 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,15 +24,15 @@ class EscalationPolicyPathRulesItemType9Type2: rule_type (EscalationPolicyPathRulesItemType9Type2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (EscalationPolicyPathRulesItemType9Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: EscalationPolicyPathRulesItemType9Type2RuleType json_path: str operator: EscalationPolicyPathRulesItemType9Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_9_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py index 6c5863b1..5f33ce05 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,14 +25,14 @@ class EscalationPolicyPathRulesItemType9Type3: fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field operator (EscalationPolicyPathRulesItemType9Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: EscalationPolicyPathRulesItemType9Type3RuleType fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType9Type3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py index d20cd9a4..8b8719df 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py index 69651641..43f7ef47 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class EscalationPolicyPathRulesItemType9Type5: Attributes: rule_type (EscalationPolicyPathRulesItemType9Type5RuleType): The type of the escalation path rule time_zone (EscalationPolicyPathRulesItemType9Type5TimeZone): Time zone for the deferral window - time_blocks (list[EscalationPolicyPathRulesItemType9Type5TimeBlocksItem]): Time windows during which alerts are - deferred + time_blocks (list['EscalationPolicyPathRulesItemType9Type5TimeBlocksItem']): Time windows during which alerts + are deferred """ rule_type: EscalationPolicyPathRulesItemType9Type5RuleType time_zone: EscalationPolicyPathRulesItemType9Type5TimeZone - time_blocks: list[EscalationPolicyPathRulesItemType9Type5TimeBlocksItem] + time_blocks: list["EscalationPolicyPathRulesItemType9Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py index 6b32dea9..a369c539 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class EscalationPolicyPathRulesItemType9Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py index ac30f0d9..0c836e8c 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py index c66bd1f0..6fe8e16b 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py index b5f130f6..789ccb5f 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py +++ b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,26 +21,26 @@ class EscalationPolicyPathTimeRestrictionsItem: """ Attributes: - start_day (EscalationPolicyPathTimeRestrictionsItemStartDay | Unset): - start_time (str | Unset): Formatted as HH:MM - end_day (EscalationPolicyPathTimeRestrictionsItemEndDay | Unset): - end_time (str | Unset): Formatted as HH:MM + start_day (Union[Unset, EscalationPolicyPathTimeRestrictionsItemStartDay]): + start_time (Union[Unset, str]): Formatted as HH:MM + end_day (Union[Unset, EscalationPolicyPathTimeRestrictionsItemEndDay]): + end_time (Union[Unset, str]): Formatted as HH:MM """ - start_day: EscalationPolicyPathTimeRestrictionsItemStartDay | Unset = UNSET - start_time: str | Unset = UNSET - end_day: EscalationPolicyPathTimeRestrictionsItemEndDay | Unset = UNSET - end_time: str | Unset = UNSET + start_day: Unset | EscalationPolicyPathTimeRestrictionsItemStartDay = UNSET + start_time: Unset | str = UNSET + end_day: Unset | EscalationPolicyPathTimeRestrictionsItemEndDay = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: str | Unset = UNSET + start_day: Unset | str = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: str | Unset = UNSET + end_day: Unset | str = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_day = d.pop("start_day", UNSET) - start_day: EscalationPolicyPathTimeRestrictionsItemStartDay | Unset + start_day: Unset | EscalationPolicyPathTimeRestrictionsItemStartDay if isinstance(_start_day, Unset): start_day = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_time = d.pop("start_time", UNSET) _end_day = d.pop("end_day", UNSET) - end_day: EscalationPolicyPathTimeRestrictionsItemEndDay | Unset + end_day: Unset | EscalationPolicyPathTimeRestrictionsItemEndDay if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_response.py b/rootly_sdk/models/escalation_policy_response.py index 75a58333..a6804191 100644 --- a/rootly_sdk/models/escalation_policy_response.py +++ b/rootly_sdk/models/escalation_policy_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class EscalationPolicyResponse: """ Attributes: data (EscalationPolicyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EscalationPolicyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EscalationPolicyResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EscalationPolicyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_response = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_response_data.py b/rootly_sdk/models/escalation_policy_response_data.py index 04dc48e4..1155c119 100644 --- a/rootly_sdk/models/escalation_policy_response_data.py +++ b/rootly_sdk/models/escalation_policy_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class EscalationPolicyResponseData: id: str type_: EscalationPolicyResponseDataType - attributes: EscalationPolicy + attributes: "EscalationPolicy" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field.py b/rootly_sdk/models/form_field.py index 37eb897e..61e4bb5e 100644 --- a/rootly_sdk/models/form_field.py +++ b/rootly_sdk/models/form_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -8,6 +6,7 @@ from ..models.form_field_input_kind import FormFieldInputKind, check_form_field_input_kind from ..models.form_field_kind import FormFieldKind, check_form_field_kind +from ..models.form_field_resource_type import FormFieldResourceType, check_form_field_resource_type from ..models.form_field_value_kind import FormFieldValueKind, check_form_field_value_kind from ..types import UNSET, Unset @@ -27,12 +26,13 @@ class FormField: default_values (list[str]): created_at (str): Date of creation updated_at (str): Date of last update - value_kind_catalog_id (None | str | Unset): The ID of the catalog used when value_kind is `catalog_entity` - slug (str | Unset): The slug of the form field - description (None | str | Unset): The description of the form field - show_on_incident_details (bool | Unset): Whether the form field is shown on the incident details panel - enabled (bool | Unset): Whether the form field is enabled - auto_set_by_catalog_property_id (None | str | Unset): Catalog property ID to auto-set this form field. Only + value_kind_catalog_id (Union[None, Unset, str]): The ID of the catalog used when value_kind is `catalog_entity` + slug (Union[Unset, str]): The slug of the form field + resource_type (Union[Unset, FormFieldResourceType]): The resource type this field belongs to + description (Union[None, Unset, str]): The description of the form field + show_on_incident_details (Union[Unset, bool]): Whether the form field is shown on the incident details panel + enabled (Union[Unset, bool]): Whether the form field is enabled + auto_set_by_catalog_property_id (Union[None, Unset, str]): Catalog property ID to auto-set this form field. Only reference-kind catalog properties are supported. """ @@ -45,12 +45,13 @@ class FormField: default_values: list[str] created_at: str updated_at: str - value_kind_catalog_id: None | str | Unset = UNSET - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - show_on_incident_details: bool | Unset = UNSET - enabled: bool | Unset = UNSET - auto_set_by_catalog_property_id: None | str | Unset = UNSET + value_kind_catalog_id: None | Unset | str = UNSET + slug: Unset | str = UNSET + resource_type: Unset | FormFieldResourceType = UNSET + description: None | Unset | str = UNSET + show_on_incident_details: Unset | bool = UNSET + enabled: Unset | bool = UNSET + auto_set_by_catalog_property_id: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -72,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - value_kind_catalog_id: None | str | Unset + value_kind_catalog_id: None | Unset | str if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -80,7 +81,11 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + resource_type: Unset | str = UNSET + if not isinstance(self.resource_type, Unset): + resource_type = self.resource_type + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -90,7 +95,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - auto_set_by_catalog_property_id: None | str | Unset + auto_set_by_catalog_property_id: None | Unset | str if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -115,6 +120,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["value_kind_catalog_id"] = value_kind_catalog_id if slug is not UNSET: field_dict["slug"] = slug + if resource_type is not UNSET: + field_dict["resource_type"] = resource_type if description is not UNSET: field_dict["description"] = description if show_on_incident_details is not UNSET: @@ -147,23 +154,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_value_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + _resource_type = d.pop("resource_type", UNSET) + resource_type: Unset | FormFieldResourceType + if isinstance(_resource_type, Unset): + resource_type = UNSET + else: + resource_type = check_form_field_resource_type(_resource_type) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -171,12 +185,12 @@ def _parse_description(data: object) -> None | str | Unset: enabled = d.pop("enabled", UNSET) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) @@ -194,6 +208,7 @@ def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: updated_at=updated_at, value_kind_catalog_id=value_kind_catalog_id, slug=slug, + resource_type=resource_type, description=description, show_on_incident_details=show_on_incident_details, enabled=enabled, diff --git a/rootly_sdk/models/form_field_list.py b/rootly_sdk/models/form_field_list.py index 2011c3b9..62e11107 100644 --- a/rootly_sdk/models/form_field_list.py +++ b/rootly_sdk/models/form_field_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormFieldList: """ Attributes: - data (list[FormFieldListDataItem]): + data (list['FormFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_list_data_item.py b/rootly_sdk/models/form_field_list_data_item.py index e25163e5..f29da629 100644 --- a/rootly_sdk/models/form_field_list_data_item.py +++ b/rootly_sdk/models/form_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormFieldListDataItem: id: str type_: FormFieldListDataItemType - attributes: FormField + attributes: "FormField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_option.py b/rootly_sdk/models/form_field_option.py index c26efcd3..c5a5b667 100644 --- a/rootly_sdk/models/form_field_option.py +++ b/rootly_sdk/models/form_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,9 +18,9 @@ class FormFieldOption: position (int): The position of the form field option created_at (str): Date of creation updated_at (str): Date of last update - id (str | Unset): Unique ID of the form field option - form_field_id (str | Unset): The ID of the parent custom field - default (bool | Unset): + id (Union[Unset, str]): Unique ID of the form field option + form_field_id (Union[Unset, str]): The ID of the parent custom field + default (Union[Unset, bool]): """ value: str @@ -30,9 +28,9 @@ class FormFieldOption: position: int created_at: str updated_at: str - id: str | Unset = UNSET - form_field_id: str | Unset = UNSET - default: bool | Unset = UNSET + id: Unset | str = UNSET + form_field_id: Unset | str = UNSET + default: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/form_field_option_list.py b/rootly_sdk/models/form_field_option_list.py index e790315c..0df3186c 100644 --- a/rootly_sdk/models/form_field_option_list.py +++ b/rootly_sdk/models/form_field_option_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormFieldOptionList: """ Attributes: - data (list[FormFieldOptionListDataItem]): + data (list['FormFieldOptionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldOptionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldOptionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_option_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_option_list_data_item.py b/rootly_sdk/models/form_field_option_list_data_item.py index cd8c8f3b..581c2720 100644 --- a/rootly_sdk/models/form_field_option_list_data_item.py +++ b/rootly_sdk/models/form_field_option_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldOptionListDataItem: id: str type_: FormFieldOptionListDataItemType - attributes: FormFieldOption + attributes: "FormFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_option_response.py b/rootly_sdk/models/form_field_option_response.py index a4531c97..7693a9f7 100644 --- a/rootly_sdk/models/form_field_option_response.py +++ b/rootly_sdk/models/form_field_option_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormFieldOptionResponse: """ Attributes: data (FormFieldOptionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldOptionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldOptionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldOptionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_option_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_option_response_data.py b/rootly_sdk/models/form_field_option_response_data.py index e9ccf686..0711113b 100644 --- a/rootly_sdk/models/form_field_option_response_data.py +++ b/rootly_sdk/models/form_field_option_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldOptionResponseData: id: str type_: FormFieldOptionResponseDataType - attributes: FormFieldOption + attributes: "FormFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement.py b/rootly_sdk/models/form_field_placement.py index e9a20d4d..56b64baf 100644 --- a/rootly_sdk/models/form_field_placement.py +++ b/rootly_sdk/models/form_field_placement.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -24,15 +22,16 @@ class FormFieldPlacement: """ Attributes: form_field_id (str): The form field that is placed. - form_set_id (str): The form set this field is placed in. + form_set_id (str): The form set this field is placed in. The form set must have the same `resource_type` as the + form field, otherwise the request is rejected with 422. form (str): The form this field is placed on. position (int): The position of the field placement. required (bool): Whether the field is unconditionally required on this form. - required_operator (FormFieldPlacementRequiredOperator | Unset): Logical operator when evaluating multiple + required_operator (Union[Unset, FormFieldPlacementRequiredOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (FormFieldPlacementPlacementOperator | Unset): Logical operator when evaluating multiple - form_field_placement_conditions with conditioned=placement - non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. + placement_operator (Union[Unset, FormFieldPlacementPlacementOperator]): Logical operator when evaluating + multiple form_field_placement_conditions with conditioned=placement + non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ form_field_id: str @@ -40,9 +39,9 @@ class FormFieldPlacement: form: str position: int required: bool - required_operator: FormFieldPlacementRequiredOperator | Unset = UNSET - placement_operator: FormFieldPlacementPlacementOperator | Unset = UNSET - non_editable: bool | Unset = UNSET + required_operator: Unset | FormFieldPlacementRequiredOperator = UNSET + placement_operator: Unset | FormFieldPlacementPlacementOperator = UNSET + non_editable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: str | Unset = UNSET + required_operator: Unset | str = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: str | Unset = UNSET + placement_operator: Unset | str = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -100,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required") _required_operator = d.pop("required_operator", UNSET) - required_operator: FormFieldPlacementRequiredOperator | Unset + required_operator: Unset | FormFieldPlacementRequiredOperator if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_form_field_placement_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: FormFieldPlacementPlacementOperator | Unset + placement_operator: Unset | FormFieldPlacementPlacementOperator if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/form_field_placement_condition.py b/rootly_sdk/models/form_field_placement_condition.py index 727f0372..304d4790 100644 --- a/rootly_sdk/models/form_field_placement_condition.py +++ b/rootly_sdk/models/form_field_placement_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/form_field_placement_condition_list.py b/rootly_sdk/models/form_field_placement_condition_list.py index 94fe706f..fc68a3af 100644 --- a/rootly_sdk/models/form_field_placement_condition_list.py +++ b/rootly_sdk/models/form_field_placement_condition_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormFieldPlacementConditionList: """ Attributes: - data (list[FormFieldPlacementConditionListDataItem]): + data (list['FormFieldPlacementConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldPlacementConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldPlacementConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_condition_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_condition_list_data_item.py b/rootly_sdk/models/form_field_placement_condition_list_data_item.py index 5f15820c..ce1f7db9 100644 --- a/rootly_sdk/models/form_field_placement_condition_list_data_item.py +++ b/rootly_sdk/models/form_field_placement_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementConditionListDataItem: id: str type_: FormFieldPlacementConditionListDataItemType - attributes: FormFieldPlacementCondition + attributes: "FormFieldPlacementCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement_condition_response.py b/rootly_sdk/models/form_field_placement_condition_response.py index c374c385..f781783b 100644 --- a/rootly_sdk/models/form_field_placement_condition_response.py +++ b/rootly_sdk/models/form_field_placement_condition_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormFieldPlacementConditionResponse: """ Attributes: data (FormFieldPlacementConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldPlacementConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldPlacementConditionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldPlacementConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_condition_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_condition_response_data.py b/rootly_sdk/models/form_field_placement_condition_response_data.py index 61facbc0..1ffe68e9 100644 --- a/rootly_sdk/models/form_field_placement_condition_response_data.py +++ b/rootly_sdk/models/form_field_placement_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementConditionResponseData: id: str type_: FormFieldPlacementConditionResponseDataType - attributes: FormFieldPlacementCondition + attributes: "FormFieldPlacementCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement_list.py b/rootly_sdk/models/form_field_placement_list.py index 3e82fdde..4a2d176b 100644 --- a/rootly_sdk/models/form_field_placement_list.py +++ b/rootly_sdk/models/form_field_placement_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormFieldPlacementList: """ Attributes: - data (list[FormFieldPlacementListDataItem]): + data (list['FormFieldPlacementListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldPlacementListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldPlacementListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_list_data_item.py b/rootly_sdk/models/form_field_placement_list_data_item.py index fb27515a..d9bb45af 100644 --- a/rootly_sdk/models/form_field_placement_list_data_item.py +++ b/rootly_sdk/models/form_field_placement_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementListDataItem: id: str type_: FormFieldPlacementListDataItemType - attributes: FormFieldPlacement + attributes: "FormFieldPlacement" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement_response.py b/rootly_sdk/models/form_field_placement_response.py index e1366e5f..8181d071 100644 --- a/rootly_sdk/models/form_field_placement_response.py +++ b/rootly_sdk/models/form_field_placement_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormFieldPlacementResponse: """ Attributes: data (FormFieldPlacementResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldPlacementResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldPlacementResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldPlacementResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_response_data.py b/rootly_sdk/models/form_field_placement_response_data.py index c36d8782..8e7330b2 100644 --- a/rootly_sdk/models/form_field_placement_response_data.py +++ b/rootly_sdk/models/form_field_placement_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementResponseData: id: str type_: FormFieldPlacementResponseDataType - attributes: FormFieldPlacement + attributes: "FormFieldPlacement" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_position.py b/rootly_sdk/models/form_field_position.py index 88003c9f..4531afd2 100644 --- a/rootly_sdk/models/form_field_position.py +++ b/rootly_sdk/models/form_field_position.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/form_field_position_form.py b/rootly_sdk/models/form_field_position_form.py index 8b1043f4..8e148b0f 100644 --- a/rootly_sdk/models/form_field_position_form.py +++ b/rootly_sdk/models/form_field_position_form.py @@ -8,6 +8,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -18,6 +19,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", ] @@ -30,6 +32,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -40,6 +43,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", } diff --git a/rootly_sdk/models/form_field_position_list.py b/rootly_sdk/models/form_field_position_list.py index 6acf4d07..2b2b0ecf 100644 --- a/rootly_sdk/models/form_field_position_list.py +++ b/rootly_sdk/models/form_field_position_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormFieldPositionList: """ Attributes: - data (list[FormFieldPositionListDataItem]): + data (list['FormFieldPositionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldPositionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldPositionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_position_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_position_list_data_item.py b/rootly_sdk/models/form_field_position_list_data_item.py index e0c0a026..9678c8c9 100644 --- a/rootly_sdk/models/form_field_position_list_data_item.py +++ b/rootly_sdk/models/form_field_position_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPositionListDataItem: id: str type_: FormFieldPositionListDataItemType - attributes: FormFieldPosition + attributes: "FormFieldPosition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_position_response.py b/rootly_sdk/models/form_field_position_response.py index 5fbc79a2..ae3d2a61 100644 --- a/rootly_sdk/models/form_field_position_response.py +++ b/rootly_sdk/models/form_field_position_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormFieldPositionResponse: """ Attributes: data (FormFieldPositionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldPositionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldPositionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldPositionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_position_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_position_response_data.py b/rootly_sdk/models/form_field_position_response_data.py index d1e206d9..6bb51c2d 100644 --- a/rootly_sdk/models/form_field_position_response_data.py +++ b/rootly_sdk/models/form_field_position_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPositionResponseData: id: str type_: FormFieldPositionResponseDataType - attributes: FormFieldPosition + attributes: "FormFieldPosition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_resource_type.py b/rootly_sdk/models/form_field_resource_type.py new file mode 100644 index 00000000..241d6b76 --- /dev/null +++ b/rootly_sdk/models/form_field_resource_type.py @@ -0,0 +1,16 @@ +from typing import Literal, cast + +FormFieldResourceType = Literal["incident", "problem"] + +FORM_FIELD_RESOURCE_TYPE_VALUES: set[FormFieldResourceType] = { + "incident", + "problem", +} + + +def check_form_field_resource_type(value: str | None) -> FormFieldResourceType | None: + if value is None: + return None + if value in FORM_FIELD_RESOURCE_TYPE_VALUES: + return cast(FormFieldResourceType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_RESOURCE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_response.py b/rootly_sdk/models/form_field_response.py index f84e4bb3..3bdf968b 100644 --- a/rootly_sdk/models/form_field_response.py +++ b/rootly_sdk/models/form_field_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormFieldResponse: """ Attributes: data (FormFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_response_data.py b/rootly_sdk/models/form_field_response_data.py index 00a95f7a..78ddd119 100644 --- a/rootly_sdk/models/form_field_response_data.py +++ b/rootly_sdk/models/form_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormFieldResponseData: id: str type_: FormFieldResponseDataType - attributes: FormField + attributes: "FormField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set.py b/rootly_sdk/models/form_set.py index 4800d2d5..bfa1ffaa 100644 --- a/rootly_sdk/models/form_set.py +++ b/rootly_sdk/models/form_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,10 +21,11 @@ class FormSet: `web_scheduled_incident_form`, `web_update_scheduled_incident_form`, `slack_new_incident_form`, `slack_update_incident_form`, `slack_update_incident_status_form`, `slack_incident_mitigation_form`, `slack_incident_resolution_form`, `slack_incident_cancellation_form`, `slack_scheduled_incident_form`, - `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form` + `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form`, + `microsoft_teams_new_incident_form` created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the form set + slug (Union[Unset, str]): The slug of the form set """ name: str @@ -34,7 +33,7 @@ class FormSet: forms: list[str] created_at: str updated_at: str - slug: str | Unset = UNSET + slug: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/form_set_condition.py b/rootly_sdk/models/form_set_condition.py index 571f0ed8..e7bc4fd2 100644 --- a/rootly_sdk/models/form_set_condition.py +++ b/rootly_sdk/models/form_set_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/form_set_condition_list.py b/rootly_sdk/models/form_set_condition_list.py index 427a6913..8d87b92e 100644 --- a/rootly_sdk/models/form_set_condition_list.py +++ b/rootly_sdk/models/form_set_condition_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormSetConditionList: """ Attributes: - data (list[FormSetConditionListDataItem]): + data (list['FormSetConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormSetConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormSetConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_condition_list = cls( data=data, diff --git a/rootly_sdk/models/form_set_condition_list_data_item.py b/rootly_sdk/models/form_set_condition_list_data_item.py index 4e33ff01..01a1392e 100644 --- a/rootly_sdk/models/form_set_condition_list_data_item.py +++ b/rootly_sdk/models/form_set_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormSetConditionListDataItem: id: str type_: FormSetConditionListDataItemType - attributes: FormSetCondition + attributes: "FormSetCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set_condition_response.py b/rootly_sdk/models/form_set_condition_response.py index d2e7b00a..2534ba03 100644 --- a/rootly_sdk/models/form_set_condition_response.py +++ b/rootly_sdk/models/form_set_condition_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormSetConditionResponse: """ Attributes: data (FormSetConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormSetConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormSetConditionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormSetConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_condition_response = cls( data=data, diff --git a/rootly_sdk/models/form_set_condition_response_data.py b/rootly_sdk/models/form_set_condition_response_data.py index 37053a7c..6e721c80 100644 --- a/rootly_sdk/models/form_set_condition_response_data.py +++ b/rootly_sdk/models/form_set_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormSetConditionResponseData: id: str type_: FormSetConditionResponseDataType - attributes: FormSetCondition + attributes: "FormSetCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set_list.py b/rootly_sdk/models/form_set_list.py index 451c198c..cd9fdf90 100644 --- a/rootly_sdk/models/form_set_list.py +++ b/rootly_sdk/models/form_set_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FormSetList: """ Attributes: - data (list[FormSetListDataItem]): + data (list['FormSetListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormSetListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormSetListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_list = cls( data=data, diff --git a/rootly_sdk/models/form_set_list_data_item.py b/rootly_sdk/models/form_set_list_data_item.py index 21ac0f95..783ebe8c 100644 --- a/rootly_sdk/models/form_set_list_data_item.py +++ b/rootly_sdk/models/form_set_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormSetListDataItem: id: str type_: FormSetListDataItemType - attributes: FormSet + attributes: "FormSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set_response.py b/rootly_sdk/models/form_set_response.py index a8cd8b95..318e9a40 100644 --- a/rootly_sdk/models/form_set_response.py +++ b/rootly_sdk/models/form_set_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FormSetResponse: """ Attributes: data (FormSetResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormSetResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormSetResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormSetResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_response = cls( data=data, diff --git a/rootly_sdk/models/form_set_response_data.py b/rootly_sdk/models/form_set_response_data.py index 9c7d1e8e..3e6f4e46 100644 --- a/rootly_sdk/models/form_set_response_data.py +++ b/rootly_sdk/models/form_set_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormSetResponseData: id: str type_: FormSetResponseDataType - attributes: FormSet + attributes: "FormSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/functionality.py b/rootly_sdk/models/functionality.py index 5c5f97c0..3bb6db57 100644 --- a/rootly_sdk/models/functionality.py +++ b/rootly_sdk/models/functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,64 +23,63 @@ class Functionality: name (str): The name of the functionality created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the functionality - managed_by (FunctionalityManagedBy | Unset): How this functionality is managed (provenance): web, api, + slug (Union[Unset, str]): The slug of the functionality + managed_by (Union[Unset, FunctionalityManagedBy]): How this functionality is managed (provenance): web, api, terraform, etc. Read-only. - description (None | str | Unset): The description of the functionality - public_description (None | str | Unset): The public description of the functionality - notify_emails (list[str] | None | Unset): Emails attached to the functionality - color (None | str | Unset): The hex color of the functionality - backstage_id (None | str | Unset): The Backstage entity id associated to this functionality. eg: + description (Union[None, Unset, str]): The description of the functionality + public_description (Union[None, Unset, str]): The status page description of the functionality + notify_emails (Union[None, Unset, list[str]]): Emails attached to the functionality + color (Union[None, Unset, str]): The hex color of the functionality + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this functionality - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this functionality - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this functionality - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this functionality - cortex_id (None | str | Unset): The Cortex group id associated to this functionality - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this functionality - position (int | None | Unset): Position of the functionality - environment_ids (list[str] | None | Unset): Environments associated with this functionality - service_ids (list[str] | None | Unset): Services associated with this functionality - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this functionality - owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality - escalation_policy_id (None | str | Unset): The escalation policy id of the functionality - slack_channels (list[FunctionalitySlackChannelsType0Item] | None | Unset): Slack Channels associated with this - functionality - slack_aliases (list[FunctionalitySlackAliasesType0Item] | None | Unset): Slack Aliases associated with this - functionality - properties (list[FunctionalityPropertiesType0Item] | None | Unset): Array of property values for this + external_id (Union[None, Unset, str]): The external id associated to this functionality + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this functionality + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this functionality + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this functionality + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this functionality + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this functionality + position (Union[None, Unset, int]): Position of the functionality + environment_ids (Union[None, Unset, list[str]]): Environments associated with this functionality + service_ids (Union[None, Unset, list[str]]): Services associated with this functionality + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this functionality + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this functionality + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the functionality + slack_channels (Union[None, Unset, list['FunctionalitySlackChannelsType0Item']]): Slack Channels associated with + this functionality + slack_aliases (Union[None, Unset, list['FunctionalitySlackAliasesType0Item']]): Slack Aliases associated with + this functionality + properties (Union[None, Unset, list['FunctionalityPropertiesType0Item']]): Array of property values for this functionality. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: FunctionalityManagedBy | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[FunctionalitySlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[FunctionalitySlackAliasesType0Item] | None | Unset = UNSET - properties: list[FunctionalityPropertiesType0Item] | None | Unset = UNSET + slug: Unset | str = UNSET + managed_by: Unset | FunctionalityManagedBy = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["FunctionalitySlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["FunctionalitySlackAliasesType0Item"] = UNSET + properties: None | Unset | list["FunctionalityPropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -91,23 +88,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -116,61 +113,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -179,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -188,7 +185,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -197,7 +194,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -206,13 +203,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | str | Unset + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -224,7 +221,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -236,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | None | Unset + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -320,31 +317,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: FunctionalityManagedBy | Unset + managed_by: Unset | FunctionalityManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_functionality_managed_by(_managed_by) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -355,94 +352,94 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -453,13 +450,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -470,13 +467,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -487,13 +484,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -504,22 +501,22 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels(data: object) -> list[FunctionalitySlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> None | Unset | list["FunctionalitySlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -537,13 +534,13 @@ def _parse_slack_channels(data: object) -> list[FunctionalitySlackChannelsType0I slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalitySlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["FunctionalitySlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[FunctionalitySlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> None | Unset | list["FunctionalitySlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -561,13 +558,13 @@ def _parse_slack_aliases(data: object) -> list[FunctionalitySlackAliasesType0Ite slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalitySlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["FunctionalitySlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> list[FunctionalityPropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> None | Unset | list["FunctionalityPropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -583,9 +580,9 @@ def _parse_properties(data: object) -> list[FunctionalityPropertiesType0Item] | properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalityPropertiesType0Item] | None | Unset, data) + return cast(None | Unset | list["FunctionalityPropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/functionality_list.py b/rootly_sdk/models/functionality_list.py index fbc1c27f..7f3dfca7 100644 --- a/rootly_sdk/models/functionality_list.py +++ b/rootly_sdk/models/functionality_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class FunctionalityList: """ Attributes: - data (list[FunctionalityListDataItem]): + data (list['FunctionalityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FunctionalityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FunctionalityListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) functionality_list = cls( data=data, diff --git a/rootly_sdk/models/functionality_list_data_item.py b/rootly_sdk/models/functionality_list_data_item.py index df02f6b2..891c5842 100644 --- a/rootly_sdk/models/functionality_list_data_item.py +++ b/rootly_sdk/models/functionality_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FunctionalityListDataItem: id: str type_: FunctionalityListDataItemType - attributes: Functionality + attributes: "Functionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/functionality_properties_type_0_item.py b/rootly_sdk/models/functionality_properties_type_0_item.py index 6bcb6048..bb12ff07 100644 --- a/rootly_sdk/models/functionality_properties_type_0_item.py +++ b/rootly_sdk/models/functionality_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/functionality_response.py b/rootly_sdk/models/functionality_response.py index 87433a01..6cbeba67 100644 --- a/rootly_sdk/models/functionality_response.py +++ b/rootly_sdk/models/functionality_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class FunctionalityResponse: """ Attributes: data (FunctionalityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FunctionalityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FunctionalityResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FunctionalityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) functionality_response = cls( data=data, diff --git a/rootly_sdk/models/functionality_response_data.py b/rootly_sdk/models/functionality_response_data.py index cd1b0087..1248604a 100644 --- a/rootly_sdk/models/functionality_response_data.py +++ b/rootly_sdk/models/functionality_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FunctionalityResponseData: id: str type_: FunctionalityResponseDataType - attributes: Functionality + attributes: "Functionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/functionality_slack_aliases_type_0_item.py b/rootly_sdk/models/functionality_slack_aliases_type_0_item.py index d9afc31f..63a4d598 100644 --- a/rootly_sdk/models/functionality_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/functionality_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/functionality_slack_channels_type_0_item.py b/rootly_sdk/models/functionality_slack_channels_type_0_item.py index f2ee6b04..50b4ae69 100644 --- a/rootly_sdk/models/functionality_slack_channels_type_0_item.py +++ b/rootly_sdk/models/functionality_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/get_alerts_task_params.py b/rootly_sdk/models/get_alerts_task_params.py index ed386b43..22f9f5da 100644 --- a/rootly_sdk/models/get_alerts_task_params.py +++ b/rootly_sdk/models/get_alerts_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,53 +24,52 @@ class GetAlertsTaskParams: Attributes: past_duration (str): How far back to fetch commits (in format '1 minute', '30 days', '3 months', etc.) Example: 1 hour. - task_type (GetAlertsTaskParamsTaskType | Unset): - service_ids (list[str] | Unset): - environment_ids (list[str] | Unset): - labels (list[str] | Unset): - sources (list[str] | Unset): - services_impacted_by_incident (bool | Unset): - environments_impacted_by_incident (bool | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[GetAlertsTaskParamsPostToSlackChannelsItem] | Unset): - parent_message_thread_task (GetAlertsTaskParamsParentMessageThreadTask | Unset): A hash where [id] is the task - id of the parent task that sent a message, and [name] is the name of the parent task + task_type (Union[Unset, GetAlertsTaskParamsTaskType]): + service_ids (Union[Unset, list[str]]): + environment_ids (Union[Unset, list[str]]): + labels (Union[Unset, list[str]]): + sources (Union[Unset, list[str]]): + services_impacted_by_incident (Union[Unset, bool]): + environments_impacted_by_incident (Union[Unset, bool]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['GetAlertsTaskParamsPostToSlackChannelsItem']]): + parent_message_thread_task (Union[Unset, GetAlertsTaskParamsParentMessageThreadTask]): A hash where [id] is the + task id of the parent task that sent a message, and [name] is the name of the parent task """ past_duration: str - task_type: GetAlertsTaskParamsTaskType | Unset = UNSET - service_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - labels: list[str] | Unset = UNSET - sources: list[str] | Unset = UNSET - services_impacted_by_incident: bool | Unset = UNSET - environments_impacted_by_incident: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[GetAlertsTaskParamsPostToSlackChannelsItem] | Unset = UNSET - parent_message_thread_task: GetAlertsTaskParamsParentMessageThreadTask | Unset = UNSET + task_type: Unset | GetAlertsTaskParamsTaskType = UNSET + service_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + labels: Unset | list[str] = UNSET + sources: Unset | list[str] = UNSET + services_impacted_by_incident: Unset | bool = UNSET + environments_impacted_by_incident: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["GetAlertsTaskParamsPostToSlackChannelsItem"] = UNSET + parent_message_thread_task: Union[Unset, "GetAlertsTaskParamsParentMessageThreadTask"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - past_duration = self.past_duration - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: list[str] | Unset = UNSET + labels: Unset | list[str] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - sources: list[str] | Unset = UNSET + sources: Unset | list[str] = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -82,14 +79,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: post_to_slack_channels_item = post_to_slack_channels_item_data.to_dict() post_to_slack_channels.append(post_to_slack_channels_item) - parent_message_thread_task: dict[str, Any] | Unset = UNSET + parent_message_thread_task: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -136,7 +133,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: GetAlertsTaskParamsTaskType | Unset + task_type: Unset | GetAlertsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -156,19 +153,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[GetAlertsTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = GetAlertsTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = GetAlertsTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) _parent_message_thread_task = d.pop("parent_message_thread_task", UNSET) - parent_message_thread_task: GetAlertsTaskParamsParentMessageThreadTask | Unset + parent_message_thread_task: Unset | GetAlertsTaskParamsParentMessageThreadTask if isinstance(_parent_message_thread_task, Unset): parent_message_thread_task = UNSET else: diff --git a/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py b/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py index 1f009e1e..9b7c21dc 100644 --- a/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py +++ b/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class GetAlertsTaskParamsParentMessageThreadTask: """A hash where [id] is the task id of the parent task that sent a message, and [name] is the name of the parent task Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py index e4d3b93b..cf579af1 100644 --- a/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class GetAlertsTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_github_commits_task_params_type_0.py b/rootly_sdk/models/get_github_commits_task_params_type_0.py index 06c5ef0e..30772304 100644 --- a/rootly_sdk/models/get_github_commits_task_params_type_0.py +++ b/rootly_sdk/models/get_github_commits_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_github_commits_task_params_type_1.py b/rootly_sdk/models/get_github_commits_task_params_type_1.py index 76dedc3e..8d483d51 100644 --- a/rootly_sdk/models/get_github_commits_task_params_type_1.py +++ b/rootly_sdk/models/get_github_commits_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py b/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py index b4ead582..8063d061 100644 --- a/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py +++ b/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py b/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py index dac35eb7..842037ca 100644 --- a/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py +++ b/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_pulses_task_params.py b/rootly_sdk/models/get_pulses_task_params.py index 9587716c..7db72bae 100644 --- a/rootly_sdk/models/get_pulses_task_params.py +++ b/rootly_sdk/models/get_pulses_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,59 +24,58 @@ class GetPulsesTaskParams: Attributes: past_duration (str): How far back to fetch commits (in format '1 minute', '30 days', '3 months', etc.) Example: 1 hour. - task_type (GetPulsesTaskParamsTaskType | Unset): - service_ids (list[str] | Unset): - environment_ids (list[str] | Unset): - labels (list[str] | Unset): - refs (list[str] | Unset): - sources (list[str] | Unset): - services_impacted_by_incident (bool | Unset): - environments_impacted_by_incident (bool | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[GetPulsesTaskParamsPostToSlackChannelsItem] | Unset): - parent_message_thread_task (GetPulsesTaskParamsParentMessageThreadTask | Unset): A hash where [id] is the task - id of the parent task that sent a message, and [name] is the name of the parent task + task_type (Union[Unset, GetPulsesTaskParamsTaskType]): + service_ids (Union[Unset, list[str]]): + environment_ids (Union[Unset, list[str]]): + labels (Union[Unset, list[str]]): + refs (Union[Unset, list[str]]): + sources (Union[Unset, list[str]]): + services_impacted_by_incident (Union[Unset, bool]): + environments_impacted_by_incident (Union[Unset, bool]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['GetPulsesTaskParamsPostToSlackChannelsItem']]): + parent_message_thread_task (Union[Unset, GetPulsesTaskParamsParentMessageThreadTask]): A hash where [id] is the + task id of the parent task that sent a message, and [name] is the name of the parent task """ past_duration: str - task_type: GetPulsesTaskParamsTaskType | Unset = UNSET - service_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - labels: list[str] | Unset = UNSET - refs: list[str] | Unset = UNSET - sources: list[str] | Unset = UNSET - services_impacted_by_incident: bool | Unset = UNSET - environments_impacted_by_incident: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[GetPulsesTaskParamsPostToSlackChannelsItem] | Unset = UNSET - parent_message_thread_task: GetPulsesTaskParamsParentMessageThreadTask | Unset = UNSET + task_type: Unset | GetPulsesTaskParamsTaskType = UNSET + service_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + labels: Unset | list[str] = UNSET + refs: Unset | list[str] = UNSET + sources: Unset | list[str] = UNSET + services_impacted_by_incident: Unset | bool = UNSET + environments_impacted_by_incident: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["GetPulsesTaskParamsPostToSlackChannelsItem"] = UNSET + parent_message_thread_task: Union[Unset, "GetPulsesTaskParamsParentMessageThreadTask"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - past_duration = self.past_duration - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: list[str] | Unset = UNSET + labels: Unset | list[str] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - refs: list[str] | Unset = UNSET + refs: Unset | list[str] = UNSET if not isinstance(self.refs, Unset): refs = self.refs - sources: list[str] | Unset = UNSET + sources: Unset | list[str] = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -88,14 +85,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: post_to_slack_channels_item = post_to_slack_channels_item_data.to_dict() post_to_slack_channels.append(post_to_slack_channels_item) - parent_message_thread_task: dict[str, Any] | Unset = UNSET + parent_message_thread_task: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -144,7 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: GetPulsesTaskParamsTaskType | Unset + task_type: Unset | GetPulsesTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -166,19 +163,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[GetPulsesTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = GetPulsesTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = GetPulsesTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) _parent_message_thread_task = d.pop("parent_message_thread_task", UNSET) - parent_message_thread_task: GetPulsesTaskParamsParentMessageThreadTask | Unset + parent_message_thread_task: Unset | GetPulsesTaskParamsParentMessageThreadTask if isinstance(_parent_message_thread_task, Unset): parent_message_thread_task = UNSET else: diff --git a/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py b/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py index 217e26b1..09881017 100644 --- a/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py +++ b/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class GetPulsesTaskParamsParentMessageThreadTask: """A hash where [id] is the task id of the parent task that sent a message, and [name] is the name of the parent task Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py index 022888dc..17ab4fa8 100644 --- a/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class GetPulsesTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/heartbeat.py b/rootly_sdk/models/heartbeat.py index 43738654..3a8716a8 100644 --- a/rootly_sdk/models/heartbeat.py +++ b/rootly_sdk/models/heartbeat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -33,14 +31,15 @@ class Heartbeat: email_address (str): Email address to receive heartbeat pings. created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of the heartbeat - alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires. - alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires. - owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat - ping_url (None | str | Unset): URL to receive heartbeat pings. - secret (None | str | Unset): Secret used as bearer token when pinging heartbeat. - last_pinged_at (None | str | Unset): When the heartbeat was last pinged. - expires_at (None | str | Unset): When heartbeat expires + description (Union[None, Unset, str]): The description of the heartbeat + alert_description (Union[None, Unset, str]): Description of alerts triggered when heartbeat expires. + alert_urgency_id (Union[None, Unset, str]): Urgency of alerts triggered when heartbeat expires. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that own this heartbeat + ping_url (Union[None, Unset, str]): URL to receive heartbeat pings. + secret (Union[None, Unset, str]): Secret used as bearer token when pinging heartbeat. + last_pinged_at (Union[None, Unset, str]): Last persisted heartbeat ping timestamp. Accepted pings may be + coalesced for up to 30 seconds. + expires_at (Union[None, Unset, str]): Persisted expiry deadline, including up to 30 seconds of coalescing grace. """ name: str @@ -54,14 +53,14 @@ class Heartbeat: email_address: str created_at: str updated_at: str - description: None | str | Unset = UNSET - alert_description: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - ping_url: None | str | Unset = UNSET - secret: None | str | Unset = UNSET - last_pinged_at: None | str | Unset = UNSET - expires_at: None | str | Unset = UNSET + description: None | Unset | str = UNSET + alert_description: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + ping_url: None | Unset | str = UNSET + secret: None | Unset | str = UNSET + last_pinged_at: None | Unset | str = UNSET + expires_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -87,47 +86,47 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: None | str | Unset + alert_description: None | Unset | str if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - ping_url: None | str | Unset + ping_url: None | Unset | str if isinstance(self.ping_url, Unset): ping_url = UNSET else: ping_url = self.ping_url - secret: None | str | Unset + secret: None | Unset | str if isinstance(self.secret, Unset): secret = UNSET else: secret = self.secret - last_pinged_at: None | str | Unset + last_pinged_at: None | Unset | str if isinstance(self.last_pinged_at, Unset): last_pinged_at = UNSET else: last_pinged_at = self.last_pinged_at - expires_at: None | str | Unset + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET else: @@ -194,68 +193,68 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> None | str | Unset: + def _parse_alert_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_ping_url(data: object) -> None | str | Unset: + def _parse_ping_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ping_url = _parse_ping_url(d.pop("ping_url", UNSET)) - def _parse_secret(data: object) -> None | str | Unset: + def _parse_secret(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) secret = _parse_secret(d.pop("secret", UNSET)) - def _parse_last_pinged_at(data: object) -> None | str | Unset: + def _parse_last_pinged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_pinged_at = _parse_last_pinged_at(d.pop("last_pinged_at", UNSET)) - def _parse_expires_at(data: object) -> None | str | Unset: + def _parse_expires_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/heartbeat_list.py b/rootly_sdk/models/heartbeat_list.py index 1253d2f0..85d81821 100644 --- a/rootly_sdk/models/heartbeat_list.py +++ b/rootly_sdk/models/heartbeat_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class HeartbeatList: """ Attributes: - data (list[HeartbeatListDataItem]): + data (list['HeartbeatListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[HeartbeatListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["HeartbeatListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) heartbeat_list = cls( data=data, diff --git a/rootly_sdk/models/heartbeat_list_data_item.py b/rootly_sdk/models/heartbeat_list_data_item.py index 05cec67e..dbcb529f 100644 --- a/rootly_sdk/models/heartbeat_list_data_item.py +++ b/rootly_sdk/models/heartbeat_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class HeartbeatListDataItem: id: str type_: HeartbeatListDataItemType - attributes: Heartbeat + attributes: "Heartbeat" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/heartbeat_response.py b/rootly_sdk/models/heartbeat_response.py index 46bc93e1..f914eac7 100644 --- a/rootly_sdk/models/heartbeat_response.py +++ b/rootly_sdk/models/heartbeat_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class HeartbeatResponse: """ Attributes: data (HeartbeatResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: HeartbeatResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "HeartbeatResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = HeartbeatResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) heartbeat_response = cls( data=data, diff --git a/rootly_sdk/models/heartbeat_response_data.py b/rootly_sdk/models/heartbeat_response_data.py index 59c3a427..a8cdd593 100644 --- a/rootly_sdk/models/heartbeat_response_data.py +++ b/rootly_sdk/models/heartbeat_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class HeartbeatResponseData: id: str type_: HeartbeatResponseDataType - attributes: Heartbeat + attributes: "Heartbeat" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/http_client_task_params.py b/rootly_sdk/models/http_client_task_params.py index 69e1619d..6ed518b8 100644 --- a/rootly_sdk/models/http_client_task_params.py +++ b/rootly_sdk/models/http_client_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,43 +25,42 @@ class HttpClientTaskParams: url (str): URL endpoint Example: https://example.com/foo.json. succeed_on_status (str): HTTP status code expected. Can be a regular expression. Eg: 200, 200|203, 20[0-3] Example: 200. - task_type (HttpClientTaskParamsTaskType | Unset): - headers (str | Unset): JSON map of HTTP headers - params (str | Unset): JSON map of HTTP query parameters - body (str | Unset): HTTP body - event_url (str | Unset): - event_message (str | Unset): - method (HttpClientTaskParamsMethod | Unset): HTTP method Default: 'GET'. - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[HttpClientTaskParamsPostToSlackChannelsItem] | Unset): - retry_count (int | Unset): Number of times to retry on HTTP 429 responses (0-4). 0 disables retry. Default: 0. - Example: 3. - retry_wait_time (int | Unset): Seconds to wait before each retry (1-15). Retry-After header is honored when - present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. + task_type (Union[Unset, HttpClientTaskParamsTaskType]): + headers (Union[Unset, str]): JSON map of HTTP headers + params (Union[Unset, str]): JSON map of HTTP query parameters + body (Union[Unset, str]): HTTP body + event_url (Union[Unset, str]): + event_message (Union[Unset, str]): + method (Union[Unset, HttpClientTaskParamsMethod]): HTTP method Default: 'GET'. + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['HttpClientTaskParamsPostToSlackChannelsItem']]): + retry_count (Union[Unset, int]): Number of times to retry on HTTP 429 responses (0-4). 0 disables retry. + Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ url: str succeed_on_status: str - task_type: HttpClientTaskParamsTaskType | Unset = UNSET - headers: str | Unset = UNSET - params: str | Unset = UNSET - body: str | Unset = UNSET - event_url: str | Unset = UNSET - event_message: str | Unset = UNSET - method: HttpClientTaskParamsMethod | Unset = "GET" - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[HttpClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET - retry_count: int | Unset = 0 - retry_wait_time: int | Unset = 1 + task_type: Unset | HttpClientTaskParamsTaskType = UNSET + headers: Unset | str = UNSET + params: Unset | str = UNSET + body: Unset | str = UNSET + event_url: Unset | str = UNSET + event_message: Unset | str = UNSET + method: Unset | HttpClientTaskParamsMethod = "GET" + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["HttpClientTaskParamsPostToSlackChannelsItem"] = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - url = self.url succeed_on_status = self.succeed_on_status - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -77,13 +74,13 @@ def to_dict(self) -> dict[str, Any]: event_message = self.event_message - method: str | Unset = UNSET + method: Unset | str = UNSET if not isinstance(self.method, Unset): method = self.method post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -139,7 +136,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: succeed_on_status = d.pop("succeed_on_status") _task_type = d.pop("task_type", UNSET) - task_type: HttpClientTaskParamsTaskType | Unset + task_type: Unset | HttpClientTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -156,7 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_message = d.pop("event_message", UNSET) _method = d.pop("method", UNSET) - method: HttpClientTaskParamsMethod | Unset + method: Unset | HttpClientTaskParamsMethod if isinstance(_method, Unset): method = UNSET else: @@ -164,16 +161,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[HttpClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = HttpClientTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = HttpClientTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) retry_count = d.pop("retry_count", UNSET) diff --git a/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py index 642bc030..619d65ed 100644 --- a/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class HttpClientTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/import_meeting_recording.py b/rootly_sdk/models/import_meeting_recording.py index fb318d24..9b3c6214 100644 --- a/rootly_sdk/models/import_meeting_recording.py +++ b/rootly_sdk/models/import_meeting_recording.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,17 +24,17 @@ class ImportMeetingRecording: source (ImportMeetingRecordingSource): Import source (currently only "recall_desktop_sdk") recall_recording_id (UUID): External recording UUID (required when source is recall_desktop_sdk) platform (ImportMeetingRecordingPlatform): Meeting platform - started_at (datetime.datetime | None | Unset): When the recording started - ended_at (datetime.datetime | None | Unset): When the recording ended - meeting_url (None | str | Unset): Original meeting URL + started_at (Union[None, Unset, datetime.datetime]): When the recording started + ended_at (Union[None, Unset, datetime.datetime]): When the recording ended + meeting_url (Union[None, Unset, str]): Original meeting URL """ source: ImportMeetingRecordingSource recall_recording_id: UUID platform: ImportMeetingRecordingPlatform - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - meeting_url: None | str | Unset = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + meeting_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: platform: str = self.platform - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -54,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - meeting_url: None | str | Unset + meeting_url: None | Unset | str if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: @@ -95,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: platform = check_import_meeting_recording_platform(d.pop("platform")) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -106,13 +104,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -123,18 +121,18 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_meeting_url(data: object) -> None | str | Unset: + def _parse_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) diff --git a/rootly_sdk/models/in_triage_incident.py b/rootly_sdk/models/in_triage_incident.py index bd1a66ca..e6689084 100644 --- a/rootly_sdk/models/in_triage_incident.py +++ b/rootly_sdk/models/in_triage_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class InTriageIncident: data (InTriageIncidentData): """ - data: InTriageIncidentData + data: "InTriageIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/in_triage_incident_data.py b/rootly_sdk/models/in_triage_incident_data.py index 7b9e4f40..3ff763ca 100644 --- a/rootly_sdk/models/in_triage_incident_data.py +++ b/rootly_sdk/models/in_triage_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident.py b/rootly_sdk/models/incident.py index 408a7e53..ee5817ae 100644 --- a/rootly_sdk/models/incident.py +++ b/rootly_sdk/models/incident.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -42,279 +40,279 @@ class Incident: title (str): The title of the incident created_at (str): Date of creation updated_at (str): Date of last update - id (str | Unset): Unique ID of the incident - sequential_id (int | Unset): Sequential ID of the incident - kind (str | Unset): The kind of the incident - slug (str | Unset): The slug of the incident - parent_incident_id (None | str | Unset): ID of parent incident - duplicate_incident_id (None | str | Unset): ID of duplicated incident - summary (None | str | Unset): The summary of the incident - private (bool | Unset): The visibility of the incident Default: False. - source (None | str | Unset): The source of the incident - status (None | str | Unset): The status of the incident - url (None | str | Unset): The url to the incident - short_url (None | str | Unset): The short url to the incident - public_title (None | str | Unset): The public title of the incident - user (IncidentUserType0 | None | Unset): The user who created the incident - severity (SeverityResponse | Unset): - environments (list[EnvironmentResponse] | None | Unset): The Environments of the incident - incident_types (list[IncidentTypeResponse] | None | Unset): The Incident Types of the incident - services (list[ServiceResponse] | None | Unset): The Services of the incident - functionalities (list[FunctionalityResponse] | None | Unset): The Functionalities of the incident - groups (list[TeamResponse] | None | Unset): The Teams of to the incident - labels (IncidentLabelsType0 | None | Unset): Labels to attach to the incidents. eg: {"platform":"osx", + id (Union[Unset, str]): Unique ID of the incident + sequential_id (Union[Unset, int]): Sequential ID of the incident + kind (Union[Unset, str]): The kind of the incident + slug (Union[Unset, str]): The slug of the incident + parent_incident_id (Union[None, Unset, str]): ID of parent incident + duplicate_incident_id (Union[None, Unset, str]): ID of duplicated incident + summary (Union[None, Unset, str]): The summary of the incident + private (Union[Unset, bool]): The visibility of the incident Default: False. + source (Union[None, Unset, str]): The source of the incident + status (Union[None, Unset, str]): The status of the incident + url (Union[None, Unset, str]): The url to the incident + short_url (Union[None, Unset, str]): The short url to the incident + public_title (Union[None, Unset, str]): The public title of the incident + user (Union['IncidentUserType0', None, Unset]): The user who created the incident + severity (Union[Unset, SeverityResponse]): + environments (Union[None, Unset, list['EnvironmentResponse']]): The Environments of the incident + incident_types (Union[None, Unset, list['IncidentTypeResponse']]): The Incident Types of the incident + services (Union[None, Unset, list['ServiceResponse']]): The Services of the incident + functionalities (Union[None, Unset, list['FunctionalityResponse']]): The Functionalities of the incident + groups (Union[None, Unset, list['TeamResponse']]): The Teams of to the incident + labels (Union['IncidentLabelsType0', None, Unset]): Labels to attach to the incidents. eg: {"platform":"osx", "version": "1.29"} - slack_channel_id (None | str | Unset): Slack channel id - slack_channel_name (None | str | Unset): Slack channel name - slack_channel_url (None | str | Unset): Slack channel url - slack_channel_short_url (None | str | Unset): Slack channel short url - slack_channel_deep_link (None | str | Unset): Slack channel deep link - slack_channel_archived (bool | None | Unset): Whether the Slack channel is archived - slack_last_message_ts (None | str | Unset): Timestamp of last Slack message - zoom_meeting_id (None | str | Unset): Zoom meeting ID - zoom_meeting_start_url (None | str | Unset): Zoom meeting start URL - zoom_meeting_join_url (None | str | Unset): Zoom meeting join URL - zoom_meeting_password (None | str | Unset): Zoom meeting password - zoom_meeting_pstn_password (None | str | Unset): Zoom meeting PSTN password - zoom_meeting_h323_password (None | str | Unset): Zoom meeting H323 password - zoom_meeting_global_dial_in_numbers (list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset): Zoom - meeting global dial-in numbers - google_drive_id (None | str | Unset): Google Drive document ID - google_drive_parent_id (None | str | Unset): Google Drive parent folder ID - google_drive_url (None | str | Unset): Google Drive URL - google_meeting_id (None | str | Unset): Google meeting ID - google_meeting_url (None | str | Unset): Google meeting URL - microsoft_teams_meeting_id (None | str | Unset): Microsoft Teams meeting ID - microsoft_teams_meeting_url (None | str | Unset): Microsoft Teams meeting URL - microsoft_teams_channel_id (None | str | Unset): Microsoft Teams channel ID - microsoft_teams_channel_name (None | str | Unset): Microsoft Teams channel name - microsoft_teams_channel_url (None | str | Unset): Microsoft Teams channel URL - microsoft_teams_channel_short_url (None | str | Unset): Microsoft Teams channel short URL - microsoft_teams_chat_id (None | str | Unset): Microsoft Teams chat ID - microsoft_teams_chat_url (None | str | Unset): Microsoft Teams chat URL - microsoft_teams_team_id (None | str | Unset): Microsoft Teams team ID - google_chat_space_id (None | str | Unset): Google Chat space ID - google_chat_space_name (None | str | Unset): Google Chat space name - google_chat_space_url (None | str | Unset): Google Chat space URL - google_chat_space_short_url (None | str | Unset): Google Chat space short URL - google_chat_space_archived (bool | None | Unset): Whether the Google Chat space is archived - google_chat_space_domain_id (None | str | Unset): Google Chat space domain ID - webex_meeting_id (None | str | Unset): Webex meeting ID - webex_meeting_url (None | str | Unset): Webex meeting URL - jira_issue_key (None | str | Unset): Jira issue key - jira_issue_id (None | str | Unset): Jira issue ID - jira_issue_url (None | str | Unset): Jira issue URL - github_issue_id (None | str | Unset): GitHub issue ID - github_issue_url (None | str | Unset): GitHub issue URL - gitlab_issue_id (None | str | Unset): GitLab issue ID - gitlab_issue_url (None | str | Unset): GitLab issue URL - asana_task_id (None | str | Unset): Asana task ID - asana_task_url (None | str | Unset): Asana task URL - linear_issue_id (None | str | Unset): Linear issue ID - linear_issue_url (None | str | Unset): Linear issue URL - trello_card_id (None | str | Unset): Trello card ID - trello_card_url (None | str | Unset): Trello card URL - zendesk_ticket_id (None | str | Unset): Zendesk ticket ID - zendesk_ticket_url (None | str | Unset): Zendesk ticket URL - pagerduty_incident_id (None | str | Unset): PagerDuty incident ID - pagerduty_incident_number (None | str | Unset): PagerDuty incident number - pagerduty_incident_url (None | str | Unset): PagerDuty incident URL - opsgenie_incident_id (None | str | Unset): Opsgenie incident ID - opsgenie_incident_url (None | str | Unset): Opsgenie incident URL - opsgenie_alert_id (None | str | Unset): Opsgenie alert ID - opsgenie_alert_url (None | str | Unset): Opsgenie alert URL - service_now_incident_id (None | str | Unset): ServiceNow incident ID - service_now_incident_key (None | str | Unset): ServiceNow incident key - service_now_incident_url (None | str | Unset): ServiceNow incident URL - mattermost_channel_id (None | str | Unset): Mattermost channel ID - mattermost_channel_name (None | str | Unset): Mattermost channel name - mattermost_channel_url (None | str | Unset): Mattermost channel URL - confluence_page_id (None | str | Unset): Confluence page ID - confluence_page_url (None | str | Unset): Confluence page URL - datadog_notebook_id (None | str | Unset): Datadog notebook ID - datadog_notebook_url (None | str | Unset): Datadog notebook URL - shortcut_story_id (None | str | Unset): Shortcut story ID - shortcut_story_url (None | str | Unset): Shortcut story URL - shortcut_task_id (None | str | Unset): Shortcut task ID - shortcut_task_url (None | str | Unset): Shortcut task URL - motion_task_id (None | str | Unset): Motion task ID - motion_task_url (None | str | Unset): Motion task URL - clickup_task_id (None | str | Unset): ClickUp task ID - clickup_task_url (None | str | Unset): ClickUp task URL - victor_ops_incident_id (None | str | Unset): VictorOps incident ID - victor_ops_incident_url (None | str | Unset): VictorOps incident URL - quip_page_id (None | str | Unset): Quip page ID - quip_page_url (None | str | Unset): Quip page URL - sharepoint_page_id (None | str | Unset): SharePoint page ID - sharepoint_page_url (None | str | Unset): SharePoint page URL - airtable_base_key (None | str | Unset): Airtable base key - airtable_table_name (None | str | Unset): Airtable table name - airtable_record_id (None | str | Unset): Airtable record ID - airtable_record_url (None | str | Unset): Airtable record URL - freshservice_ticket_id (None | str | Unset): Freshservice ticket ID - freshservice_ticket_url (None | str | Unset): Freshservice ticket URL - freshservice_task_id (None | str | Unset): Freshservice task ID - freshservice_task_url (None | str | Unset): Freshservice task URL - mitigation_message (None | str | Unset): How was the incident mitigated? - resolution_message (None | str | Unset): How was the incident resolved? - cancellation_message (None | str | Unset): Why was the incident cancelled? - scheduled_for (None | str | Unset): Date of when the maintenance begins - scheduled_until (None | str | Unset): Date of when the maintenance ends - muted_service_ids (list[str] | None | Unset): The Service IDs to mute alerts for during maintenance. Alerts for - these services will still be triggered and attached to the incident, but won't page responders. - retrospective_progress_status (IncidentRetrospectiveProgressStatus | Unset): The status of the retrospective - progress - in_triage_by (IncidentInTriageByType0 | None | Unset): The user who triaged the incident - started_by (IncidentStartedByType0 | None | Unset): The user who started the incident - mitigated_by (IncidentMitigatedByType0 | None | Unset): The user who mitigated the incident - resolved_by (IncidentResolvedByType0 | None | Unset): The user who resolved the incident - closed_by (IncidentClosedByType0 | None | Unset): The user who closed the incident - cancelled_by (IncidentCancelledByType0 | None | Unset): The user who cancelled the incident - in_triage_at (None | str | Unset): Date of triage - started_at (None | str | Unset): Date of start - detected_at (None | str | Unset): Date of detection - acknowledged_at (None | str | Unset): Date of acknowledgment - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - closed_at (None | str | Unset): Date of closure - cancelled_at (None | str | Unset): Date of cancellation + slack_channel_id (Union[None, Unset, str]): Slack channel id + slack_channel_name (Union[None, Unset, str]): Slack channel name + slack_channel_url (Union[None, Unset, str]): Slack channel url + slack_channel_short_url (Union[None, Unset, str]): Slack channel short url + slack_channel_deep_link (Union[None, Unset, str]): Slack channel deep link + slack_channel_archived (Union[None, Unset, bool]): Whether the Slack channel is archived + slack_last_message_ts (Union[None, Unset, str]): Timestamp of last Slack message + zoom_meeting_id (Union[None, Unset, str]): Zoom meeting ID + zoom_meeting_start_url (Union[None, Unset, str]): Zoom meeting start URL + zoom_meeting_join_url (Union[None, Unset, str]): Zoom meeting join URL + zoom_meeting_password (Union[None, Unset, str]): Zoom meeting password + zoom_meeting_pstn_password (Union[None, Unset, str]): Zoom meeting PSTN password + zoom_meeting_h323_password (Union[None, Unset, str]): Zoom meeting H323 password + zoom_meeting_global_dial_in_numbers (Union[None, Unset, + list['IncidentZoomMeetingGlobalDialInNumbersType0Item']]): Zoom meeting global dial-in numbers + google_drive_id (Union[None, Unset, str]): Google Drive document ID + google_drive_parent_id (Union[None, Unset, str]): Google Drive parent folder ID + google_drive_url (Union[None, Unset, str]): Google Drive URL + google_meeting_id (Union[None, Unset, str]): Google meeting ID + google_meeting_url (Union[None, Unset, str]): Google meeting URL + microsoft_teams_meeting_id (Union[None, Unset, str]): Microsoft Teams meeting ID + microsoft_teams_meeting_url (Union[None, Unset, str]): Microsoft Teams meeting URL + microsoft_teams_channel_id (Union[None, Unset, str]): Microsoft Teams channel ID + microsoft_teams_channel_name (Union[None, Unset, str]): Microsoft Teams channel name + microsoft_teams_channel_url (Union[None, Unset, str]): Microsoft Teams channel URL + microsoft_teams_channel_short_url (Union[None, Unset, str]): Microsoft Teams channel short URL + microsoft_teams_chat_id (Union[None, Unset, str]): Microsoft Teams chat ID + microsoft_teams_chat_url (Union[None, Unset, str]): Microsoft Teams chat URL + microsoft_teams_team_id (Union[None, Unset, str]): Microsoft Teams team ID + google_chat_space_id (Union[None, Unset, str]): Google Chat space ID + google_chat_space_name (Union[None, Unset, str]): Google Chat space name + google_chat_space_url (Union[None, Unset, str]): Google Chat space URL + google_chat_space_short_url (Union[None, Unset, str]): Google Chat space short URL + google_chat_space_archived (Union[None, Unset, bool]): Whether the Google Chat space is archived + google_chat_space_domain_id (Union[None, Unset, str]): Google Chat space domain ID + webex_meeting_id (Union[None, Unset, str]): Webex meeting ID + webex_meeting_url (Union[None, Unset, str]): Webex meeting URL + jira_issue_key (Union[None, Unset, str]): Jira issue key + jira_issue_id (Union[None, Unset, str]): Jira issue ID + jira_issue_url (Union[None, Unset, str]): Jira issue URL + github_issue_id (Union[None, Unset, str]): GitHub issue ID + github_issue_url (Union[None, Unset, str]): GitHub issue URL + gitlab_issue_id (Union[None, Unset, str]): GitLab issue ID + gitlab_issue_url (Union[None, Unset, str]): GitLab issue URL + asana_task_id (Union[None, Unset, str]): Asana task ID + asana_task_url (Union[None, Unset, str]): Asana task URL + linear_issue_id (Union[None, Unset, str]): Linear issue ID + linear_issue_url (Union[None, Unset, str]): Linear issue URL + trello_card_id (Union[None, Unset, str]): Trello card ID + trello_card_url (Union[None, Unset, str]): Trello card URL + zendesk_ticket_id (Union[None, Unset, str]): Zendesk ticket ID + zendesk_ticket_url (Union[None, Unset, str]): Zendesk ticket URL + pagerduty_incident_id (Union[None, Unset, str]): PagerDuty incident ID + pagerduty_incident_number (Union[None, Unset, str]): PagerDuty incident number + pagerduty_incident_url (Union[None, Unset, str]): PagerDuty incident URL + opsgenie_incident_id (Union[None, Unset, str]): Opsgenie incident ID + opsgenie_incident_url (Union[None, Unset, str]): Opsgenie incident URL + opsgenie_alert_id (Union[None, Unset, str]): Opsgenie alert ID + opsgenie_alert_url (Union[None, Unset, str]): Opsgenie alert URL + service_now_incident_id (Union[None, Unset, str]): ServiceNow incident ID + service_now_incident_key (Union[None, Unset, str]): ServiceNow incident key + service_now_incident_url (Union[None, Unset, str]): ServiceNow incident URL + mattermost_channel_id (Union[None, Unset, str]): Mattermost channel ID + mattermost_channel_name (Union[None, Unset, str]): Mattermost channel name + mattermost_channel_url (Union[None, Unset, str]): Mattermost channel URL + confluence_page_id (Union[None, Unset, str]): Confluence page ID + confluence_page_url (Union[None, Unset, str]): Confluence page URL + datadog_notebook_id (Union[None, Unset, str]): Datadog notebook ID + datadog_notebook_url (Union[None, Unset, str]): Datadog notebook URL + shortcut_story_id (Union[None, Unset, str]): Shortcut story ID + shortcut_story_url (Union[None, Unset, str]): Shortcut story URL + shortcut_task_id (Union[None, Unset, str]): Shortcut task ID + shortcut_task_url (Union[None, Unset, str]): Shortcut task URL + motion_task_id (Union[None, Unset, str]): Motion task ID + motion_task_url (Union[None, Unset, str]): Motion task URL + clickup_task_id (Union[None, Unset, str]): ClickUp task ID + clickup_task_url (Union[None, Unset, str]): ClickUp task URL + victor_ops_incident_id (Union[None, Unset, str]): VictorOps incident ID + victor_ops_incident_url (Union[None, Unset, str]): VictorOps incident URL + quip_page_id (Union[None, Unset, str]): Quip page ID + quip_page_url (Union[None, Unset, str]): Quip page URL + sharepoint_page_id (Union[None, Unset, str]): SharePoint page ID + sharepoint_page_url (Union[None, Unset, str]): SharePoint page URL + airtable_base_key (Union[None, Unset, str]): Airtable base key + airtable_table_name (Union[None, Unset, str]): Airtable table name + airtable_record_id (Union[None, Unset, str]): Airtable record ID + airtable_record_url (Union[None, Unset, str]): Airtable record URL + freshservice_ticket_id (Union[None, Unset, str]): Freshservice ticket ID + freshservice_ticket_url (Union[None, Unset, str]): Freshservice ticket URL + freshservice_task_id (Union[None, Unset, str]): Freshservice task ID + freshservice_task_url (Union[None, Unset, str]): Freshservice task URL + mitigation_message (Union[None, Unset, str]): How was the incident mitigated? + resolution_message (Union[None, Unset, str]): How was the incident resolved? + cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? + scheduled_for (Union[None, Unset, str]): Date of when the maintenance begins + scheduled_until (Union[None, Unset, str]): Date of when the maintenance ends + muted_service_ids (Union[None, Unset, list[str]]): The Service IDs to mute alerts for during maintenance. Alerts + for these services will still be triggered and attached to the incident, but won't page responders. + retrospective_progress_status (Union[Unset, IncidentRetrospectiveProgressStatus]): The status of the + retrospective progress + in_triage_by (Union['IncidentInTriageByType0', None, Unset]): The user who triaged the incident + started_by (Union['IncidentStartedByType0', None, Unset]): The user who started the incident + mitigated_by (Union['IncidentMitigatedByType0', None, Unset]): The user who mitigated the incident + resolved_by (Union['IncidentResolvedByType0', None, Unset]): The user who resolved the incident + closed_by (Union['IncidentClosedByType0', None, Unset]): The user who closed the incident + cancelled_by (Union['IncidentCancelledByType0', None, Unset]): The user who cancelled the incident + in_triage_at (Union[None, Unset, str]): Date of triage + started_at (Union[None, Unset, str]): Date of start + detected_at (Union[None, Unset, str]): Date of detection + acknowledged_at (Union[None, Unset, str]): Date of acknowledgment + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + closed_at (Union[None, Unset, str]): Date of closure + cancelled_at (Union[None, Unset, str]): Date of cancellation """ title: str created_at: str updated_at: str - id: str | Unset = UNSET - sequential_id: int | Unset = UNSET - kind: str | Unset = UNSET - slug: str | Unset = UNSET - parent_incident_id: None | str | Unset = UNSET - duplicate_incident_id: None | str | Unset = UNSET - summary: None | str | Unset = UNSET - private: bool | Unset = False - source: None | str | Unset = UNSET - status: None | str | Unset = UNSET - url: None | str | Unset = UNSET - short_url: None | str | Unset = UNSET - public_title: None | str | Unset = UNSET - user: IncidentUserType0 | None | Unset = UNSET - severity: SeverityResponse | Unset = UNSET - environments: list[EnvironmentResponse] | None | Unset = UNSET - incident_types: list[IncidentTypeResponse] | None | Unset = UNSET - services: list[ServiceResponse] | None | Unset = UNSET - functionalities: list[FunctionalityResponse] | None | Unset = UNSET - groups: list[TeamResponse] | None | Unset = UNSET - labels: IncidentLabelsType0 | None | Unset = UNSET - slack_channel_id: None | str | Unset = UNSET - slack_channel_name: None | str | Unset = UNSET - slack_channel_url: None | str | Unset = UNSET - slack_channel_short_url: None | str | Unset = UNSET - slack_channel_deep_link: None | str | Unset = UNSET - slack_channel_archived: bool | None | Unset = UNSET - slack_last_message_ts: None | str | Unset = UNSET - zoom_meeting_id: None | str | Unset = UNSET - zoom_meeting_start_url: None | str | Unset = UNSET - zoom_meeting_join_url: None | str | Unset = UNSET - zoom_meeting_password: None | str | Unset = UNSET - zoom_meeting_pstn_password: None | str | Unset = UNSET - zoom_meeting_h323_password: None | str | Unset = UNSET - zoom_meeting_global_dial_in_numbers: list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset = UNSET - google_drive_id: None | str | Unset = UNSET - google_drive_parent_id: None | str | Unset = UNSET - google_drive_url: None | str | Unset = UNSET - google_meeting_id: None | str | Unset = UNSET - google_meeting_url: None | str | Unset = UNSET - microsoft_teams_meeting_id: None | str | Unset = UNSET - microsoft_teams_meeting_url: None | str | Unset = UNSET - microsoft_teams_channel_id: None | str | Unset = UNSET - microsoft_teams_channel_name: None | str | Unset = UNSET - microsoft_teams_channel_url: None | str | Unset = UNSET - microsoft_teams_channel_short_url: None | str | Unset = UNSET - microsoft_teams_chat_id: None | str | Unset = UNSET - microsoft_teams_chat_url: None | str | Unset = UNSET - microsoft_teams_team_id: None | str | Unset = UNSET - google_chat_space_id: None | str | Unset = UNSET - google_chat_space_name: None | str | Unset = UNSET - google_chat_space_url: None | str | Unset = UNSET - google_chat_space_short_url: None | str | Unset = UNSET - google_chat_space_archived: bool | None | Unset = UNSET - google_chat_space_domain_id: None | str | Unset = UNSET - webex_meeting_id: None | str | Unset = UNSET - webex_meeting_url: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - github_issue_id: None | str | Unset = UNSET - github_issue_url: None | str | Unset = UNSET - gitlab_issue_id: None | str | Unset = UNSET - gitlab_issue_url: None | str | Unset = UNSET - asana_task_id: None | str | Unset = UNSET - asana_task_url: None | str | Unset = UNSET - linear_issue_id: None | str | Unset = UNSET - linear_issue_url: None | str | Unset = UNSET - trello_card_id: None | str | Unset = UNSET - trello_card_url: None | str | Unset = UNSET - zendesk_ticket_id: None | str | Unset = UNSET - zendesk_ticket_url: None | str | Unset = UNSET - pagerduty_incident_id: None | str | Unset = UNSET - pagerduty_incident_number: None | str | Unset = UNSET - pagerduty_incident_url: None | str | Unset = UNSET - opsgenie_incident_id: None | str | Unset = UNSET - opsgenie_incident_url: None | str | Unset = UNSET - opsgenie_alert_id: None | str | Unset = UNSET - opsgenie_alert_url: None | str | Unset = UNSET - service_now_incident_id: None | str | Unset = UNSET - service_now_incident_key: None | str | Unset = UNSET - service_now_incident_url: None | str | Unset = UNSET - mattermost_channel_id: None | str | Unset = UNSET - mattermost_channel_name: None | str | Unset = UNSET - mattermost_channel_url: None | str | Unset = UNSET - confluence_page_id: None | str | Unset = UNSET - confluence_page_url: None | str | Unset = UNSET - datadog_notebook_id: None | str | Unset = UNSET - datadog_notebook_url: None | str | Unset = UNSET - shortcut_story_id: None | str | Unset = UNSET - shortcut_story_url: None | str | Unset = UNSET - shortcut_task_id: None | str | Unset = UNSET - shortcut_task_url: None | str | Unset = UNSET - motion_task_id: None | str | Unset = UNSET - motion_task_url: None | str | Unset = UNSET - clickup_task_id: None | str | Unset = UNSET - clickup_task_url: None | str | Unset = UNSET - victor_ops_incident_id: None | str | Unset = UNSET - victor_ops_incident_url: None | str | Unset = UNSET - quip_page_id: None | str | Unset = UNSET - quip_page_url: None | str | Unset = UNSET - sharepoint_page_id: None | str | Unset = UNSET - sharepoint_page_url: None | str | Unset = UNSET - airtable_base_key: None | str | Unset = UNSET - airtable_table_name: None | str | Unset = UNSET - airtable_record_id: None | str | Unset = UNSET - airtable_record_url: None | str | Unset = UNSET - freshservice_ticket_id: None | str | Unset = UNSET - freshservice_ticket_url: None | str | Unset = UNSET - freshservice_task_id: None | str | Unset = UNSET - freshservice_task_url: None | str | Unset = UNSET - mitigation_message: None | str | Unset = UNSET - resolution_message: None | str | Unset = UNSET - cancellation_message: None | str | Unset = UNSET - scheduled_for: None | str | Unset = UNSET - scheduled_until: None | str | Unset = UNSET - muted_service_ids: list[str] | None | Unset = UNSET - retrospective_progress_status: IncidentRetrospectiveProgressStatus | Unset = UNSET - in_triage_by: IncidentInTriageByType0 | None | Unset = UNSET - started_by: IncidentStartedByType0 | None | Unset = UNSET - mitigated_by: IncidentMitigatedByType0 | None | Unset = UNSET - resolved_by: IncidentResolvedByType0 | None | Unset = UNSET - closed_by: IncidentClosedByType0 | None | Unset = UNSET - cancelled_by: IncidentCancelledByType0 | None | Unset = UNSET - in_triage_at: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - closed_at: None | str | Unset = UNSET - cancelled_at: None | str | Unset = UNSET + id: Unset | str = UNSET + sequential_id: Unset | int = UNSET + kind: Unset | str = UNSET + slug: Unset | str = UNSET + parent_incident_id: None | Unset | str = UNSET + duplicate_incident_id: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + private: Unset | bool = False + source: None | Unset | str = UNSET + status: None | Unset | str = UNSET + url: None | Unset | str = UNSET + short_url: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + user: Union["IncidentUserType0", None, Unset] = UNSET + severity: Union[Unset, "SeverityResponse"] = UNSET + environments: None | Unset | list["EnvironmentResponse"] = UNSET + incident_types: None | Unset | list["IncidentTypeResponse"] = UNSET + services: None | Unset | list["ServiceResponse"] = UNSET + functionalities: None | Unset | list["FunctionalityResponse"] = UNSET + groups: None | Unset | list["TeamResponse"] = UNSET + labels: Union["IncidentLabelsType0", None, Unset] = UNSET + slack_channel_id: None | Unset | str = UNSET + slack_channel_name: None | Unset | str = UNSET + slack_channel_url: None | Unset | str = UNSET + slack_channel_short_url: None | Unset | str = UNSET + slack_channel_deep_link: None | Unset | str = UNSET + slack_channel_archived: None | Unset | bool = UNSET + slack_last_message_ts: None | Unset | str = UNSET + zoom_meeting_id: None | Unset | str = UNSET + zoom_meeting_start_url: None | Unset | str = UNSET + zoom_meeting_join_url: None | Unset | str = UNSET + zoom_meeting_password: None | Unset | str = UNSET + zoom_meeting_pstn_password: None | Unset | str = UNSET + zoom_meeting_h323_password: None | Unset | str = UNSET + zoom_meeting_global_dial_in_numbers: None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"] = UNSET + google_drive_id: None | Unset | str = UNSET + google_drive_parent_id: None | Unset | str = UNSET + google_drive_url: None | Unset | str = UNSET + google_meeting_id: None | Unset | str = UNSET + google_meeting_url: None | Unset | str = UNSET + microsoft_teams_meeting_id: None | Unset | str = UNSET + microsoft_teams_meeting_url: None | Unset | str = UNSET + microsoft_teams_channel_id: None | Unset | str = UNSET + microsoft_teams_channel_name: None | Unset | str = UNSET + microsoft_teams_channel_url: None | Unset | str = UNSET + microsoft_teams_channel_short_url: None | Unset | str = UNSET + microsoft_teams_chat_id: None | Unset | str = UNSET + microsoft_teams_chat_url: None | Unset | str = UNSET + microsoft_teams_team_id: None | Unset | str = UNSET + google_chat_space_id: None | Unset | str = UNSET + google_chat_space_name: None | Unset | str = UNSET + google_chat_space_url: None | Unset | str = UNSET + google_chat_space_short_url: None | Unset | str = UNSET + google_chat_space_archived: None | Unset | bool = UNSET + google_chat_space_domain_id: None | Unset | str = UNSET + webex_meeting_id: None | Unset | str = UNSET + webex_meeting_url: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + github_issue_id: None | Unset | str = UNSET + github_issue_url: None | Unset | str = UNSET + gitlab_issue_id: None | Unset | str = UNSET + gitlab_issue_url: None | Unset | str = UNSET + asana_task_id: None | Unset | str = UNSET + asana_task_url: None | Unset | str = UNSET + linear_issue_id: None | Unset | str = UNSET + linear_issue_url: None | Unset | str = UNSET + trello_card_id: None | Unset | str = UNSET + trello_card_url: None | Unset | str = UNSET + zendesk_ticket_id: None | Unset | str = UNSET + zendesk_ticket_url: None | Unset | str = UNSET + pagerduty_incident_id: None | Unset | str = UNSET + pagerduty_incident_number: None | Unset | str = UNSET + pagerduty_incident_url: None | Unset | str = UNSET + opsgenie_incident_id: None | Unset | str = UNSET + opsgenie_incident_url: None | Unset | str = UNSET + opsgenie_alert_id: None | Unset | str = UNSET + opsgenie_alert_url: None | Unset | str = UNSET + service_now_incident_id: None | Unset | str = UNSET + service_now_incident_key: None | Unset | str = UNSET + service_now_incident_url: None | Unset | str = UNSET + mattermost_channel_id: None | Unset | str = UNSET + mattermost_channel_name: None | Unset | str = UNSET + mattermost_channel_url: None | Unset | str = UNSET + confluence_page_id: None | Unset | str = UNSET + confluence_page_url: None | Unset | str = UNSET + datadog_notebook_id: None | Unset | str = UNSET + datadog_notebook_url: None | Unset | str = UNSET + shortcut_story_id: None | Unset | str = UNSET + shortcut_story_url: None | Unset | str = UNSET + shortcut_task_id: None | Unset | str = UNSET + shortcut_task_url: None | Unset | str = UNSET + motion_task_id: None | Unset | str = UNSET + motion_task_url: None | Unset | str = UNSET + clickup_task_id: None | Unset | str = UNSET + clickup_task_url: None | Unset | str = UNSET + victor_ops_incident_id: None | Unset | str = UNSET + victor_ops_incident_url: None | Unset | str = UNSET + quip_page_id: None | Unset | str = UNSET + quip_page_url: None | Unset | str = UNSET + sharepoint_page_id: None | Unset | str = UNSET + sharepoint_page_url: None | Unset | str = UNSET + airtable_base_key: None | Unset | str = UNSET + airtable_table_name: None | Unset | str = UNSET + airtable_record_id: None | Unset | str = UNSET + airtable_record_url: None | Unset | str = UNSET + freshservice_ticket_id: None | Unset | str = UNSET + freshservice_ticket_url: None | Unset | str = UNSET + freshservice_task_id: None | Unset | str = UNSET + freshservice_task_url: None | Unset | str = UNSET + mitigation_message: None | Unset | str = UNSET + resolution_message: None | Unset | str = UNSET + cancellation_message: None | Unset | str = UNSET + scheduled_for: None | Unset | str = UNSET + scheduled_until: None | Unset | str = UNSET + muted_service_ids: None | Unset | list[str] = UNSET + retrospective_progress_status: Unset | IncidentRetrospectiveProgressStatus = UNSET + in_triage_by: Union["IncidentInTriageByType0", None, Unset] = UNSET + started_by: Union["IncidentStartedByType0", None, Unset] = UNSET + mitigated_by: Union["IncidentMitigatedByType0", None, Unset] = UNSET + resolved_by: Union["IncidentResolvedByType0", None, Unset] = UNSET + closed_by: Union["IncidentClosedByType0", None, Unset] = UNSET + cancelled_by: Union["IncidentCancelledByType0", None, Unset] = UNSET + in_triage_at: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + closed_at: None | Unset | str = UNSET + cancelled_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -341,19 +339,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - parent_incident_id: None | str | Unset + parent_incident_id: None | Unset | str if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | str | Unset + duplicate_incident_id: None | Unset | str if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: @@ -361,37 +359,37 @@ def to_dict(self) -> dict[str, Any]: private = self.private - source: None | str | Unset + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: source = self.source - status: None | str | Unset + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: status = self.status - url: None | str | Unset + url: None | Unset | str if isinstance(self.url, Unset): url = UNSET else: url = self.url - short_url: None | str | Unset + short_url: None | Unset | str if isinstance(self.short_url, Unset): short_url = UNSET else: short_url = self.short_url - public_title: None | str | Unset + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - user: dict[str, Any] | None | Unset + user: None | Unset | dict[str, Any] if isinstance(self.user, Unset): user = UNSET elif isinstance(self.user, IncidentUserType0): @@ -399,11 +397,11 @@ def to_dict(self) -> dict[str, Any]: else: user = self.user - severity: dict[str, Any] | Unset = UNSET + severity: Unset | dict[str, Any] = UNSET if not isinstance(self.severity, Unset): severity = self.severity.to_dict() - environments: list[dict[str, Any]] | None | Unset + environments: None | Unset | list[dict[str, Any]] if isinstance(self.environments, Unset): environments = UNSET elif isinstance(self.environments, list): @@ -415,7 +413,7 @@ def to_dict(self) -> dict[str, Any]: else: environments = self.environments - incident_types: list[dict[str, Any]] | None | Unset + incident_types: None | Unset | list[dict[str, Any]] if isinstance(self.incident_types, Unset): incident_types = UNSET elif isinstance(self.incident_types, list): @@ -427,7 +425,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_types = self.incident_types - services: list[dict[str, Any]] | None | Unset + services: None | Unset | list[dict[str, Any]] if isinstance(self.services, Unset): services = UNSET elif isinstance(self.services, list): @@ -439,7 +437,7 @@ def to_dict(self) -> dict[str, Any]: else: services = self.services - functionalities: list[dict[str, Any]] | None | Unset + functionalities: None | Unset | list[dict[str, Any]] if isinstance(self.functionalities, Unset): functionalities = UNSET elif isinstance(self.functionalities, list): @@ -451,7 +449,7 @@ def to_dict(self) -> dict[str, Any]: else: functionalities = self.functionalities - groups: list[dict[str, Any]] | None | Unset + groups: None | Unset | list[dict[str, Any]] if isinstance(self.groups, Unset): groups = UNSET elif isinstance(self.groups, list): @@ -463,7 +461,7 @@ def to_dict(self) -> dict[str, Any]: else: groups = self.groups - labels: dict[str, Any] | None | Unset + labels: None | Unset | dict[str, Any] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, IncidentLabelsType0): @@ -471,85 +469,85 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: None | str | Unset + slack_channel_id: None | Unset | str if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: None | str | Unset + slack_channel_name: None | Unset | str if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: None | str | Unset + slack_channel_url: None | Unset | str if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_short_url: None | str | Unset + slack_channel_short_url: None | Unset | str if isinstance(self.slack_channel_short_url, Unset): slack_channel_short_url = UNSET else: slack_channel_short_url = self.slack_channel_short_url - slack_channel_deep_link: None | str | Unset + slack_channel_deep_link: None | Unset | str if isinstance(self.slack_channel_deep_link, Unset): slack_channel_deep_link = UNSET else: slack_channel_deep_link = self.slack_channel_deep_link - slack_channel_archived: bool | None | Unset + slack_channel_archived: None | Unset | bool if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - slack_last_message_ts: None | str | Unset + slack_last_message_ts: None | Unset | str if isinstance(self.slack_last_message_ts, Unset): slack_last_message_ts = UNSET else: slack_last_message_ts = self.slack_last_message_ts - zoom_meeting_id: None | str | Unset + zoom_meeting_id: None | Unset | str if isinstance(self.zoom_meeting_id, Unset): zoom_meeting_id = UNSET else: zoom_meeting_id = self.zoom_meeting_id - zoom_meeting_start_url: None | str | Unset + zoom_meeting_start_url: None | Unset | str if isinstance(self.zoom_meeting_start_url, Unset): zoom_meeting_start_url = UNSET else: zoom_meeting_start_url = self.zoom_meeting_start_url - zoom_meeting_join_url: None | str | Unset + zoom_meeting_join_url: None | Unset | str if isinstance(self.zoom_meeting_join_url, Unset): zoom_meeting_join_url = UNSET else: zoom_meeting_join_url = self.zoom_meeting_join_url - zoom_meeting_password: None | str | Unset + zoom_meeting_password: None | Unset | str if isinstance(self.zoom_meeting_password, Unset): zoom_meeting_password = UNSET else: zoom_meeting_password = self.zoom_meeting_password - zoom_meeting_pstn_password: None | str | Unset + zoom_meeting_pstn_password: None | Unset | str if isinstance(self.zoom_meeting_pstn_password, Unset): zoom_meeting_pstn_password = UNSET else: zoom_meeting_pstn_password = self.zoom_meeting_pstn_password - zoom_meeting_h323_password: None | str | Unset + zoom_meeting_h323_password: None | Unset | str if isinstance(self.zoom_meeting_h323_password, Unset): zoom_meeting_h323_password = UNSET else: zoom_meeting_h323_password = self.zoom_meeting_h323_password - zoom_meeting_global_dial_in_numbers: list[dict[str, Any]] | None | Unset + zoom_meeting_global_dial_in_numbers: None | Unset | list[dict[str, Any]] if isinstance(self.zoom_meeting_global_dial_in_numbers, Unset): zoom_meeting_global_dial_in_numbers = UNSET elif isinstance(self.zoom_meeting_global_dial_in_numbers, list): @@ -563,493 +561,493 @@ def to_dict(self) -> dict[str, Any]: else: zoom_meeting_global_dial_in_numbers = self.zoom_meeting_global_dial_in_numbers - google_drive_id: None | str | Unset + google_drive_id: None | Unset | str if isinstance(self.google_drive_id, Unset): google_drive_id = UNSET else: google_drive_id = self.google_drive_id - google_drive_parent_id: None | str | Unset + google_drive_parent_id: None | Unset | str if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: None | str | Unset + google_drive_url: None | Unset | str if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - google_meeting_id: None | str | Unset + google_meeting_id: None | Unset | str if isinstance(self.google_meeting_id, Unset): google_meeting_id = UNSET else: google_meeting_id = self.google_meeting_id - google_meeting_url: None | str | Unset + google_meeting_url: None | Unset | str if isinstance(self.google_meeting_url, Unset): google_meeting_url = UNSET else: google_meeting_url = self.google_meeting_url - microsoft_teams_meeting_id: None | str | Unset + microsoft_teams_meeting_id: None | Unset | str if isinstance(self.microsoft_teams_meeting_id, Unset): microsoft_teams_meeting_id = UNSET else: microsoft_teams_meeting_id = self.microsoft_teams_meeting_id - microsoft_teams_meeting_url: None | str | Unset + microsoft_teams_meeting_url: None | Unset | str if isinstance(self.microsoft_teams_meeting_url, Unset): microsoft_teams_meeting_url = UNSET else: microsoft_teams_meeting_url = self.microsoft_teams_meeting_url - microsoft_teams_channel_id: None | str | Unset + microsoft_teams_channel_id: None | Unset | str if isinstance(self.microsoft_teams_channel_id, Unset): microsoft_teams_channel_id = UNSET else: microsoft_teams_channel_id = self.microsoft_teams_channel_id - microsoft_teams_channel_name: None | str | Unset + microsoft_teams_channel_name: None | Unset | str if isinstance(self.microsoft_teams_channel_name, Unset): microsoft_teams_channel_name = UNSET else: microsoft_teams_channel_name = self.microsoft_teams_channel_name - microsoft_teams_channel_url: None | str | Unset + microsoft_teams_channel_url: None | Unset | str if isinstance(self.microsoft_teams_channel_url, Unset): microsoft_teams_channel_url = UNSET else: microsoft_teams_channel_url = self.microsoft_teams_channel_url - microsoft_teams_channel_short_url: None | str | Unset + microsoft_teams_channel_short_url: None | Unset | str if isinstance(self.microsoft_teams_channel_short_url, Unset): microsoft_teams_channel_short_url = UNSET else: microsoft_teams_channel_short_url = self.microsoft_teams_channel_short_url - microsoft_teams_chat_id: None | str | Unset + microsoft_teams_chat_id: None | Unset | str if isinstance(self.microsoft_teams_chat_id, Unset): microsoft_teams_chat_id = UNSET else: microsoft_teams_chat_id = self.microsoft_teams_chat_id - microsoft_teams_chat_url: None | str | Unset + microsoft_teams_chat_url: None | Unset | str if isinstance(self.microsoft_teams_chat_url, Unset): microsoft_teams_chat_url = UNSET else: microsoft_teams_chat_url = self.microsoft_teams_chat_url - microsoft_teams_team_id: None | str | Unset + microsoft_teams_team_id: None | Unset | str if isinstance(self.microsoft_teams_team_id, Unset): microsoft_teams_team_id = UNSET else: microsoft_teams_team_id = self.microsoft_teams_team_id - google_chat_space_id: None | str | Unset + google_chat_space_id: None | Unset | str if isinstance(self.google_chat_space_id, Unset): google_chat_space_id = UNSET else: google_chat_space_id = self.google_chat_space_id - google_chat_space_name: None | str | Unset + google_chat_space_name: None | Unset | str if isinstance(self.google_chat_space_name, Unset): google_chat_space_name = UNSET else: google_chat_space_name = self.google_chat_space_name - google_chat_space_url: None | str | Unset + google_chat_space_url: None | Unset | str if isinstance(self.google_chat_space_url, Unset): google_chat_space_url = UNSET else: google_chat_space_url = self.google_chat_space_url - google_chat_space_short_url: None | str | Unset + google_chat_space_short_url: None | Unset | str if isinstance(self.google_chat_space_short_url, Unset): google_chat_space_short_url = UNSET else: google_chat_space_short_url = self.google_chat_space_short_url - google_chat_space_archived: bool | None | Unset + google_chat_space_archived: None | Unset | bool if isinstance(self.google_chat_space_archived, Unset): google_chat_space_archived = UNSET else: google_chat_space_archived = self.google_chat_space_archived - google_chat_space_domain_id: None | str | Unset + google_chat_space_domain_id: None | Unset | str if isinstance(self.google_chat_space_domain_id, Unset): google_chat_space_domain_id = UNSET else: google_chat_space_domain_id = self.google_chat_space_domain_id - webex_meeting_id: None | str | Unset + webex_meeting_id: None | Unset | str if isinstance(self.webex_meeting_id, Unset): webex_meeting_id = UNSET else: webex_meeting_id = self.webex_meeting_id - webex_meeting_url: None | str | Unset + webex_meeting_url: None | Unset | str if isinstance(self.webex_meeting_url, Unset): webex_meeting_url = UNSET else: webex_meeting_url = self.webex_meeting_url - jira_issue_key: None | str | Unset + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | str | Unset + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | str | Unset + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - github_issue_id: None | str | Unset + github_issue_id: None | Unset | str if isinstance(self.github_issue_id, Unset): github_issue_id = UNSET else: github_issue_id = self.github_issue_id - github_issue_url: None | str | Unset + github_issue_url: None | Unset | str if isinstance(self.github_issue_url, Unset): github_issue_url = UNSET else: github_issue_url = self.github_issue_url - gitlab_issue_id: None | str | Unset + gitlab_issue_id: None | Unset | str if isinstance(self.gitlab_issue_id, Unset): gitlab_issue_id = UNSET else: gitlab_issue_id = self.gitlab_issue_id - gitlab_issue_url: None | str | Unset + gitlab_issue_url: None | Unset | str if isinstance(self.gitlab_issue_url, Unset): gitlab_issue_url = UNSET else: gitlab_issue_url = self.gitlab_issue_url - asana_task_id: None | str | Unset + asana_task_id: None | Unset | str if isinstance(self.asana_task_id, Unset): asana_task_id = UNSET else: asana_task_id = self.asana_task_id - asana_task_url: None | str | Unset + asana_task_url: None | Unset | str if isinstance(self.asana_task_url, Unset): asana_task_url = UNSET else: asana_task_url = self.asana_task_url - linear_issue_id: None | str | Unset + linear_issue_id: None | Unset | str if isinstance(self.linear_issue_id, Unset): linear_issue_id = UNSET else: linear_issue_id = self.linear_issue_id - linear_issue_url: None | str | Unset + linear_issue_url: None | Unset | str if isinstance(self.linear_issue_url, Unset): linear_issue_url = UNSET else: linear_issue_url = self.linear_issue_url - trello_card_id: None | str | Unset + trello_card_id: None | Unset | str if isinstance(self.trello_card_id, Unset): trello_card_id = UNSET else: trello_card_id = self.trello_card_id - trello_card_url: None | str | Unset + trello_card_url: None | Unset | str if isinstance(self.trello_card_url, Unset): trello_card_url = UNSET else: trello_card_url = self.trello_card_url - zendesk_ticket_id: None | str | Unset + zendesk_ticket_id: None | Unset | str if isinstance(self.zendesk_ticket_id, Unset): zendesk_ticket_id = UNSET else: zendesk_ticket_id = self.zendesk_ticket_id - zendesk_ticket_url: None | str | Unset + zendesk_ticket_url: None | Unset | str if isinstance(self.zendesk_ticket_url, Unset): zendesk_ticket_url = UNSET else: zendesk_ticket_url = self.zendesk_ticket_url - pagerduty_incident_id: None | str | Unset + pagerduty_incident_id: None | Unset | str if isinstance(self.pagerduty_incident_id, Unset): pagerduty_incident_id = UNSET else: pagerduty_incident_id = self.pagerduty_incident_id - pagerduty_incident_number: None | str | Unset + pagerduty_incident_number: None | Unset | str if isinstance(self.pagerduty_incident_number, Unset): pagerduty_incident_number = UNSET else: pagerduty_incident_number = self.pagerduty_incident_number - pagerduty_incident_url: None | str | Unset + pagerduty_incident_url: None | Unset | str if isinstance(self.pagerduty_incident_url, Unset): pagerduty_incident_url = UNSET else: pagerduty_incident_url = self.pagerduty_incident_url - opsgenie_incident_id: None | str | Unset + opsgenie_incident_id: None | Unset | str if isinstance(self.opsgenie_incident_id, Unset): opsgenie_incident_id = UNSET else: opsgenie_incident_id = self.opsgenie_incident_id - opsgenie_incident_url: None | str | Unset + opsgenie_incident_url: None | Unset | str if isinstance(self.opsgenie_incident_url, Unset): opsgenie_incident_url = UNSET else: opsgenie_incident_url = self.opsgenie_incident_url - opsgenie_alert_id: None | str | Unset + opsgenie_alert_id: None | Unset | str if isinstance(self.opsgenie_alert_id, Unset): opsgenie_alert_id = UNSET else: opsgenie_alert_id = self.opsgenie_alert_id - opsgenie_alert_url: None | str | Unset + opsgenie_alert_url: None | Unset | str if isinstance(self.opsgenie_alert_url, Unset): opsgenie_alert_url = UNSET else: opsgenie_alert_url = self.opsgenie_alert_url - service_now_incident_id: None | str | Unset + service_now_incident_id: None | Unset | str if isinstance(self.service_now_incident_id, Unset): service_now_incident_id = UNSET else: service_now_incident_id = self.service_now_incident_id - service_now_incident_key: None | str | Unset + service_now_incident_key: None | Unset | str if isinstance(self.service_now_incident_key, Unset): service_now_incident_key = UNSET else: service_now_incident_key = self.service_now_incident_key - service_now_incident_url: None | str | Unset + service_now_incident_url: None | Unset | str if isinstance(self.service_now_incident_url, Unset): service_now_incident_url = UNSET else: service_now_incident_url = self.service_now_incident_url - mattermost_channel_id: None | str | Unset + mattermost_channel_id: None | Unset | str if isinstance(self.mattermost_channel_id, Unset): mattermost_channel_id = UNSET else: mattermost_channel_id = self.mattermost_channel_id - mattermost_channel_name: None | str | Unset + mattermost_channel_name: None | Unset | str if isinstance(self.mattermost_channel_name, Unset): mattermost_channel_name = UNSET else: mattermost_channel_name = self.mattermost_channel_name - mattermost_channel_url: None | str | Unset + mattermost_channel_url: None | Unset | str if isinstance(self.mattermost_channel_url, Unset): mattermost_channel_url = UNSET else: mattermost_channel_url = self.mattermost_channel_url - confluence_page_id: None | str | Unset + confluence_page_id: None | Unset | str if isinstance(self.confluence_page_id, Unset): confluence_page_id = UNSET else: confluence_page_id = self.confluence_page_id - confluence_page_url: None | str | Unset + confluence_page_url: None | Unset | str if isinstance(self.confluence_page_url, Unset): confluence_page_url = UNSET else: confluence_page_url = self.confluence_page_url - datadog_notebook_id: None | str | Unset + datadog_notebook_id: None | Unset | str if isinstance(self.datadog_notebook_id, Unset): datadog_notebook_id = UNSET else: datadog_notebook_id = self.datadog_notebook_id - datadog_notebook_url: None | str | Unset + datadog_notebook_url: None | Unset | str if isinstance(self.datadog_notebook_url, Unset): datadog_notebook_url = UNSET else: datadog_notebook_url = self.datadog_notebook_url - shortcut_story_id: None | str | Unset + shortcut_story_id: None | Unset | str if isinstance(self.shortcut_story_id, Unset): shortcut_story_id = UNSET else: shortcut_story_id = self.shortcut_story_id - shortcut_story_url: None | str | Unset + shortcut_story_url: None | Unset | str if isinstance(self.shortcut_story_url, Unset): shortcut_story_url = UNSET else: shortcut_story_url = self.shortcut_story_url - shortcut_task_id: None | str | Unset + shortcut_task_id: None | Unset | str if isinstance(self.shortcut_task_id, Unset): shortcut_task_id = UNSET else: shortcut_task_id = self.shortcut_task_id - shortcut_task_url: None | str | Unset + shortcut_task_url: None | Unset | str if isinstance(self.shortcut_task_url, Unset): shortcut_task_url = UNSET else: shortcut_task_url = self.shortcut_task_url - motion_task_id: None | str | Unset + motion_task_id: None | Unset | str if isinstance(self.motion_task_id, Unset): motion_task_id = UNSET else: motion_task_id = self.motion_task_id - motion_task_url: None | str | Unset + motion_task_url: None | Unset | str if isinstance(self.motion_task_url, Unset): motion_task_url = UNSET else: motion_task_url = self.motion_task_url - clickup_task_id: None | str | Unset + clickup_task_id: None | Unset | str if isinstance(self.clickup_task_id, Unset): clickup_task_id = UNSET else: clickup_task_id = self.clickup_task_id - clickup_task_url: None | str | Unset + clickup_task_url: None | Unset | str if isinstance(self.clickup_task_url, Unset): clickup_task_url = UNSET else: clickup_task_url = self.clickup_task_url - victor_ops_incident_id: None | str | Unset + victor_ops_incident_id: None | Unset | str if isinstance(self.victor_ops_incident_id, Unset): victor_ops_incident_id = UNSET else: victor_ops_incident_id = self.victor_ops_incident_id - victor_ops_incident_url: None | str | Unset + victor_ops_incident_url: None | Unset | str if isinstance(self.victor_ops_incident_url, Unset): victor_ops_incident_url = UNSET else: victor_ops_incident_url = self.victor_ops_incident_url - quip_page_id: None | str | Unset + quip_page_id: None | Unset | str if isinstance(self.quip_page_id, Unset): quip_page_id = UNSET else: quip_page_id = self.quip_page_id - quip_page_url: None | str | Unset + quip_page_url: None | Unset | str if isinstance(self.quip_page_url, Unset): quip_page_url = UNSET else: quip_page_url = self.quip_page_url - sharepoint_page_id: None | str | Unset + sharepoint_page_id: None | Unset | str if isinstance(self.sharepoint_page_id, Unset): sharepoint_page_id = UNSET else: sharepoint_page_id = self.sharepoint_page_id - sharepoint_page_url: None | str | Unset + sharepoint_page_url: None | Unset | str if isinstance(self.sharepoint_page_url, Unset): sharepoint_page_url = UNSET else: sharepoint_page_url = self.sharepoint_page_url - airtable_base_key: None | str | Unset + airtable_base_key: None | Unset | str if isinstance(self.airtable_base_key, Unset): airtable_base_key = UNSET else: airtable_base_key = self.airtable_base_key - airtable_table_name: None | str | Unset + airtable_table_name: None | Unset | str if isinstance(self.airtable_table_name, Unset): airtable_table_name = UNSET else: airtable_table_name = self.airtable_table_name - airtable_record_id: None | str | Unset + airtable_record_id: None | Unset | str if isinstance(self.airtable_record_id, Unset): airtable_record_id = UNSET else: airtable_record_id = self.airtable_record_id - airtable_record_url: None | str | Unset + airtable_record_url: None | Unset | str if isinstance(self.airtable_record_url, Unset): airtable_record_url = UNSET else: airtable_record_url = self.airtable_record_url - freshservice_ticket_id: None | str | Unset + freshservice_ticket_id: None | Unset | str if isinstance(self.freshservice_ticket_id, Unset): freshservice_ticket_id = UNSET else: freshservice_ticket_id = self.freshservice_ticket_id - freshservice_ticket_url: None | str | Unset + freshservice_ticket_url: None | Unset | str if isinstance(self.freshservice_ticket_url, Unset): freshservice_ticket_url = UNSET else: freshservice_ticket_url = self.freshservice_ticket_url - freshservice_task_id: None | str | Unset + freshservice_task_id: None | Unset | str if isinstance(self.freshservice_task_id, Unset): freshservice_task_id = UNSET else: freshservice_task_id = self.freshservice_task_id - freshservice_task_url: None | str | Unset + freshservice_task_url: None | Unset | str if isinstance(self.freshservice_task_url, Unset): freshservice_task_url = UNSET else: freshservice_task_url = self.freshservice_task_url - mitigation_message: None | str | Unset + mitigation_message: None | Unset | str if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: None | str | Unset + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: None | str | Unset + cancellation_message: None | Unset | str if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: cancellation_message = self.cancellation_message - scheduled_for: None | str | Unset + scheduled_for: None | Unset | str if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | str | Unset + scheduled_until: None | Unset | str if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - muted_service_ids: list[str] | None | Unset + muted_service_ids: None | Unset | list[str] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -1058,11 +1056,11 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - retrospective_progress_status: str | Unset = UNSET + retrospective_progress_status: Unset | str = UNSET if not isinstance(self.retrospective_progress_status, Unset): retrospective_progress_status = self.retrospective_progress_status - in_triage_by: dict[str, Any] | None | Unset + in_triage_by: None | Unset | dict[str, Any] if isinstance(self.in_triage_by, Unset): in_triage_by = UNSET elif isinstance(self.in_triage_by, IncidentInTriageByType0): @@ -1070,7 +1068,7 @@ def to_dict(self) -> dict[str, Any]: else: in_triage_by = self.in_triage_by - started_by: dict[str, Any] | None | Unset + started_by: None | Unset | dict[str, Any] if isinstance(self.started_by, Unset): started_by = UNSET elif isinstance(self.started_by, IncidentStartedByType0): @@ -1078,7 +1076,7 @@ def to_dict(self) -> dict[str, Any]: else: started_by = self.started_by - mitigated_by: dict[str, Any] | None | Unset + mitigated_by: None | Unset | dict[str, Any] if isinstance(self.mitigated_by, Unset): mitigated_by = UNSET elif isinstance(self.mitigated_by, IncidentMitigatedByType0): @@ -1086,7 +1084,7 @@ def to_dict(self) -> dict[str, Any]: else: mitigated_by = self.mitigated_by - resolved_by: dict[str, Any] | None | Unset + resolved_by: None | Unset | dict[str, Any] if isinstance(self.resolved_by, Unset): resolved_by = UNSET elif isinstance(self.resolved_by, IncidentResolvedByType0): @@ -1094,7 +1092,7 @@ def to_dict(self) -> dict[str, Any]: else: resolved_by = self.resolved_by - closed_by: dict[str, Any] | None | Unset + closed_by: None | Unset | dict[str, Any] if isinstance(self.closed_by, Unset): closed_by = UNSET elif isinstance(self.closed_by, IncidentClosedByType0): @@ -1102,7 +1100,7 @@ def to_dict(self) -> dict[str, Any]: else: closed_by = self.closed_by - cancelled_by: dict[str, Any] | None | Unset + cancelled_by: None | Unset | dict[str, Any] if isinstance(self.cancelled_by, Unset): cancelled_by = UNSET elif isinstance(self.cancelled_by, IncidentCancelledByType0): @@ -1110,49 +1108,49 @@ def to_dict(self) -> dict[str, Any]: else: cancelled_by = self.cancelled_by - in_triage_at: None | str | Unset + in_triage_at: None | Unset | str if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | str | Unset + closed_at: None | Unset | str if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | str | Unset + cancelled_at: None | Unset | str if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -1469,81 +1467,81 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_parent_incident_id(data: object) -> None | str | Unset: + def _parse_parent_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | str | Unset: + def _parse_duplicate_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) private = d.pop("private", UNSET) - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_url(data: object) -> None | str | Unset: + def _parse_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) url = _parse_url(d.pop("url", UNSET)) - def _parse_short_url(data: object) -> None | str | Unset: + def _parse_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) short_url = _parse_short_url(d.pop("short_url", UNSET)) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_user(data: object) -> IncidentUserType0 | None | Unset: + def _parse_user(data: object) -> Union["IncidentUserType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -1554,20 +1552,20 @@ def _parse_user(data: object) -> IncidentUserType0 | None | Unset: user_type_0 = IncidentUserType0.from_dict(data) return user_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentUserType0 | None | Unset, data) + return cast(Union["IncidentUserType0", None, Unset], data) user = _parse_user(d.pop("user", UNSET)) _severity = d.pop("severity", UNSET) - severity: SeverityResponse | Unset + severity: Unset | SeverityResponse if isinstance(_severity, Unset): severity = UNSET else: severity = SeverityResponse.from_dict(_severity) - def _parse_environments(data: object) -> list[EnvironmentResponse] | None | Unset: + def _parse_environments(data: object) -> None | Unset | list["EnvironmentResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1583,13 +1581,13 @@ def _parse_environments(data: object) -> list[EnvironmentResponse] | None | Unse environments_type_0.append(environments_type_0_item) return environments_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentResponse] | None | Unset, data) + return cast(None | Unset | list["EnvironmentResponse"], data) environments = _parse_environments(d.pop("environments", UNSET)) - def _parse_incident_types(data: object) -> list[IncidentTypeResponse] | None | Unset: + def _parse_incident_types(data: object) -> None | Unset | list["IncidentTypeResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1605,13 +1603,13 @@ def _parse_incident_types(data: object) -> list[IncidentTypeResponse] | None | U incident_types_type_0.append(incident_types_type_0_item) return incident_types_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentTypeResponse] | None | Unset, data) + return cast(None | Unset | list["IncidentTypeResponse"], data) incident_types = _parse_incident_types(d.pop("incident_types", UNSET)) - def _parse_services(data: object) -> list[ServiceResponse] | None | Unset: + def _parse_services(data: object) -> None | Unset | list["ServiceResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1627,13 +1625,13 @@ def _parse_services(data: object) -> list[ServiceResponse] | None | Unset: services_type_0.append(services_type_0_item) return services_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServiceResponse] | None | Unset, data) + return cast(None | Unset | list["ServiceResponse"], data) services = _parse_services(d.pop("services", UNSET)) - def _parse_functionalities(data: object) -> list[FunctionalityResponse] | None | Unset: + def _parse_functionalities(data: object) -> None | Unset | list["FunctionalityResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1649,13 +1647,13 @@ def _parse_functionalities(data: object) -> list[FunctionalityResponse] | None | functionalities_type_0.append(functionalities_type_0_item) return functionalities_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalityResponse] | None | Unset, data) + return cast(None | Unset | list["FunctionalityResponse"], data) functionalities = _parse_functionalities(d.pop("functionalities", UNSET)) - def _parse_groups(data: object) -> list[TeamResponse] | None | Unset: + def _parse_groups(data: object) -> None | Unset | list["TeamResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1671,13 +1669,13 @@ def _parse_groups(data: object) -> list[TeamResponse] | None | Unset: groups_type_0.append(groups_type_0_item) return groups_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamResponse] | None | Unset, data) + return cast(None | Unset | list["TeamResponse"], data) groups = _parse_groups(d.pop("groups", UNSET)) - def _parse_labels(data: object) -> IncidentLabelsType0 | None | Unset: + def _parse_labels(data: object) -> Union["IncidentLabelsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -1688,132 +1686,132 @@ def _parse_labels(data: object) -> IncidentLabelsType0 | None | Unset: labels_type_0 = IncidentLabelsType0.from_dict(data) return labels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentLabelsType0 | None | Unset, data) + return cast(Union["IncidentLabelsType0", None, Unset], data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> None | str | Unset: + def _parse_slack_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> None | str | Unset: + def _parse_slack_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> None | str | Unset: + def _parse_slack_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_short_url(data: object) -> None | str | Unset: + def _parse_slack_channel_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_short_url = _parse_slack_channel_short_url(d.pop("slack_channel_short_url", UNSET)) - def _parse_slack_channel_deep_link(data: object) -> None | str | Unset: + def _parse_slack_channel_deep_link(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_deep_link = _parse_slack_channel_deep_link(d.pop("slack_channel_deep_link", UNSET)) - def _parse_slack_channel_archived(data: object) -> bool | None | Unset: + def _parse_slack_channel_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_slack_last_message_ts(data: object) -> None | str | Unset: + def _parse_slack_last_message_ts(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_last_message_ts = _parse_slack_last_message_ts(d.pop("slack_last_message_ts", UNSET)) - def _parse_zoom_meeting_id(data: object) -> None | str | Unset: + def _parse_zoom_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zoom_meeting_id = _parse_zoom_meeting_id(d.pop("zoom_meeting_id", UNSET)) - def _parse_zoom_meeting_start_url(data: object) -> None | str | Unset: + def _parse_zoom_meeting_start_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zoom_meeting_start_url = _parse_zoom_meeting_start_url(d.pop("zoom_meeting_start_url", UNSET)) - def _parse_zoom_meeting_join_url(data: object) -> None | str | Unset: + def _parse_zoom_meeting_join_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zoom_meeting_join_url = _parse_zoom_meeting_join_url(d.pop("zoom_meeting_join_url", UNSET)) - def _parse_zoom_meeting_password(data: object) -> None | str | Unset: + def _parse_zoom_meeting_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zoom_meeting_password = _parse_zoom_meeting_password(d.pop("zoom_meeting_password", UNSET)) - def _parse_zoom_meeting_pstn_password(data: object) -> None | str | Unset: + def _parse_zoom_meeting_pstn_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zoom_meeting_pstn_password = _parse_zoom_meeting_pstn_password(d.pop("zoom_meeting_pstn_password", UNSET)) - def _parse_zoom_meeting_h323_password(data: object) -> None | str | Unset: + def _parse_zoom_meeting_h323_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zoom_meeting_h323_password = _parse_zoom_meeting_h323_password(d.pop("zoom_meeting_h323_password", UNSET)) def _parse_zoom_meeting_global_dial_in_numbers( data: object, - ) -> list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset: + ) -> None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -1833,746 +1831,746 @@ def _parse_zoom_meeting_global_dial_in_numbers( zoom_meeting_global_dial_in_numbers_type_0.append(zoom_meeting_global_dial_in_numbers_type_0_item) return zoom_meeting_global_dial_in_numbers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset, data) + return cast(None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"], data) zoom_meeting_global_dial_in_numbers = _parse_zoom_meeting_global_dial_in_numbers( d.pop("zoom_meeting_global_dial_in_numbers", UNSET) ) - def _parse_google_drive_id(data: object) -> None | str | Unset: + def _parse_google_drive_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_id = _parse_google_drive_id(d.pop("google_drive_id", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | str | Unset: + def _parse_google_drive_parent_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> None | str | Unset: + def _parse_google_drive_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_google_meeting_id(data: object) -> None | str | Unset: + def _parse_google_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_meeting_id = _parse_google_meeting_id(d.pop("google_meeting_id", UNSET)) - def _parse_google_meeting_url(data: object) -> None | str | Unset: + def _parse_google_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_meeting_url = _parse_google_meeting_url(d.pop("google_meeting_url", UNSET)) - def _parse_microsoft_teams_meeting_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_meeting_id = _parse_microsoft_teams_meeting_id(d.pop("microsoft_teams_meeting_id", UNSET)) - def _parse_microsoft_teams_meeting_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_meeting_url = _parse_microsoft_teams_meeting_url(d.pop("microsoft_teams_meeting_url", UNSET)) - def _parse_microsoft_teams_channel_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_channel_id = _parse_microsoft_teams_channel_id(d.pop("microsoft_teams_channel_id", UNSET)) - def _parse_microsoft_teams_channel_name(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_channel_name = _parse_microsoft_teams_channel_name(d.pop("microsoft_teams_channel_name", UNSET)) - def _parse_microsoft_teams_channel_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_channel_url = _parse_microsoft_teams_channel_url(d.pop("microsoft_teams_channel_url", UNSET)) - def _parse_microsoft_teams_channel_short_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_channel_short_url = _parse_microsoft_teams_channel_short_url( d.pop("microsoft_teams_channel_short_url", UNSET) ) - def _parse_microsoft_teams_chat_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_chat_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_chat_id = _parse_microsoft_teams_chat_id(d.pop("microsoft_teams_chat_id", UNSET)) - def _parse_microsoft_teams_chat_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_chat_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_chat_url = _parse_microsoft_teams_chat_url(d.pop("microsoft_teams_chat_url", UNSET)) - def _parse_microsoft_teams_team_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) microsoft_teams_team_id = _parse_microsoft_teams_team_id(d.pop("microsoft_teams_team_id", UNSET)) - def _parse_google_chat_space_id(data: object) -> None | str | Unset: + def _parse_google_chat_space_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_chat_space_id = _parse_google_chat_space_id(d.pop("google_chat_space_id", UNSET)) - def _parse_google_chat_space_name(data: object) -> None | str | Unset: + def _parse_google_chat_space_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_chat_space_name = _parse_google_chat_space_name(d.pop("google_chat_space_name", UNSET)) - def _parse_google_chat_space_url(data: object) -> None | str | Unset: + def _parse_google_chat_space_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_chat_space_url = _parse_google_chat_space_url(d.pop("google_chat_space_url", UNSET)) - def _parse_google_chat_space_short_url(data: object) -> None | str | Unset: + def _parse_google_chat_space_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_chat_space_short_url = _parse_google_chat_space_short_url(d.pop("google_chat_space_short_url", UNSET)) - def _parse_google_chat_space_archived(data: object) -> bool | None | Unset: + def _parse_google_chat_space_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) google_chat_space_archived = _parse_google_chat_space_archived(d.pop("google_chat_space_archived", UNSET)) - def _parse_google_chat_space_domain_id(data: object) -> None | str | Unset: + def _parse_google_chat_space_domain_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_chat_space_domain_id = _parse_google_chat_space_domain_id(d.pop("google_chat_space_domain_id", UNSET)) - def _parse_webex_meeting_id(data: object) -> None | str | Unset: + def _parse_webex_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) webex_meeting_id = _parse_webex_meeting_id(d.pop("webex_meeting_id", UNSET)) - def _parse_webex_meeting_url(data: object) -> None | str | Unset: + def _parse_webex_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) webex_meeting_url = _parse_webex_meeting_url(d.pop("webex_meeting_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_github_issue_id(data: object) -> None | str | Unset: + def _parse_github_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_issue_id = _parse_github_issue_id(d.pop("github_issue_id", UNSET)) - def _parse_github_issue_url(data: object) -> None | str | Unset: + def _parse_github_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_issue_url = _parse_github_issue_url(d.pop("github_issue_url", UNSET)) - def _parse_gitlab_issue_id(data: object) -> None | str | Unset: + def _parse_gitlab_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_issue_id = _parse_gitlab_issue_id(d.pop("gitlab_issue_id", UNSET)) - def _parse_gitlab_issue_url(data: object) -> None | str | Unset: + def _parse_gitlab_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_issue_url = _parse_gitlab_issue_url(d.pop("gitlab_issue_url", UNSET)) - def _parse_asana_task_id(data: object) -> None | str | Unset: + def _parse_asana_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) asana_task_id = _parse_asana_task_id(d.pop("asana_task_id", UNSET)) - def _parse_asana_task_url(data: object) -> None | str | Unset: + def _parse_asana_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) asana_task_url = _parse_asana_task_url(d.pop("asana_task_url", UNSET)) - def _parse_linear_issue_id(data: object) -> None | str | Unset: + def _parse_linear_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) linear_issue_id = _parse_linear_issue_id(d.pop("linear_issue_id", UNSET)) - def _parse_linear_issue_url(data: object) -> None | str | Unset: + def _parse_linear_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) linear_issue_url = _parse_linear_issue_url(d.pop("linear_issue_url", UNSET)) - def _parse_trello_card_id(data: object) -> None | str | Unset: + def _parse_trello_card_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) trello_card_id = _parse_trello_card_id(d.pop("trello_card_id", UNSET)) - def _parse_trello_card_url(data: object) -> None | str | Unset: + def _parse_trello_card_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) trello_card_url = _parse_trello_card_url(d.pop("trello_card_url", UNSET)) - def _parse_zendesk_ticket_id(data: object) -> None | str | Unset: + def _parse_zendesk_ticket_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zendesk_ticket_id = _parse_zendesk_ticket_id(d.pop("zendesk_ticket_id", UNSET)) - def _parse_zendesk_ticket_url(data: object) -> None | str | Unset: + def _parse_zendesk_ticket_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) zendesk_ticket_url = _parse_zendesk_ticket_url(d.pop("zendesk_ticket_url", UNSET)) - def _parse_pagerduty_incident_id(data: object) -> None | str | Unset: + def _parse_pagerduty_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_incident_id = _parse_pagerduty_incident_id(d.pop("pagerduty_incident_id", UNSET)) - def _parse_pagerduty_incident_number(data: object) -> None | str | Unset: + def _parse_pagerduty_incident_number(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_incident_number = _parse_pagerduty_incident_number(d.pop("pagerduty_incident_number", UNSET)) - def _parse_pagerduty_incident_url(data: object) -> None | str | Unset: + def _parse_pagerduty_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_incident_url = _parse_pagerduty_incident_url(d.pop("pagerduty_incident_url", UNSET)) - def _parse_opsgenie_incident_id(data: object) -> None | str | Unset: + def _parse_opsgenie_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_incident_id = _parse_opsgenie_incident_id(d.pop("opsgenie_incident_id", UNSET)) - def _parse_opsgenie_incident_url(data: object) -> None | str | Unset: + def _parse_opsgenie_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_incident_url = _parse_opsgenie_incident_url(d.pop("opsgenie_incident_url", UNSET)) - def _parse_opsgenie_alert_id(data: object) -> None | str | Unset: + def _parse_opsgenie_alert_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_alert_id = _parse_opsgenie_alert_id(d.pop("opsgenie_alert_id", UNSET)) - def _parse_opsgenie_alert_url(data: object) -> None | str | Unset: + def _parse_opsgenie_alert_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_alert_url = _parse_opsgenie_alert_url(d.pop("opsgenie_alert_url", UNSET)) - def _parse_service_now_incident_id(data: object) -> None | str | Unset: + def _parse_service_now_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_incident_id = _parse_service_now_incident_id(d.pop("service_now_incident_id", UNSET)) - def _parse_service_now_incident_key(data: object) -> None | str | Unset: + def _parse_service_now_incident_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_incident_key = _parse_service_now_incident_key(d.pop("service_now_incident_key", UNSET)) - def _parse_service_now_incident_url(data: object) -> None | str | Unset: + def _parse_service_now_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_incident_url = _parse_service_now_incident_url(d.pop("service_now_incident_url", UNSET)) - def _parse_mattermost_channel_id(data: object) -> None | str | Unset: + def _parse_mattermost_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mattermost_channel_id = _parse_mattermost_channel_id(d.pop("mattermost_channel_id", UNSET)) - def _parse_mattermost_channel_name(data: object) -> None | str | Unset: + def _parse_mattermost_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mattermost_channel_name = _parse_mattermost_channel_name(d.pop("mattermost_channel_name", UNSET)) - def _parse_mattermost_channel_url(data: object) -> None | str | Unset: + def _parse_mattermost_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mattermost_channel_url = _parse_mattermost_channel_url(d.pop("mattermost_channel_url", UNSET)) - def _parse_confluence_page_id(data: object) -> None | str | Unset: + def _parse_confluence_page_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) confluence_page_id = _parse_confluence_page_id(d.pop("confluence_page_id", UNSET)) - def _parse_confluence_page_url(data: object) -> None | str | Unset: + def _parse_confluence_page_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) confluence_page_url = _parse_confluence_page_url(d.pop("confluence_page_url", UNSET)) - def _parse_datadog_notebook_id(data: object) -> None | str | Unset: + def _parse_datadog_notebook_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) datadog_notebook_id = _parse_datadog_notebook_id(d.pop("datadog_notebook_id", UNSET)) - def _parse_datadog_notebook_url(data: object) -> None | str | Unset: + def _parse_datadog_notebook_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) datadog_notebook_url = _parse_datadog_notebook_url(d.pop("datadog_notebook_url", UNSET)) - def _parse_shortcut_story_id(data: object) -> None | str | Unset: + def _parse_shortcut_story_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shortcut_story_id = _parse_shortcut_story_id(d.pop("shortcut_story_id", UNSET)) - def _parse_shortcut_story_url(data: object) -> None | str | Unset: + def _parse_shortcut_story_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shortcut_story_url = _parse_shortcut_story_url(d.pop("shortcut_story_url", UNSET)) - def _parse_shortcut_task_id(data: object) -> None | str | Unset: + def _parse_shortcut_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shortcut_task_id = _parse_shortcut_task_id(d.pop("shortcut_task_id", UNSET)) - def _parse_shortcut_task_url(data: object) -> None | str | Unset: + def _parse_shortcut_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shortcut_task_url = _parse_shortcut_task_url(d.pop("shortcut_task_url", UNSET)) - def _parse_motion_task_id(data: object) -> None | str | Unset: + def _parse_motion_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) motion_task_id = _parse_motion_task_id(d.pop("motion_task_id", UNSET)) - def _parse_motion_task_url(data: object) -> None | str | Unset: + def _parse_motion_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) motion_task_url = _parse_motion_task_url(d.pop("motion_task_url", UNSET)) - def _parse_clickup_task_id(data: object) -> None | str | Unset: + def _parse_clickup_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) clickup_task_id = _parse_clickup_task_id(d.pop("clickup_task_id", UNSET)) - def _parse_clickup_task_url(data: object) -> None | str | Unset: + def _parse_clickup_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) clickup_task_url = _parse_clickup_task_url(d.pop("clickup_task_url", UNSET)) - def _parse_victor_ops_incident_id(data: object) -> None | str | Unset: + def _parse_victor_ops_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) victor_ops_incident_id = _parse_victor_ops_incident_id(d.pop("victor_ops_incident_id", UNSET)) - def _parse_victor_ops_incident_url(data: object) -> None | str | Unset: + def _parse_victor_ops_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) victor_ops_incident_url = _parse_victor_ops_incident_url(d.pop("victor_ops_incident_url", UNSET)) - def _parse_quip_page_id(data: object) -> None | str | Unset: + def _parse_quip_page_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) quip_page_id = _parse_quip_page_id(d.pop("quip_page_id", UNSET)) - def _parse_quip_page_url(data: object) -> None | str | Unset: + def _parse_quip_page_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) quip_page_url = _parse_quip_page_url(d.pop("quip_page_url", UNSET)) - def _parse_sharepoint_page_id(data: object) -> None | str | Unset: + def _parse_sharepoint_page_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) sharepoint_page_id = _parse_sharepoint_page_id(d.pop("sharepoint_page_id", UNSET)) - def _parse_sharepoint_page_url(data: object) -> None | str | Unset: + def _parse_sharepoint_page_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) sharepoint_page_url = _parse_sharepoint_page_url(d.pop("sharepoint_page_url", UNSET)) - def _parse_airtable_base_key(data: object) -> None | str | Unset: + def _parse_airtable_base_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) airtable_base_key = _parse_airtable_base_key(d.pop("airtable_base_key", UNSET)) - def _parse_airtable_table_name(data: object) -> None | str | Unset: + def _parse_airtable_table_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) airtable_table_name = _parse_airtable_table_name(d.pop("airtable_table_name", UNSET)) - def _parse_airtable_record_id(data: object) -> None | str | Unset: + def _parse_airtable_record_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) airtable_record_id = _parse_airtable_record_id(d.pop("airtable_record_id", UNSET)) - def _parse_airtable_record_url(data: object) -> None | str | Unset: + def _parse_airtable_record_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) airtable_record_url = _parse_airtable_record_url(d.pop("airtable_record_url", UNSET)) - def _parse_freshservice_ticket_id(data: object) -> None | str | Unset: + def _parse_freshservice_ticket_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) freshservice_ticket_id = _parse_freshservice_ticket_id(d.pop("freshservice_ticket_id", UNSET)) - def _parse_freshservice_ticket_url(data: object) -> None | str | Unset: + def _parse_freshservice_ticket_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) freshservice_ticket_url = _parse_freshservice_ticket_url(d.pop("freshservice_ticket_url", UNSET)) - def _parse_freshservice_task_id(data: object) -> None | str | Unset: + def _parse_freshservice_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) freshservice_task_id = _parse_freshservice_task_id(d.pop("freshservice_task_id", UNSET)) - def _parse_freshservice_task_url(data: object) -> None | str | Unset: + def _parse_freshservice_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) freshservice_task_url = _parse_freshservice_task_url(d.pop("freshservice_task_url", UNSET)) - def _parse_mitigation_message(data: object) -> None | str | Unset: + def _parse_mitigation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> None | str | Unset: + def _parse_cancellation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) - def _parse_scheduled_for(data: object) -> None | str | Unset: + def _parse_scheduled_for(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | str | Unset: + def _parse_scheduled_until(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: + def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -2583,20 +2581,20 @@ def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) _retrospective_progress_status = d.pop("retrospective_progress_status", UNSET) - retrospective_progress_status: IncidentRetrospectiveProgressStatus | Unset + retrospective_progress_status: Unset | IncidentRetrospectiveProgressStatus if isinstance(_retrospective_progress_status, Unset): retrospective_progress_status = UNSET else: retrospective_progress_status = check_incident_retrospective_progress_status(_retrospective_progress_status) - def _parse_in_triage_by(data: object) -> IncidentInTriageByType0 | None | Unset: + def _parse_in_triage_by(data: object) -> Union["IncidentInTriageByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2607,13 +2605,13 @@ def _parse_in_triage_by(data: object) -> IncidentInTriageByType0 | None | Unset: in_triage_by_type_0 = IncidentInTriageByType0.from_dict(data) return in_triage_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentInTriageByType0 | None | Unset, data) + return cast(Union["IncidentInTriageByType0", None, Unset], data) in_triage_by = _parse_in_triage_by(d.pop("in_triage_by", UNSET)) - def _parse_started_by(data: object) -> IncidentStartedByType0 | None | Unset: + def _parse_started_by(data: object) -> Union["IncidentStartedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2624,13 +2622,13 @@ def _parse_started_by(data: object) -> IncidentStartedByType0 | None | Unset: started_by_type_0 = IncidentStartedByType0.from_dict(data) return started_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentStartedByType0 | None | Unset, data) + return cast(Union["IncidentStartedByType0", None, Unset], data) started_by = _parse_started_by(d.pop("started_by", UNSET)) - def _parse_mitigated_by(data: object) -> IncidentMitigatedByType0 | None | Unset: + def _parse_mitigated_by(data: object) -> Union["IncidentMitigatedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2641,13 +2639,13 @@ def _parse_mitigated_by(data: object) -> IncidentMitigatedByType0 | None | Unset mitigated_by_type_0 = IncidentMitigatedByType0.from_dict(data) return mitigated_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentMitigatedByType0 | None | Unset, data) + return cast(Union["IncidentMitigatedByType0", None, Unset], data) mitigated_by = _parse_mitigated_by(d.pop("mitigated_by", UNSET)) - def _parse_resolved_by(data: object) -> IncidentResolvedByType0 | None | Unset: + def _parse_resolved_by(data: object) -> Union["IncidentResolvedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2658,13 +2656,13 @@ def _parse_resolved_by(data: object) -> IncidentResolvedByType0 | None | Unset: resolved_by_type_0 = IncidentResolvedByType0.from_dict(data) return resolved_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentResolvedByType0 | None | Unset, data) + return cast(Union["IncidentResolvedByType0", None, Unset], data) resolved_by = _parse_resolved_by(d.pop("resolved_by", UNSET)) - def _parse_closed_by(data: object) -> IncidentClosedByType0 | None | Unset: + def _parse_closed_by(data: object) -> Union["IncidentClosedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2675,13 +2673,13 @@ def _parse_closed_by(data: object) -> IncidentClosedByType0 | None | Unset: closed_by_type_0 = IncidentClosedByType0.from_dict(data) return closed_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentClosedByType0 | None | Unset, data) + return cast(Union["IncidentClosedByType0", None, Unset], data) closed_by = _parse_closed_by(d.pop("closed_by", UNSET)) - def _parse_cancelled_by(data: object) -> IncidentCancelledByType0 | None | Unset: + def _parse_cancelled_by(data: object) -> Union["IncidentCancelledByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2692,81 +2690,81 @@ def _parse_cancelled_by(data: object) -> IncidentCancelledByType0 | None | Unset cancelled_by_type_0 = IncidentCancelledByType0.from_dict(data) return cancelled_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentCancelledByType0 | None | Unset, data) + return cast(Union["IncidentCancelledByType0", None, Unset], data) cancelled_by = _parse_cancelled_by(d.pop("cancelled_by", UNSET)) - def _parse_in_triage_at(data: object) -> None | str | Unset: + def _parse_in_triage_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | str | Unset: + def _parse_closed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | str | Unset: + def _parse_cancelled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) diff --git a/rootly_sdk/models/incident_action_item.py b/rootly_sdk/models/incident_action_item.py index ded60de4..cdb4826d 100644 --- a/rootly_sdk/models/incident_action_item.py +++ b/rootly_sdk/models/incident_action_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,60 +23,59 @@ class IncidentActionItem: summary (str): The summary of the action item created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of incident action item - kind (IncidentActionItemKind | Unset): The kind of the action item - assigned_to (UserFlatResponse | Unset): Flat user attributes as returned by UserFlatSerializer (no nested + description (Union[None, Unset, str]): The description of incident action item + kind (Union[Unset, IncidentActionItemKind]): The kind of the action item + assigned_to (Union[Unset, UserFlatResponse]): Flat user attributes as returned by UserFlatSerializer (no nested associations) - assigned_to_group_ids (list[str] | None | Unset): IDs of groups you wish to assign this action item - priority (IncidentActionItemPriority | Unset): The priority of the action item - status (IncidentActionItemStatus | Unset): The status of the action item - due_date (None | str | Unset): The due date of the action item - jira_issue_id (None | str | Unset): The Jira issue ID. - jira_issue_key (None | str | Unset): The Jira issue key. - jira_issue_url (None | str | Unset): The Jira issue URL. - created_by (UserFlatResponse | Unset): Flat user attributes as returned by UserFlatSerializer (no nested + assigned_to_group_ids (Union[None, Unset, list[str]]): IDs of groups you wish to assign this action item + priority (Union[Unset, IncidentActionItemPriority]): The priority of the action item + status (Union[Unset, IncidentActionItemStatus]): The status of the action item + due_date (Union[None, Unset, str]): The due date of the action item + jira_issue_id (Union[None, Unset, str]): The Jira issue ID. + jira_issue_key (Union[None, Unset, str]): The Jira issue key. + jira_issue_url (Union[None, Unset, str]): The Jira issue URL. + created_by (Union[Unset, UserFlatResponse]): Flat user attributes as returned by UserFlatSerializer (no nested associations) """ summary: str created_at: str updated_at: str - description: None | str | Unset = UNSET - kind: IncidentActionItemKind | Unset = UNSET - assigned_to: UserFlatResponse | Unset = UNSET - assigned_to_group_ids: list[str] | None | Unset = UNSET - priority: IncidentActionItemPriority | Unset = UNSET - status: IncidentActionItemStatus | Unset = UNSET - due_date: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - created_by: UserFlatResponse | Unset = UNSET + description: None | Unset | str = UNSET + kind: Unset | IncidentActionItemKind = UNSET + assigned_to: Union[Unset, "UserFlatResponse"] = UNSET + assigned_to_group_ids: None | Unset | list[str] = UNSET + priority: Unset | IncidentActionItemPriority = UNSET + status: Unset | IncidentActionItemStatus = UNSET + due_date: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + created_by: Union[Unset, "UserFlatResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - summary = self.summary created_at = self.created_at updated_at = self.updated_at - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to: dict[str, Any] | Unset = UNSET + assigned_to: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to, Unset): assigned_to = self.assigned_to.to_dict() - assigned_to_group_ids: list[str] | None | Unset + assigned_to_group_ids: None | Unset | list[str] if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -87,39 +84,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | str | Unset + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | str | Unset + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | str | Unset + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | str | Unset + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - created_by: dict[str, Any] | Unset = UNSET + created_by: Unset | dict[str, Any] = UNSET if not isinstance(self.created_by, Unset): created_by = self.created_by.to_dict() @@ -168,30 +165,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: IncidentActionItemKind | Unset + kind: Unset | IncidentActionItemKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_incident_action_item_kind(_kind) _assigned_to = d.pop("assigned_to", UNSET) - assigned_to: UserFlatResponse | Unset + assigned_to: Unset | UserFlatResponse if isinstance(_assigned_to, Unset): assigned_to = UNSET else: assigned_to = UserFlatResponse.from_dict(_assigned_to) - def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: + def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -202,64 +199,64 @@ def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: assigned_to_group_ids_type_0 = cast(list[str], data) return assigned_to_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: IncidentActionItemPriority | Unset + priority: Unset | IncidentActionItemPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_incident_action_item_priority(_priority) _status = d.pop("status", UNSET) - status: IncidentActionItemStatus | Unset + status: Unset | IncidentActionItemStatus if isinstance(_status, Unset): status = UNSET else: status = check_incident_action_item_status(_status) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) _created_by = d.pop("created_by", UNSET) - created_by: UserFlatResponse | Unset + created_by: Unset | UserFlatResponse if isinstance(_created_by, Unset): created_by = UNSET else: diff --git a/rootly_sdk/models/incident_action_item_list.py b/rootly_sdk/models/incident_action_item_list.py index 05633372..4644a6d0 100644 --- a/rootly_sdk/models/incident_action_item_list.py +++ b/rootly_sdk/models/incident_action_item_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentActionItemList: """ Attributes: - data (list[IncidentActionItemListDataItem]): + data (list['IncidentActionItemListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentActionItemListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentActionItemListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_action_item_list = cls( data=data, diff --git a/rootly_sdk/models/incident_action_item_list_data_item.py b/rootly_sdk/models/incident_action_item_list_data_item.py index ce06e3de..99e97c67 100644 --- a/rootly_sdk/models/incident_action_item_list_data_item.py +++ b/rootly_sdk/models/incident_action_item_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentActionItemListDataItem: id: str type_: IncidentActionItemListDataItemType - attributes: IncidentActionItem + attributes: "IncidentActionItem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_action_item_response.py b/rootly_sdk/models/incident_action_item_response.py index 02edb2d1..a6bfaa1a 100644 --- a/rootly_sdk/models/incident_action_item_response.py +++ b/rootly_sdk/models/incident_action_item_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentActionItemResponse: """ Attributes: data (IncidentActionItemResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentActionItemResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentActionItemResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentActionItemResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_action_item_response = cls( data=data, diff --git a/rootly_sdk/models/incident_action_item_response_data.py b/rootly_sdk/models/incident_action_item_response_data.py index 6a0ef40e..c21de0b4 100644 --- a/rootly_sdk/models/incident_action_item_response_data.py +++ b/rootly_sdk/models/incident_action_item_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentActionItemResponseData: id: str type_: IncidentActionItemResponseDataType - attributes: IncidentActionItem + attributes: "IncidentActionItem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_cancelled_by_type_0.py b/rootly_sdk/models/incident_cancelled_by_type_0.py index 0e7a89aa..12d1b454 100644 --- a/rootly_sdk/models/incident_cancelled_by_type_0.py +++ b/rootly_sdk/models/incident_cancelled_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentCancelledByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_closed_by_type_0.py b/rootly_sdk/models/incident_closed_by_type_0.py index 27fb3bfc..71d3c34a 100644 --- a/rootly_sdk/models/incident_closed_by_type_0.py +++ b/rootly_sdk/models/incident_closed_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentClosedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_custom_field_selection.py b/rootly_sdk/models/incident_custom_field_selection.py index 8fb65665..d1a07a29 100644 --- a/rootly_sdk/models/incident_custom_field_selection.py +++ b/rootly_sdk/models/incident_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,16 +13,16 @@ class IncidentCustomFieldSelection: """ Attributes: - value (None | str): The value of the incident_custom_field_selection + value (Union[None, str]): The value of the incident_custom_field_selection selected_option_ids (list[int]): - incident_id (str | Unset): - custom_field_id (int | Unset): + incident_id (Union[Unset, str]): + custom_field_id (Union[Unset, int]): """ value: None | str selected_option_ids: list[int] - incident_id: str | Unset = UNSET - custom_field_id: int | Unset = UNSET + incident_id: Unset | str = UNSET + custom_field_id: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_custom_field_selection_list.py b/rootly_sdk/models/incident_custom_field_selection_list.py index da3943db..e43b5ed7 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list.py +++ b/rootly_sdk/models/incident_custom_field_selection_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentCustomFieldSelectionList: """ Attributes: - data (list[IncidentCustomFieldSelectionListDataItem]): + data (list['IncidentCustomFieldSelectionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentCustomFieldSelectionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentCustomFieldSelectionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_custom_field_selection_list = cls( data=data, diff --git a/rootly_sdk/models/incident_custom_field_selection_list_data_item.py b/rootly_sdk/models/incident_custom_field_selection_list_data_item.py index 699bb419..33a38024 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list_data_item.py +++ b/rootly_sdk/models/incident_custom_field_selection_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentCustomFieldSelectionListDataItem: id: str type_: IncidentCustomFieldSelectionListDataItemType - attributes: IncidentCustomFieldSelection + attributes: "IncidentCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_custom_field_selection_response.py b/rootly_sdk/models/incident_custom_field_selection_response.py index 2f0b51f0..a9b02f9c 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response.py +++ b/rootly_sdk/models/incident_custom_field_selection_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentCustomFieldSelectionResponse: """ Attributes: data (IncidentCustomFieldSelectionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentCustomFieldSelectionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentCustomFieldSelectionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentCustomFieldSelectionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_custom_field_selection_response = cls( data=data, diff --git a/rootly_sdk/models/incident_custom_field_selection_response_data.py b/rootly_sdk/models/incident_custom_field_selection_response_data.py index 7648082d..9ef29384 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response_data.py +++ b/rootly_sdk/models/incident_custom_field_selection_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentCustomFieldSelectionResponseData: id: str type_: IncidentCustomFieldSelectionResponseDataType - attributes: IncidentCustomFieldSelection + attributes: "IncidentCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event.py b/rootly_sdk/models/incident_event.py index 0f1d3de6..0b4a0f1a 100644 --- a/rootly_sdk/models/incident_event.py +++ b/rootly_sdk/models/incident_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,14 +18,14 @@ class IncidentEvent: occurred_at (str): Date of occurence created_at (str): Date of creation updated_at (str): Date of last update - visibility (IncidentEventVisibility | Unset): The visibility of the incident action item + visibility (Union[Unset, IncidentEventVisibility]): The visibility of the incident action item """ event: str occurred_at: str created_at: str updated_at: str - visibility: IncidentEventVisibility | Unset = UNSET + visibility: Unset | IncidentEventVisibility = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - visibility: str | Unset = UNSET + visibility: Unset | str = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _visibility = d.pop("visibility", UNSET) - visibility: IncidentEventVisibility | Unset + visibility: Unset | IncidentEventVisibility if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/incident_event_functionality.py b/rootly_sdk/models/incident_event_functionality.py index 2283fbd7..9bbee28a 100644 --- a/rootly_sdk/models/incident_event_functionality.py +++ b/rootly_sdk/models/incident_event_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_event_functionality_list.py b/rootly_sdk/models/incident_event_functionality_list.py index eb338790..54d1a8ed 100644 --- a/rootly_sdk/models/incident_event_functionality_list.py +++ b/rootly_sdk/models/incident_event_functionality_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentEventFunctionalityList: """ Attributes: - data (list[IncidentEventFunctionalityListDataItem]): + data (list['IncidentEventFunctionalityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentEventFunctionalityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentEventFunctionalityListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_functionality_list = cls( data=data, diff --git a/rootly_sdk/models/incident_event_functionality_list_data_item.py b/rootly_sdk/models/incident_event_functionality_list_data_item.py index 3c9b49cc..aaa8b50f 100644 --- a/rootly_sdk/models/incident_event_functionality_list_data_item.py +++ b/rootly_sdk/models/incident_event_functionality_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventFunctionalityListDataItem: id: str type_: IncidentEventFunctionalityListDataItemType - attributes: IncidentEventFunctionality + attributes: "IncidentEventFunctionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_functionality_response.py b/rootly_sdk/models/incident_event_functionality_response.py index 6f00656f..df64b5a3 100644 --- a/rootly_sdk/models/incident_event_functionality_response.py +++ b/rootly_sdk/models/incident_event_functionality_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentEventFunctionalityResponse: """ Attributes: data (IncidentEventFunctionalityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentEventFunctionalityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentEventFunctionalityResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentEventFunctionalityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_functionality_response = cls( data=data, diff --git a/rootly_sdk/models/incident_event_functionality_response_data.py b/rootly_sdk/models/incident_event_functionality_response_data.py index 76ca707a..41215a06 100644 --- a/rootly_sdk/models/incident_event_functionality_response_data.py +++ b/rootly_sdk/models/incident_event_functionality_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventFunctionalityResponseData: id: str type_: IncidentEventFunctionalityResponseDataType - attributes: IncidentEventFunctionality + attributes: "IncidentEventFunctionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_list.py b/rootly_sdk/models/incident_event_list.py index 10bdd165..de72b0b5 100644 --- a/rootly_sdk/models/incident_event_list.py +++ b/rootly_sdk/models/incident_event_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentEventList: """ Attributes: - data (list[IncidentEventListDataItem]): + data (list['IncidentEventListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentEventListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentEventListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_list = cls( data=data, diff --git a/rootly_sdk/models/incident_event_list_data_item.py b/rootly_sdk/models/incident_event_list_data_item.py index 40a5cfc6..c895c45b 100644 --- a/rootly_sdk/models/incident_event_list_data_item.py +++ b/rootly_sdk/models/incident_event_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventListDataItem: id: str type_: IncidentEventListDataItemType - attributes: IncidentEvent + attributes: "IncidentEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_response.py b/rootly_sdk/models/incident_event_response.py index 13afb6a3..32ea9040 100644 --- a/rootly_sdk/models/incident_event_response.py +++ b/rootly_sdk/models/incident_event_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentEventResponse: """ Attributes: data (IncidentEventResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentEventResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentEventResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentEventResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_response = cls( data=data, diff --git a/rootly_sdk/models/incident_event_response_data.py b/rootly_sdk/models/incident_event_response_data.py index e276e0a7..0f415f3f 100644 --- a/rootly_sdk/models/incident_event_response_data.py +++ b/rootly_sdk/models/incident_event_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventResponseData: id: str type_: IncidentEventResponseDataType - attributes: IncidentEvent + attributes: "IncidentEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_service.py b/rootly_sdk/models/incident_event_service.py index 1353bf73..163037e9 100644 --- a/rootly_sdk/models/incident_event_service.py +++ b/rootly_sdk/models/incident_event_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_event_service_list.py b/rootly_sdk/models/incident_event_service_list.py index d23a4196..4b620aab 100644 --- a/rootly_sdk/models/incident_event_service_list.py +++ b/rootly_sdk/models/incident_event_service_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentEventServiceList: """ Attributes: - data (list[IncidentEventServiceListDataItem]): + data (list['IncidentEventServiceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentEventServiceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentEventServiceListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_service_list = cls( data=data, diff --git a/rootly_sdk/models/incident_event_service_list_data_item.py b/rootly_sdk/models/incident_event_service_list_data_item.py index ac443528..64783455 100644 --- a/rootly_sdk/models/incident_event_service_list_data_item.py +++ b/rootly_sdk/models/incident_event_service_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventServiceListDataItem: id: str type_: IncidentEventServiceListDataItemType - attributes: IncidentEventService + attributes: "IncidentEventService" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_service_response.py b/rootly_sdk/models/incident_event_service_response.py index ddb7faf7..a0abbb81 100644 --- a/rootly_sdk/models/incident_event_service_response.py +++ b/rootly_sdk/models/incident_event_service_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentEventServiceResponse: """ Attributes: data (IncidentEventServiceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentEventServiceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentEventServiceResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentEventServiceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_service_response = cls( data=data, diff --git a/rootly_sdk/models/incident_event_service_response_data.py b/rootly_sdk/models/incident_event_service_response_data.py index f1c45109..c684683c 100644 --- a/rootly_sdk/models/incident_event_service_response_data.py +++ b/rootly_sdk/models/incident_event_service_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventServiceResponseData: id: str type_: IncidentEventServiceResponseDataType - attributes: IncidentEventService + attributes: "IncidentEventService" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_feedback.py b/rootly_sdk/models/incident_feedback.py index 4ea237d8..f047ab5e 100644 --- a/rootly_sdk/models/incident_feedback.py +++ b/rootly_sdk/models/incident_feedback.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_feedback_list.py b/rootly_sdk/models/incident_feedback_list.py index 06f51a82..43c7dfb8 100644 --- a/rootly_sdk/models/incident_feedback_list.py +++ b/rootly_sdk/models/incident_feedback_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentFeedbackList: """ Attributes: - data (list[IncidentFeedbackListDataItem]): + data (list['IncidentFeedbackListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentFeedbackListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentFeedbackListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_feedback_list = cls( data=data, diff --git a/rootly_sdk/models/incident_feedback_list_data_item.py b/rootly_sdk/models/incident_feedback_list_data_item.py index 90c09921..f1be8b2d 100644 --- a/rootly_sdk/models/incident_feedback_list_data_item.py +++ b/rootly_sdk/models/incident_feedback_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFeedbackListDataItem: id: str type_: IncidentFeedbackListDataItemType - attributes: IncidentFeedback + attributes: "IncidentFeedback" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_feedback_response.py b/rootly_sdk/models/incident_feedback_response.py index 11592806..62f27c11 100644 --- a/rootly_sdk/models/incident_feedback_response.py +++ b/rootly_sdk/models/incident_feedback_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentFeedbackResponse: """ Attributes: data (IncidentFeedbackResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentFeedbackResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentFeedbackResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentFeedbackResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_feedback_response = cls( data=data, diff --git a/rootly_sdk/models/incident_feedback_response_data.py b/rootly_sdk/models/incident_feedback_response_data.py index a152326c..59b31f61 100644 --- a/rootly_sdk/models/incident_feedback_response_data.py +++ b/rootly_sdk/models/incident_feedback_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFeedbackResponseData: id: str type_: IncidentFeedbackResponseDataType - attributes: IncidentFeedback + attributes: "IncidentFeedback" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_form_field_selection.py b/rootly_sdk/models/incident_form_field_selection.py index 546b0afb..97ee3216 100644 --- a/rootly_sdk/models/incident_form_field_selection.py +++ b/rootly_sdk/models/incident_form_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,30 +15,30 @@ class IncidentFormFieldSelection: Attributes: incident_id (str): form_field_id (str): The custom field for this selection - value (None | str | Unset): The selected value for text kind custom fields - selected_catalog_entity_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_environment_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ incident_id: str form_field_id: str - value: None | str | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,45 +46,45 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -128,12 +126,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id") - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/incident_form_field_selection_list.py b/rootly_sdk/models/incident_form_field_selection_list.py index 01551dd3..f16f722a 100644 --- a/rootly_sdk/models/incident_form_field_selection_list.py +++ b/rootly_sdk/models/incident_form_field_selection_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentFormFieldSelectionList: """ Attributes: - data (list[IncidentFormFieldSelectionListDataItem]): + data (list['IncidentFormFieldSelectionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentFormFieldSelectionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentFormFieldSelectionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_form_field_selection_list = cls( data=data, diff --git a/rootly_sdk/models/incident_form_field_selection_list_data_item.py b/rootly_sdk/models/incident_form_field_selection_list_data_item.py index 009d5fca..2de7ef35 100644 --- a/rootly_sdk/models/incident_form_field_selection_list_data_item.py +++ b/rootly_sdk/models/incident_form_field_selection_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFormFieldSelectionListDataItem: id: str type_: IncidentFormFieldSelectionListDataItemType - attributes: IncidentFormFieldSelection + attributes: "IncidentFormFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_form_field_selection_response.py b/rootly_sdk/models/incident_form_field_selection_response.py index ee4c86c0..b7e4c36f 100644 --- a/rootly_sdk/models/incident_form_field_selection_response.py +++ b/rootly_sdk/models/incident_form_field_selection_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentFormFieldSelectionResponse: """ Attributes: data (IncidentFormFieldSelectionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentFormFieldSelectionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentFormFieldSelectionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentFormFieldSelectionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_form_field_selection_response = cls( data=data, diff --git a/rootly_sdk/models/incident_form_field_selection_response_data.py b/rootly_sdk/models/incident_form_field_selection_response_data.py index 0054ff14..b10a39c7 100644 --- a/rootly_sdk/models/incident_form_field_selection_response_data.py +++ b/rootly_sdk/models/incident_form_field_selection_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFormFieldSelectionResponseData: id: str type_: IncidentFormFieldSelectionResponseDataType - attributes: IncidentFormFieldSelection + attributes: "IncidentFormFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_in_triage_by_type_0.py b/rootly_sdk/models/incident_in_triage_by_type_0.py index d9e70a76..5882e668 100644 --- a/rootly_sdk/models/incident_in_triage_by_type_0.py +++ b/rootly_sdk/models/incident_in_triage_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentInTriageByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_labels_type_0.py b/rootly_sdk/models/incident_labels_type_0.py index 44337a9d..8d2f88e9 100644 --- a/rootly_sdk/models/incident_labels_type_0.py +++ b/rootly_sdk/models/incident_labels_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentLabelsType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_list.py b/rootly_sdk/models/incident_list.py index f5784afc..da1fff97 100644 --- a/rootly_sdk/models/incident_list.py +++ b/rootly_sdk/models/incident_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentList: """ Attributes: - data (list[IncidentListDataItem]): + data (list['IncidentListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_list = cls( data=data, diff --git a/rootly_sdk/models/incident_list_data_item.py b/rootly_sdk/models/incident_list_data_item.py index 51547f46..babda31a 100644 --- a/rootly_sdk/models/incident_list_data_item.py +++ b/rootly_sdk/models/incident_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class IncidentListDataItem: id: str type_: IncidentListDataItemType - attributes: Incident + attributes: "Incident" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_mitigated_by_type_0.py b/rootly_sdk/models/incident_mitigated_by_type_0.py index cb9cdf55..78045edb 100644 --- a/rootly_sdk/models/incident_mitigated_by_type_0.py +++ b/rootly_sdk/models/incident_mitigated_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentMitigatedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_permission_set.py b/rootly_sdk/models/incident_permission_set.py index ea4d766a..ca9eaaf7 100644 --- a/rootly_sdk/models/incident_permission_set.py +++ b/rootly_sdk/models/incident_permission_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,19 +24,19 @@ class IncidentPermissionSet: name (str): The incident permission set name. created_at (str): updated_at (str): - slug (str | Unset): The incident permission set slug. - description (None | str | Unset): The incident permission set description. - private_incident_permissions (list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset): - public_incident_permissions (list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset): + slug (Union[Unset, str]): The incident permission set slug. + description (Union[None, Unset, str]): The incident permission set description. + private_incident_permissions (Union[Unset, list[IncidentPermissionSetPrivateIncidentPermissionsItem]]): + public_incident_permissions (Union[Unset, list[IncidentPermissionSetPublicIncidentPermissionsItem]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - private_incident_permissions: list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset = UNSET - public_incident_permissions: list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + private_incident_permissions: Unset | list[IncidentPermissionSetPrivateIncidentPermissionsItem] = UNSET + public_incident_permissions: Unset | list[IncidentPermissionSetPublicIncidentPermissionsItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,20 +48,20 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: list[str] | Unset = UNSET + private_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: list[str] | Unset = UNSET + public_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -101,36 +99,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - private_incident_permissions: list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset = UNSET - if _private_incident_permissions is not UNSET: - private_incident_permissions = [] - for private_incident_permissions_item_data in _private_incident_permissions: - private_incident_permissions_item = check_incident_permission_set_private_incident_permissions_item( - private_incident_permissions_item_data - ) + for private_incident_permissions_item_data in _private_incident_permissions or []: + private_incident_permissions_item = check_incident_permission_set_private_incident_permissions_item( + private_incident_permissions_item_data + ) - private_incident_permissions.append(private_incident_permissions_item) + private_incident_permissions.append(private_incident_permissions_item) + public_incident_permissions = [] _public_incident_permissions = d.pop("public_incident_permissions", UNSET) - public_incident_permissions: list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset = UNSET - if _public_incident_permissions is not UNSET: - public_incident_permissions = [] - for public_incident_permissions_item_data in _public_incident_permissions: - public_incident_permissions_item = check_incident_permission_set_public_incident_permissions_item( - public_incident_permissions_item_data - ) + for public_incident_permissions_item_data in _public_incident_permissions or []: + public_incident_permissions_item = check_incident_permission_set_public_incident_permissions_item( + public_incident_permissions_item_data + ) - public_incident_permissions.append(public_incident_permissions_item) + public_incident_permissions.append(public_incident_permissions_item) incident_permission_set = cls( name=name, diff --git a/rootly_sdk/models/incident_permission_set_boolean.py b/rootly_sdk/models/incident_permission_set_boolean.py index 681230c8..a61795ab 100644 --- a/rootly_sdk/models/incident_permission_set_boolean.py +++ b/rootly_sdk/models/incident_permission_set_boolean.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -22,17 +20,17 @@ class IncidentPermissionSetBoolean: kind (IncidentPermissionSetBooleanKind): created_at (str): updated_at (str): - incident_permission_set_id (str | Unset): - private (bool | Unset): - enabled (bool | Unset): + incident_permission_set_id (Union[Unset, str]): + private (Union[Unset, bool]): + enabled (Union[Unset, bool]): """ kind: IncidentPermissionSetBooleanKind created_at: str updated_at: str - incident_permission_set_id: str | Unset = UNSET - private: bool | Unset = UNSET - enabled: bool | Unset = UNSET + incident_permission_set_id: Unset | str = UNSET + private: Unset | bool = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_permission_set_boolean_list.py b/rootly_sdk/models/incident_permission_set_boolean_list.py index 311b960e..aaf3a5d4 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentPermissionSetBooleanList: """ Attributes: - data (list[IncidentPermissionSetBooleanListDataItem]): + data (list['IncidentPermissionSetBooleanListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPermissionSetBooleanListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPermissionSetBooleanListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_boolean_list = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py b/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py index 9297d83e..89085db4 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetBooleanListDataItem: id: str type_: IncidentPermissionSetBooleanListDataItemType - attributes: IncidentPermissionSetBoolean + attributes: "IncidentPermissionSetBoolean" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_boolean_response.py b/rootly_sdk/models/incident_permission_set_boolean_response.py index ec8e91de..4400150a 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentPermissionSetBooleanResponse: """ Attributes: data (IncidentPermissionSetBooleanResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPermissionSetBooleanResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPermissionSetBooleanResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPermissionSetBooleanResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_boolean_response = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_boolean_response_data.py b/rootly_sdk/models/incident_permission_set_boolean_response_data.py index 1c20c8e0..a1e629fc 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response_data.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetBooleanResponseData: id: str type_: IncidentPermissionSetBooleanResponseDataType - attributes: IncidentPermissionSetBoolean + attributes: "IncidentPermissionSetBoolean" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_list.py b/rootly_sdk/models/incident_permission_set_list.py index 4330dfc6..d847ecac 100644 --- a/rootly_sdk/models/incident_permission_set_list.py +++ b/rootly_sdk/models/incident_permission_set_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentPermissionSetList: """ Attributes: - data (list[IncidentPermissionSetListDataItem]): + data (list['IncidentPermissionSetListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPermissionSetListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPermissionSetListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_list = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_list_data_item.py b/rootly_sdk/models/incident_permission_set_list_data_item.py index 33f81a19..f6498f4d 100644 --- a/rootly_sdk/models/incident_permission_set_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetListDataItem: id: str type_: IncidentPermissionSetListDataItemType - attributes: IncidentPermissionSet + attributes: "IncidentPermissionSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_resource.py b/rootly_sdk/models/incident_permission_set_resource.py index 301cd270..9a6e6ccd 100644 --- a/rootly_sdk/models/incident_permission_set_resource.py +++ b/rootly_sdk/models/incident_permission_set_resource.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,18 +21,18 @@ class IncidentPermissionSetResource: kind (IncidentPermissionSetResourceKind): created_at (str): updated_at (str): - private (bool | Unset): - resource_id (str | Unset): - resource_type (str | Unset): + private (Union[Unset, bool]): + resource_id (Union[Unset, str]): + resource_type (Union[Unset, str]): """ incident_permission_set_id: str kind: IncidentPermissionSetResourceKind created_at: str updated_at: str - private: bool | Unset = UNSET - resource_id: str | Unset = UNSET - resource_type: str | Unset = UNSET + private: Unset | bool = UNSET + resource_id: Unset | str = UNSET + resource_type: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_permission_set_resource_list.py b/rootly_sdk/models/incident_permission_set_resource_list.py index 870d831f..4ea3383e 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list.py +++ b/rootly_sdk/models/incident_permission_set_resource_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentPermissionSetResourceList: """ Attributes: - data (list[IncidentPermissionSetResourceListDataItem]): + data (list['IncidentPermissionSetResourceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPermissionSetResourceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPermissionSetResourceListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_resource_list = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_resource_list_data_item.py b/rootly_sdk/models/incident_permission_set_resource_list_data_item.py index 83bca676..118d6aa1 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_resource_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetResourceListDataItem: id: str type_: IncidentPermissionSetResourceListDataItemType - attributes: IncidentPermissionSetResource + attributes: "IncidentPermissionSetResource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_resource_response.py b/rootly_sdk/models/incident_permission_set_resource_response.py index 6808e8b3..fc0bb33c 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response.py +++ b/rootly_sdk/models/incident_permission_set_resource_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentPermissionSetResourceResponse: """ Attributes: data (IncidentPermissionSetResourceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPermissionSetResourceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPermissionSetResourceResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPermissionSetResourceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_resource_response = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_resource_response_data.py b/rootly_sdk/models/incident_permission_set_resource_response_data.py index 8e10e6a6..4120859c 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response_data.py +++ b/rootly_sdk/models/incident_permission_set_resource_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetResourceResponseData: id: str type_: IncidentPermissionSetResourceResponseDataType - attributes: IncidentPermissionSetResource + attributes: "IncidentPermissionSetResource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_response.py b/rootly_sdk/models/incident_permission_set_response.py index ea4b325f..f777d861 100644 --- a/rootly_sdk/models/incident_permission_set_response.py +++ b/rootly_sdk/models/incident_permission_set_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentPermissionSetResponse: """ Attributes: data (IncidentPermissionSetResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPermissionSetResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPermissionSetResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPermissionSetResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_response = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_response_data.py b/rootly_sdk/models/incident_permission_set_response_data.py index d4248f2c..239d598f 100644 --- a/rootly_sdk/models/incident_permission_set_response_data.py +++ b/rootly_sdk/models/incident_permission_set_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetResponseData: id: str type_: IncidentPermissionSetResponseDataType - attributes: IncidentPermissionSet + attributes: "IncidentPermissionSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_post_mortem.py b/rootly_sdk/models/incident_post_mortem.py index b3798e39..73b656dc 100644 --- a/rootly_sdk/models/incident_post_mortem.py +++ b/rootly_sdk/models/incident_post_mortem.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,44 +21,44 @@ class IncidentPostMortem: title (str): The title of the incident retrospective created_at (str): Date of creation updated_at (str): Date of last update - content (None | str | Unset): The content of the incident retrospective (Only if internal) - status (IncidentPostMortemStatus | Unset): The status of the incident retrospective - started_at (None | str | Unset): Date of started at - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - show_timeline (bool | Unset): Show events timeline of the incident retrospective - show_timeline_trail (bool | Unset): Show trail events in the timeline of the incident retrospective - show_timeline_genius (bool | Unset): Show workflow events in the timeline of the incident retrospective - show_timeline_tasks (bool | Unset): Show tasks in the timeline of the incident retrospective - show_timeline_action_items (bool | Unset): Show action items in the timeline of the incident retrospective - show_timeline_order (IncidentPostMortemShowTimelineOrder | Unset): The order of the incident retrospective + content (Union[None, Unset, str]): The content of the incident retrospective (Only if internal) + status (Union[Unset, IncidentPostMortemStatus]): The status of the incident retrospective + started_at (Union[None, Unset, str]): Date of started at + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + show_timeline (Union[Unset, bool]): Show events timeline of the incident retrospective + show_timeline_trail (Union[Unset, bool]): Show trail events in the timeline of the incident retrospective + show_timeline_genius (Union[Unset, bool]): Show workflow events in the timeline of the incident retrospective + show_timeline_tasks (Union[Unset, bool]): Show tasks in the timeline of the incident retrospective + show_timeline_action_items (Union[Unset, bool]): Show action items in the timeline of the incident retrospective + show_timeline_order (Union[Unset, IncidentPostMortemShowTimelineOrder]): The order of the incident retrospective timeline Default: 'desc'. - show_services_impacted (bool | Unset): Show functionalities impacted of the incident retrospective - show_functionalities_impacted (bool | Unset): Show services impacted of the incident retrospective - show_groups_impacted (bool | Unset): Show groups impacted of the incident retrospective - show_alerts_attached (bool | Unset): Show alerts attached to the incident - url (str | Unset): The url to the incident retrospective + show_services_impacted (Union[Unset, bool]): Show functionalities impacted of the incident retrospective + show_functionalities_impacted (Union[Unset, bool]): Show services impacted of the incident retrospective + show_groups_impacted (Union[Unset, bool]): Show groups impacted of the incident retrospective + show_alerts_attached (Union[Unset, bool]): Show alerts attached to the incident + url (Union[Unset, str]): The url to the incident retrospective """ title: str created_at: str updated_at: str - content: None | str | Unset = UNSET - status: IncidentPostMortemStatus | Unset = UNSET - started_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - show_timeline: bool | Unset = UNSET - show_timeline_trail: bool | Unset = UNSET - show_timeline_genius: bool | Unset = UNSET - show_timeline_tasks: bool | Unset = UNSET - show_timeline_action_items: bool | Unset = UNSET - show_timeline_order: IncidentPostMortemShowTimelineOrder | Unset = "desc" - show_services_impacted: bool | Unset = UNSET - show_functionalities_impacted: bool | Unset = UNSET - show_groups_impacted: bool | Unset = UNSET - show_alerts_attached: bool | Unset = UNSET - url: str | Unset = UNSET + content: None | Unset | str = UNSET + status: Unset | IncidentPostMortemStatus = UNSET + started_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + show_timeline: Unset | bool = UNSET + show_timeline_trail: Unset | bool = UNSET + show_timeline_genius: Unset | bool = UNSET + show_timeline_tasks: Unset | bool = UNSET + show_timeline_action_items: Unset | bool = UNSET + show_timeline_order: Unset | IncidentPostMortemShowTimelineOrder = "desc" + show_services_impacted: Unset | bool = UNSET + show_functionalities_impacted: Unset | bool = UNSET + show_groups_impacted: Unset | bool = UNSET + show_alerts_attached: Unset | bool = UNSET + url: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -70,29 +68,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - content: None | str | Unset + content: None | Unset | str if isinstance(self.content, Unset): content = UNSET else: content = self.content - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: None | str | Unset + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -108,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: show_timeline_action_items = self.show_timeline_action_items - show_timeline_order: str | Unset = UNSET + show_timeline_order: Unset | str = UNSET if not isinstance(self.show_timeline_order, Unset): show_timeline_order = self.show_timeline_order @@ -175,46 +173,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_content(data: object) -> None | str | Unset: + def _parse_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) content = _parse_content(d.pop("content", UNSET)) _status = d.pop("status", UNSET) - status: IncidentPostMortemStatus | Unset + status: Unset | IncidentPostMortemStatus if isinstance(_status, Unset): status = UNSET else: status = check_incident_post_mortem_status(_status) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -229,7 +227,7 @@ def _parse_resolved_at(data: object) -> None | str | Unset: show_timeline_action_items = d.pop("show_timeline_action_items", UNSET) _show_timeline_order = d.pop("show_timeline_order", UNSET) - show_timeline_order: IncidentPostMortemShowTimelineOrder | Unset + show_timeline_order: Unset | IncidentPostMortemShowTimelineOrder if isinstance(_show_timeline_order, Unset): show_timeline_order = UNSET else: diff --git a/rootly_sdk/models/incident_post_mortem_list.py b/rootly_sdk/models/incident_post_mortem_list.py index 0fdca1ee..f7efcaa0 100644 --- a/rootly_sdk/models/incident_post_mortem_list.py +++ b/rootly_sdk/models/incident_post_mortem_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentPostMortemList: """ Attributes: - data (list[IncidentPostMortemListDataItem]): + data (list['IncidentPostMortemListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPostMortemListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPostMortemListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_post_mortem_list = cls( data=data, diff --git a/rootly_sdk/models/incident_post_mortem_list_data_item.py b/rootly_sdk/models/incident_post_mortem_list_data_item.py index 55d07674..83ac4c56 100644 --- a/rootly_sdk/models/incident_post_mortem_list_data_item.py +++ b/rootly_sdk/models/incident_post_mortem_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPostMortemListDataItem: id: str type_: IncidentPostMortemListDataItemType - attributes: IncidentPostMortem + attributes: "IncidentPostMortem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_post_mortem_response.py b/rootly_sdk/models/incident_post_mortem_response.py index c76380cb..1a0c29ab 100644 --- a/rootly_sdk/models/incident_post_mortem_response.py +++ b/rootly_sdk/models/incident_post_mortem_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentPostMortemResponse: """ Attributes: data (IncidentPostMortemResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPostMortemResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPostMortemResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPostMortemResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_post_mortem_response = cls( data=data, diff --git a/rootly_sdk/models/incident_post_mortem_response_data.py b/rootly_sdk/models/incident_post_mortem_response_data.py index 0fb9cf28..c32b822e 100644 --- a/rootly_sdk/models/incident_post_mortem_response_data.py +++ b/rootly_sdk/models/incident_post_mortem_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPostMortemResponseData: id: str type_: IncidentPostMortemResponseDataType - attributes: IncidentPostMortem + attributes: "IncidentPostMortem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_resolved_by_type_0.py b/rootly_sdk/models/incident_resolved_by_type_0.py index 053c1026..6b8abbc3 100644 --- a/rootly_sdk/models/incident_resolved_by_type_0.py +++ b/rootly_sdk/models/incident_resolved_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentResolvedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_response.py b/rootly_sdk/models/incident_response.py index b865456f..e77f749c 100644 --- a/rootly_sdk/models/incident_response.py +++ b/rootly_sdk/models/incident_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentResponse: """ Attributes: data (IncidentResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_response = cls( data=data, diff --git a/rootly_sdk/models/incident_response_data.py b/rootly_sdk/models/incident_response_data.py index 99133947..e36fbd3f 100644 --- a/rootly_sdk/models/incident_response_data.py +++ b/rootly_sdk/models/incident_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class IncidentResponseData: id: str type_: IncidentResponseDataType - attributes: Incident + attributes: "Incident" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_retrospective_step.py b/rootly_sdk/models/incident_retrospective_step.py index 96dca873..bdd48caa 100644 --- a/rootly_sdk/models/incident_retrospective_step.py +++ b/rootly_sdk/models/incident_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,12 +22,12 @@ class IncidentRetrospectiveStep: title (str): The name of the step created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of the step - status (IncidentRetrospectiveStepStatus | Unset): Status of the incident retrospective step - kind (None | str | Unset): Due date - due_date (None | str | Unset): Due date - position (int | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + description (Union[None, Unset, str]): The description of the step + status (Union[Unset, IncidentRetrospectiveStepStatus]): Status of the incident retrospective step + kind (Union[None, Unset, str]): Due date + due_date (Union[None, Unset, str]): Due date + position (Union[Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ retrospective_step_id: str @@ -37,12 +35,12 @@ class IncidentRetrospectiveStep: title: str created_at: str updated_at: str - description: None | str | Unset = UNSET - status: IncidentRetrospectiveStepStatus | Unset = UNSET - kind: None | str | Unset = UNSET - due_date: None | str | Unset = UNSET - position: int | Unset = UNSET - skippable: bool | Unset = UNSET + description: None | Unset | str = UNSET + status: Unset | IncidentRetrospectiveStepStatus = UNSET + kind: None | Unset | str = UNSET + due_date: None | Unset | str = UNSET + position: Unset | int = UNSET + skippable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,23 +54,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - kind: None | str | Unset + kind: None | Unset | str if isinstance(self.kind, Unset): kind = UNSET else: kind = self.kind - due_date: None | str | Unset + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: @@ -121,37 +119,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: IncidentRetrospectiveStepStatus | Unset + status: Unset | IncidentRetrospectiveStepStatus if isinstance(_status, Unset): status = UNSET else: status = check_incident_retrospective_step_status(_status) - def _parse_kind(data: object) -> None | str | Unset: + def _parse_kind(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind = _parse_kind(d.pop("kind", UNSET)) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) diff --git a/rootly_sdk/models/incident_retrospective_step_response.py b/rootly_sdk/models/incident_retrospective_step_response.py index 1459b399..a30d5e05 100644 --- a/rootly_sdk/models/incident_retrospective_step_response.py +++ b/rootly_sdk/models/incident_retrospective_step_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentRetrospectiveStepResponse: """ Attributes: data (IncidentRetrospectiveStepResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentRetrospectiveStepResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentRetrospectiveStepResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentRetrospectiveStepResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_retrospective_step_response = cls( data=data, diff --git a/rootly_sdk/models/incident_retrospective_step_response_data.py b/rootly_sdk/models/incident_retrospective_step_response_data.py index d8ffeff7..c231054b 100644 --- a/rootly_sdk/models/incident_retrospective_step_response_data.py +++ b/rootly_sdk/models/incident_retrospective_step_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRetrospectiveStepResponseData: id: str type_: IncidentRetrospectiveStepResponseDataType - attributes: IncidentRetrospectiveStep + attributes: "IncidentRetrospectiveStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role.py b/rootly_sdk/models/incident_role.py index 9aa66312..c5216257 100644 --- a/rootly_sdk/models/incident_role.py +++ b/rootly_sdk/models/incident_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,25 +16,25 @@ class IncidentRole: name (str): The name of the incident role created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the incident role - summary (None | str | Unset): The summary of the incident role - description (None | str | Unset): The description of the incident role - position (int | None | Unset): Position of the incident role - optional (bool | Unset): - enabled (bool | Unset): - allow_multi_user_assignment (bool | Unset): + slug (Union[Unset, str]): The slug of the incident role + summary (Union[None, Unset, str]): The summary of the incident role + description (Union[None, Unset, str]): The description of the incident role + position (Union[None, Unset, int]): Position of the incident role + optional (Union[Unset, bool]): + enabled (Union[Unset, bool]): + allow_multi_user_assignment (Union[Unset, bool]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - summary: None | str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - optional: bool | Unset = UNSET - enabled: bool | Unset = UNSET - allow_multi_user_assignment: bool | Unset = UNSET + slug: Unset | str = UNSET + summary: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + optional: Unset | bool = UNSET + enabled: Unset | bool = UNSET + allow_multi_user_assignment: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -109,30 +107,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/incident_role_list.py b/rootly_sdk/models/incident_role_list.py index 22dc9520..1f71ce7f 100644 --- a/rootly_sdk/models/incident_role_list.py +++ b/rootly_sdk/models/incident_role_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentRoleList: """ Attributes: - data (list[IncidentRoleListDataItem]): + data (list['IncidentRoleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentRoleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentRoleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_list = cls( data=data, diff --git a/rootly_sdk/models/incident_role_list_data_item.py b/rootly_sdk/models/incident_role_list_data_item.py index 4ac3dd10..c736b804 100644 --- a/rootly_sdk/models/incident_role_list_data_item.py +++ b/rootly_sdk/models/incident_role_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleListDataItem: id: str type_: IncidentRoleListDataItemType - attributes: IncidentRole + attributes: "IncidentRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role_response.py b/rootly_sdk/models/incident_role_response.py index 03c42298..6a7cd413 100644 --- a/rootly_sdk/models/incident_role_response.py +++ b/rootly_sdk/models/incident_role_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentRoleResponse: """ Attributes: data (IncidentRoleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentRoleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentRoleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentRoleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_response = cls( data=data, diff --git a/rootly_sdk/models/incident_role_response_data.py b/rootly_sdk/models/incident_role_response_data.py index 94d09f13..9b1a5e16 100644 --- a/rootly_sdk/models/incident_role_response_data.py +++ b/rootly_sdk/models/incident_role_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleResponseData: id: str type_: IncidentRoleResponseDataType - attributes: IncidentRole + attributes: "IncidentRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role_task.py b/rootly_sdk/models/incident_role_task.py index 5d7c3c97..16646549 100644 --- a/rootly_sdk/models/incident_role_task.py +++ b/rootly_sdk/models/incident_role_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,17 +17,17 @@ class IncidentRoleTask: task (str): The task of the incident task created_at (str): Date of creation updated_at (str): Date of last update - incident_role_id (str | Unset): - description (None | str | Unset): The description of incident task - priority (IncidentRoleTaskPriority | Unset): The priority of the incident task + incident_role_id (Union[Unset, str]): + description (Union[None, Unset, str]): The description of incident task + priority (Union[Unset, IncidentRoleTaskPriority]): The priority of the incident task """ task: str created_at: str updated_at: str - incident_role_id: str | Unset = UNSET - description: None | str | Unset = UNSET - priority: IncidentRoleTaskPriority | Unset = UNSET + incident_role_id: Unset | str = UNSET + description: None | Unset | str = UNSET + priority: Unset | IncidentRoleTaskPriority = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,13 +39,13 @@ def to_dict(self) -> dict[str, Any]: incident_role_id = self.incident_role_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -80,17 +78,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: IncidentRoleTaskPriority | Unset + priority: Unset | IncidentRoleTaskPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/incident_role_task_list.py b/rootly_sdk/models/incident_role_task_list.py index 5ef2cf2e..481d26cb 100644 --- a/rootly_sdk/models/incident_role_task_list.py +++ b/rootly_sdk/models/incident_role_task_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentRoleTaskList: """ Attributes: - data (list[IncidentRoleTaskListDataItem]): + data (list['IncidentRoleTaskListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentRoleTaskListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentRoleTaskListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_task_list = cls( data=data, diff --git a/rootly_sdk/models/incident_role_task_list_data_item.py b/rootly_sdk/models/incident_role_task_list_data_item.py index 1821b7a9..708c5a06 100644 --- a/rootly_sdk/models/incident_role_task_list_data_item.py +++ b/rootly_sdk/models/incident_role_task_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleTaskListDataItem: id: str type_: IncidentRoleTaskListDataItemType - attributes: IncidentRoleTask + attributes: "IncidentRoleTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role_task_response.py b/rootly_sdk/models/incident_role_task_response.py index b92385ae..7716f2b0 100644 --- a/rootly_sdk/models/incident_role_task_response.py +++ b/rootly_sdk/models/incident_role_task_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentRoleTaskResponse: """ Attributes: data (IncidentRoleTaskResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentRoleTaskResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentRoleTaskResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentRoleTaskResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_task_response = cls( data=data, diff --git a/rootly_sdk/models/incident_role_task_response_data.py b/rootly_sdk/models/incident_role_task_response_data.py index 7720f509..7fd228aa 100644 --- a/rootly_sdk/models/incident_role_task_response_data.py +++ b/rootly_sdk/models/incident_role_task_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleTaskResponseData: id: str type_: IncidentRoleTaskResponseDataType - attributes: IncidentRoleTask + attributes: "IncidentRoleTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_started_by_type_0.py b/rootly_sdk/models/incident_started_by_type_0.py index 241e922c..5189979b 100644 --- a/rootly_sdk/models/incident_started_by_type_0.py +++ b/rootly_sdk/models/incident_started_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentStartedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_status_page_event.py b/rootly_sdk/models/incident_status_page_event.py index 77bff120..048ce5a7 100644 --- a/rootly_sdk/models/incident_status_page_event.py +++ b/rootly_sdk/models/incident_status_page_event.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -12,6 +10,12 @@ ) from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.incident_status_page_event_status_page_components_item import ( + IncidentStatusPageEventStatusPageComponentsItem, + ) + + T = TypeVar("T", bound="IncidentStatusPageEvent") @@ -23,20 +27,23 @@ class IncidentStatusPageEvent: started_at (str): Date of start created_at (str): Date of creation updated_at (str): Date of last update - status_page_id (str | Unset): Unique ID of the status page you wish to post the event to - status (IncidentStatusPageEventStatus | Unset): The status of the incident event - notify_subscribers (bool | Unset): Notify all status pages subscribers - should_tweet (bool | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update + status_page_id (Union[Unset, str]): Unique ID of the status page you wish to post the event to + status (Union[Unset, IncidentStatusPageEventStatus]): The status of the incident event + notify_subscribers (Union[Unset, bool]): Notify all status pages subscribers + should_tweet (Union[Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your update + status_page_components (Union[Unset, list['IncidentStatusPageEventStatusPageComponentsItem']]): Affected status + page components recorded on the event and their statuses """ event: str started_at: str created_at: str updated_at: str - status_page_id: str | Unset = UNSET - status: IncidentStatusPageEventStatus | Unset = UNSET - notify_subscribers: bool | Unset = UNSET - should_tweet: bool | Unset = UNSET + status_page_id: Unset | str = UNSET + status: Unset | IncidentStatusPageEventStatus = UNSET + notify_subscribers: Unset | bool = UNSET + should_tweet: Unset | bool = UNSET + status_page_components: Unset | list["IncidentStatusPageEventStatusPageComponentsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -58,6 +65,13 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet + status_page_components: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.status_page_components, Unset): + status_page_components = [] + for status_page_components_item_data in self.status_page_components: + status_page_components_item = status_page_components_item_data.to_dict() + status_page_components.append(status_page_components_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -76,11 +90,17 @@ def to_dict(self) -> dict[str, Any]: field_dict["notify_subscribers"] = notify_subscribers if should_tweet is not UNSET: field_dict["should_tweet"] = should_tweet + if status_page_components is not UNSET: + field_dict["status_page_components"] = status_page_components return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.incident_status_page_event_status_page_components_item import ( + IncidentStatusPageEventStatusPageComponentsItem, + ) + d = dict(src_dict) event = d.pop("event") @@ -93,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: IncidentStatusPageEventStatus | Unset + status: Unset | IncidentStatusPageEventStatus if isinstance(_status, Unset): status = UNSET else: @@ -103,6 +123,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: should_tweet = d.pop("should_tweet", UNSET) + status_page_components = [] + _status_page_components = d.pop("status_page_components", UNSET) + for status_page_components_item_data in _status_page_components or []: + status_page_components_item = IncidentStatusPageEventStatusPageComponentsItem.from_dict( + status_page_components_item_data + ) + + status_page_components.append(status_page_components_item) + incident_status_page_event = cls( event=event, started_at=started_at, @@ -112,6 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status=status, notify_subscribers=notify_subscribers, should_tweet=should_tweet, + status_page_components=status_page_components, ) incident_status_page_event.additional_properties = d diff --git a/rootly_sdk/models/incident_status_page_event_list.py b/rootly_sdk/models/incident_status_page_event_list.py index d5b6e98d..73ece2a3 100644 --- a/rootly_sdk/models/incident_status_page_event_list.py +++ b/rootly_sdk/models/incident_status_page_event_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentStatusPageEventList: """ Attributes: - data (list[IncidentStatusPageEventListDataItem]): + data (list['IncidentStatusPageEventListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentStatusPageEventListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentStatusPageEventListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_status_page_event_list = cls( data=data, diff --git a/rootly_sdk/models/incident_status_page_event_list_data_item.py b/rootly_sdk/models/incident_status_page_event_list_data_item.py index 3174294c..6187375a 100644 --- a/rootly_sdk/models/incident_status_page_event_list_data_item.py +++ b/rootly_sdk/models/incident_status_page_event_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentStatusPageEventListDataItem: id: str type_: IncidentStatusPageEventListDataItemType - attributes: IncidentStatusPageEvent + attributes: "IncidentStatusPageEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_status_page_event_response.py b/rootly_sdk/models/incident_status_page_event_response.py index 314ed314..53860c68 100644 --- a/rootly_sdk/models/incident_status_page_event_response.py +++ b/rootly_sdk/models/incident_status_page_event_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentStatusPageEventResponse: """ Attributes: data (IncidentStatusPageEventResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentStatusPageEventResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentStatusPageEventResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentStatusPageEventResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_status_page_event_response = cls( data=data, diff --git a/rootly_sdk/models/incident_status_page_event_response_data.py b/rootly_sdk/models/incident_status_page_event_response_data.py index a0374d05..2a860a98 100644 --- a/rootly_sdk/models/incident_status_page_event_response_data.py +++ b/rootly_sdk/models/incident_status_page_event_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentStatusPageEventResponseData: id: str type_: IncidentStatusPageEventResponseDataType - attributes: IncidentStatusPageEvent + attributes: "IncidentStatusPageEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_status_page_event_status_page_components_item.py b/rootly_sdk/models/incident_status_page_event_status_page_components_item.py new file mode 100644 index 00000000..930468ea --- /dev/null +++ b/rootly_sdk/models/incident_status_page_event_status_page_components_item.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.incident_status_page_event_status_page_components_item_status import ( + IncidentStatusPageEventStatusPageComponentsItemStatus, + check_incident_status_page_event_status_page_components_item_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="IncidentStatusPageEventStatusPageComponentsItem") + + +@_attrs_define +class IncidentStatusPageEventStatusPageComponentsItem: + """ + Attributes: + status_page_component_id (str): Unique ID of a component on the event's status page + status (Union[Unset, IncidentStatusPageEventStatusPageComponentsItemStatus]): The status recorded for the + component + """ + + status_page_component_id: str + status: Unset | IncidentStatusPageEventStatusPageComponentsItemStatus = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_component_id = self.status_page_component_id + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_component_id": status_page_component_id, + } + ) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_component_id = d.pop("status_page_component_id") + + _status = d.pop("status", UNSET) + status: Unset | IncidentStatusPageEventStatusPageComponentsItemStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = check_incident_status_page_event_status_page_components_item_status(_status) + + incident_status_page_event_status_page_components_item = cls( + status_page_component_id=status_page_component_id, + status=status, + ) + + incident_status_page_event_status_page_components_item.additional_properties = d + return incident_status_page_event_status_page_components_item + + @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/rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py b/rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py new file mode 100644 index 00000000..7013b60f --- /dev/null +++ b/rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py @@ -0,0 +1,26 @@ +from typing import Literal, cast + +IncidentStatusPageEventStatusPageComponentsItemStatus = Literal[ + "degraded_performance", "major_outage", "operational", "partial_outage" +] + +INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES: set[ + IncidentStatusPageEventStatusPageComponentsItemStatus +] = { + "degraded_performance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_incident_status_page_event_status_page_components_item_status( + value: str | None, +) -> IncidentStatusPageEventStatusPageComponentsItemStatus | None: + if value is None: + return None + if value in INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES: + return cast(IncidentStatusPageEventStatusPageComponentsItemStatus, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/incident_sub_status.py b/rootly_sdk/models/incident_sub_status.py index 5fa71a29..62537e7e 100644 --- a/rootly_sdk/models/incident_sub_status.py +++ b/rootly_sdk/models/incident_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,13 +18,13 @@ class IncidentSubStatus: sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's sub-status was assigned. assigned_at (str): - assigned_by_user_id (int | None | Unset): + assigned_by_user_id (Union[None, Unset, int]): """ incident_id: str sub_status_id: str assigned_at: str - assigned_by_user_id: int | None | Unset = UNSET + assigned_by_user_id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - assigned_by_user_id: int | None | Unset + assigned_by_user_id: None | Unset | int if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -65,12 +63,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") - def _parse_assigned_by_user_id(data: object) -> int | None | Unset: + def _parse_assigned_by_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/incident_sub_status_list.py b/rootly_sdk/models/incident_sub_status_list.py index f699265c..2ce4f83f 100644 --- a/rootly_sdk/models/incident_sub_status_list.py +++ b/rootly_sdk/models/incident_sub_status_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentSubStatusList: """ Attributes: - data (list[IncidentSubStatusListDataItem]): + data (list['IncidentSubStatusListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentSubStatusListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentSubStatusListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_sub_status_list = cls( data=data, diff --git a/rootly_sdk/models/incident_sub_status_list_data_item.py b/rootly_sdk/models/incident_sub_status_list_data_item.py index 322e748c..bfb54b09 100644 --- a/rootly_sdk/models/incident_sub_status_list_data_item.py +++ b/rootly_sdk/models/incident_sub_status_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentSubStatusListDataItem: id: str type_: IncidentSubStatusListDataItemType - attributes: IncidentSubStatus + attributes: "IncidentSubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_sub_status_response.py b/rootly_sdk/models/incident_sub_status_response.py index 5e8bf711..0a92311a 100644 --- a/rootly_sdk/models/incident_sub_status_response.py +++ b/rootly_sdk/models/incident_sub_status_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentSubStatusResponse: """ Attributes: data (IncidentSubStatusResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentSubStatusResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentSubStatusResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentSubStatusResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_sub_status_response = cls( data=data, diff --git a/rootly_sdk/models/incident_sub_status_response_data.py b/rootly_sdk/models/incident_sub_status_response_data.py index 7d2e2559..c6afd0ca 100644 --- a/rootly_sdk/models/incident_sub_status_response_data.py +++ b/rootly_sdk/models/incident_sub_status_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentSubStatusResponseData: id: str type_: IncidentSubStatusResponseDataType - attributes: IncidentSubStatus + attributes: "IncidentSubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_trigger_params.py b/rootly_sdk/models/incident_trigger_params.py index 25c3c93b..317b8c86 100644 --- a/rootly_sdk/models/incident_trigger_params.py +++ b/rootly_sdk/models/incident_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -116,193 +114,196 @@ class IncidentTriggerParams: """ Attributes: trigger_type (IncidentTriggerParamsTriggerType): - triggers (list[str] | Unset): - incident_visibilities (list[bool] | Unset): - incident_kinds (list[IncidentTriggerParamsIncidentKindsItem] | Unset): - incident_statuses (list[IncidentTriggerParamsIncidentStatusesItem] | Unset): - incident_inactivity_duration (None | str | Unset): ex. 10 min, 1h, 3 days, 2 weeks - incident_condition (IncidentTriggerParamsIncidentCondition | Unset): Default: 'ALL'. - incident_condition_visibility (IncidentTriggerParamsIncidentConditionVisibility | Unset): Default: 'ANY'. - incident_condition_kind (IncidentTriggerParamsIncidentConditionKind | Unset): Default: 'IS'. - incident_condition_status (IncidentTriggerParamsIncidentConditionStatus | Unset): Default: 'ANY'. - incident_condition_sub_status (IncidentTriggerParamsIncidentConditionSubStatus | Unset): Default: 'ANY'. - incident_condition_environment (IncidentTriggerParamsIncidentConditionEnvironment | Unset): Default: 'ANY'. - incident_condition_severity (IncidentTriggerParamsIncidentConditionSeverity | Unset): Default: 'ANY'. - incident_condition_incident_type (IncidentTriggerParamsIncidentConditionIncidentType | Unset): Default: 'ANY'. - incident_condition_incident_roles (IncidentTriggerParamsIncidentConditionIncidentRoles | Unset): Default: + triggers (Union[Unset, list[str]]): + incident_visibilities (Union[Unset, list[bool]]): + incident_kinds (Union[Unset, list[IncidentTriggerParamsIncidentKindsItem]]): + incident_statuses (Union[Unset, list[IncidentTriggerParamsIncidentStatusesItem]]): + incident_inactivity_duration (Union[None, Unset, str]): ex. 10 min, 1h, 3 days, 2 weeks + incident_condition (Union[Unset, IncidentTriggerParamsIncidentCondition]): Default: 'ALL'. + incident_condition_visibility (Union[Unset, IncidentTriggerParamsIncidentConditionVisibility]): Default: 'ANY'. + incident_condition_kind (Union[Unset, IncidentTriggerParamsIncidentConditionKind]): Default: 'IS'. + incident_condition_status (Union[Unset, IncidentTriggerParamsIncidentConditionStatus]): Default: 'ANY'. + incident_condition_sub_status (Union[Unset, IncidentTriggerParamsIncidentConditionSubStatus]): Default: 'ANY'. + incident_condition_environment (Union[Unset, IncidentTriggerParamsIncidentConditionEnvironment]): Default: + 'ANY'. + incident_condition_severity (Union[Unset, IncidentTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. + incident_condition_incident_type (Union[Unset, IncidentTriggerParamsIncidentConditionIncidentType]): Default: + 'ANY'. + incident_condition_incident_roles (Union[Unset, IncidentTriggerParamsIncidentConditionIncidentRoles]): Default: + 'ANY'. + incident_condition_service (Union[Unset, IncidentTriggerParamsIncidentConditionService]): Default: 'ANY'. + incident_condition_functionality (Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality]): Default: 'ANY'. - incident_condition_service (IncidentTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. - incident_condition_functionality (IncidentTriggerParamsIncidentConditionFunctionality | Unset): Default: 'ANY'. - incident_condition_group (IncidentTriggerParamsIncidentConditionGroup | Unset): Default: 'ANY'. - incident_condition_cause (IncidentTriggerParamsIncidentConditionCause | Unset): Default: 'ANY'. - incident_condition_label (IncidentTriggerParamsIncidentConditionLabel | Unset): Default: 'ANY'. - incident_condition_label_use_regexp (bool | Unset): Default: False. - incident_labels (list[str] | Unset): - incident_post_mortem_condition_cause (IncidentTriggerParamsIncidentPostMortemConditionCause | Unset): + incident_condition_group (Union[Unset, IncidentTriggerParamsIncidentConditionGroup]): Default: 'ANY'. + incident_condition_cause (Union[Unset, IncidentTriggerParamsIncidentConditionCause]): Default: 'ANY'. + incident_condition_label (Union[Unset, IncidentTriggerParamsIncidentConditionLabel]): Default: 'ANY'. + incident_condition_label_use_regexp (Union[Unset, bool]): Default: False. + incident_labels (Union[Unset, list[str]]): + incident_post_mortem_condition_cause (Union[Unset, IncidentTriggerParamsIncidentPostMortemConditionCause]): [DEPRECATED] Use incident_condition_cause instead Default: 'ANY'. - incident_condition_summary (IncidentTriggerParamsIncidentConditionSummary | Unset): - incident_condition_started_at (IncidentTriggerParamsIncidentConditionStartedAt | Unset): - incident_condition_detected_at (IncidentTriggerParamsIncidentConditionDetectedAt | Unset): - incident_condition_acknowledged_at (IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset): - incident_condition_mitigated_at (IncidentTriggerParamsIncidentConditionMitigatedAt | Unset): - incident_condition_resolved_at (IncidentTriggerParamsIncidentConditionResolvedAt | Unset): - incident_conditional_inactivity (IncidentTriggerParamsIncidentConditionalInactivity | Unset): + incident_condition_summary (Union[Unset, IncidentTriggerParamsIncidentConditionSummary]): + incident_condition_started_at (Union[Unset, IncidentTriggerParamsIncidentConditionStartedAt]): + incident_condition_detected_at (Union[Unset, IncidentTriggerParamsIncidentConditionDetectedAt]): + incident_condition_acknowledged_at (Union[Unset, IncidentTriggerParamsIncidentConditionAcknowledgedAt]): + incident_condition_mitigated_at (Union[Unset, IncidentTriggerParamsIncidentConditionMitigatedAt]): + incident_condition_resolved_at (Union[Unset, IncidentTriggerParamsIncidentConditionResolvedAt]): + incident_conditional_inactivity (Union[Unset, IncidentTriggerParamsIncidentConditionalInactivity]): """ trigger_type: IncidentTriggerParamsTriggerType - triggers: list[str] | Unset = UNSET - incident_visibilities: list[bool] | Unset = UNSET - incident_kinds: list[IncidentTriggerParamsIncidentKindsItem] | Unset = UNSET - incident_statuses: list[IncidentTriggerParamsIncidentStatusesItem] | Unset = UNSET - incident_inactivity_duration: None | str | Unset = UNSET - incident_condition: IncidentTriggerParamsIncidentCondition | Unset = "ALL" - incident_condition_visibility: IncidentTriggerParamsIncidentConditionVisibility | Unset = "ANY" - incident_condition_kind: IncidentTriggerParamsIncidentConditionKind | Unset = "IS" - incident_condition_status: IncidentTriggerParamsIncidentConditionStatus | Unset = "ANY" - incident_condition_sub_status: IncidentTriggerParamsIncidentConditionSubStatus | Unset = "ANY" - incident_condition_environment: IncidentTriggerParamsIncidentConditionEnvironment | Unset = "ANY" - incident_condition_severity: IncidentTriggerParamsIncidentConditionSeverity | Unset = "ANY" - incident_condition_incident_type: IncidentTriggerParamsIncidentConditionIncidentType | Unset = "ANY" - incident_condition_incident_roles: IncidentTriggerParamsIncidentConditionIncidentRoles | Unset = "ANY" - incident_condition_service: IncidentTriggerParamsIncidentConditionService | Unset = "ANY" - incident_condition_functionality: IncidentTriggerParamsIncidentConditionFunctionality | Unset = "ANY" - incident_condition_group: IncidentTriggerParamsIncidentConditionGroup | Unset = "ANY" - incident_condition_cause: IncidentTriggerParamsIncidentConditionCause | Unset = "ANY" - incident_condition_label: IncidentTriggerParamsIncidentConditionLabel | Unset = "ANY" - incident_condition_label_use_regexp: bool | Unset = False - incident_labels: list[str] | Unset = UNSET - incident_post_mortem_condition_cause: IncidentTriggerParamsIncidentPostMortemConditionCause | Unset = "ANY" - incident_condition_summary: IncidentTriggerParamsIncidentConditionSummary | Unset = UNSET - incident_condition_started_at: IncidentTriggerParamsIncidentConditionStartedAt | Unset = UNSET - incident_condition_detected_at: IncidentTriggerParamsIncidentConditionDetectedAt | Unset = UNSET - incident_condition_acknowledged_at: IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset = UNSET - incident_condition_mitigated_at: IncidentTriggerParamsIncidentConditionMitigatedAt | Unset = UNSET - incident_condition_resolved_at: IncidentTriggerParamsIncidentConditionResolvedAt | Unset = UNSET - incident_conditional_inactivity: IncidentTriggerParamsIncidentConditionalInactivity | Unset = UNSET + triggers: Unset | list[str] = UNSET + incident_visibilities: Unset | list[bool] = UNSET + incident_kinds: Unset | list[IncidentTriggerParamsIncidentKindsItem] = UNSET + incident_statuses: Unset | list[IncidentTriggerParamsIncidentStatusesItem] = UNSET + incident_inactivity_duration: None | Unset | str = UNSET + incident_condition: Unset | IncidentTriggerParamsIncidentCondition = "ALL" + incident_condition_visibility: Unset | IncidentTriggerParamsIncidentConditionVisibility = "ANY" + incident_condition_kind: Unset | IncidentTriggerParamsIncidentConditionKind = "IS" + incident_condition_status: Unset | IncidentTriggerParamsIncidentConditionStatus = "ANY" + incident_condition_sub_status: Unset | IncidentTriggerParamsIncidentConditionSubStatus = "ANY" + incident_condition_environment: Unset | IncidentTriggerParamsIncidentConditionEnvironment = "ANY" + incident_condition_severity: Unset | IncidentTriggerParamsIncidentConditionSeverity = "ANY" + incident_condition_incident_type: Unset | IncidentTriggerParamsIncidentConditionIncidentType = "ANY" + incident_condition_incident_roles: Unset | IncidentTriggerParamsIncidentConditionIncidentRoles = "ANY" + incident_condition_service: Unset | IncidentTriggerParamsIncidentConditionService = "ANY" + incident_condition_functionality: Unset | IncidentTriggerParamsIncidentConditionFunctionality = "ANY" + incident_condition_group: Unset | IncidentTriggerParamsIncidentConditionGroup = "ANY" + incident_condition_cause: Unset | IncidentTriggerParamsIncidentConditionCause = "ANY" + incident_condition_label: Unset | IncidentTriggerParamsIncidentConditionLabel = "ANY" + incident_condition_label_use_regexp: Unset | bool = False + incident_labels: Unset | list[str] = UNSET + incident_post_mortem_condition_cause: Unset | IncidentTriggerParamsIncidentPostMortemConditionCause = "ANY" + incident_condition_summary: Unset | IncidentTriggerParamsIncidentConditionSummary = UNSET + incident_condition_started_at: Unset | IncidentTriggerParamsIncidentConditionStartedAt = UNSET + incident_condition_detected_at: Unset | IncidentTriggerParamsIncidentConditionDetectedAt = UNSET + incident_condition_acknowledged_at: Unset | IncidentTriggerParamsIncidentConditionAcknowledgedAt = UNSET + incident_condition_mitigated_at: Unset | IncidentTriggerParamsIncidentConditionMitigatedAt = UNSET + incident_condition_resolved_at: Unset | IncidentTriggerParamsIncidentConditionResolvedAt = UNSET + incident_conditional_inactivity: Unset | IncidentTriggerParamsIncidentConditionalInactivity = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: list[bool] | Unset = UNSET + incident_visibilities: Unset | list[bool] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: list[str] | Unset = UNSET + incident_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: list[str] | Unset = UNSET + incident_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: None | str | Unset + incident_inactivity_duration: None | Unset | str if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: str | Unset = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: str | Unset = UNSET + incident_condition_visibility: Unset | str = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: str | Unset = UNSET + incident_condition_kind: Unset | str = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: str | Unset = UNSET + incident_condition_status: Unset | str = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: str | Unset = UNSET + incident_condition_sub_status: Unset | str = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: str | Unset = UNSET + incident_condition_environment: Unset | str = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: str | Unset = UNSET + incident_condition_severity: Unset | str = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: str | Unset = UNSET + incident_condition_incident_type: Unset | str = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: str | Unset = UNSET + incident_condition_incident_roles: Unset | str = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: str | Unset = UNSET + incident_condition_service: Unset | str = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: str | Unset = UNSET + incident_condition_functionality: Unset | str = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: str | Unset = UNSET + incident_condition_group: Unset | str = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: str | Unset = UNSET + incident_condition_cause: Unset | str = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: str | Unset = UNSET + incident_condition_label: Unset | str = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: list[str] | Unset = UNSET + incident_labels: Unset | list[str] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: str | Unset = UNSET + incident_post_mortem_condition_cause: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = self.incident_post_mortem_condition_cause - incident_condition_summary: str | Unset = UNSET + incident_condition_summary: Unset | str = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: str | Unset = UNSET + incident_condition_started_at: Unset | str = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: str | Unset = UNSET + incident_condition_detected_at: Unset | str = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: str | Unset = UNSET + incident_condition_acknowledged_at: Unset | str = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: str | Unset = UNSET + incident_condition_mitigated_at: Unset | str = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: str | Unset = UNSET + incident_condition_resolved_at: Unset | str = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: str | Unset = UNSET + incident_conditional_inactivity: Unset | str = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity @@ -383,44 +384,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_visibilities = cast(list[bool], d.pop("incident_visibilities", UNSET)) + incident_kinds = [] _incident_kinds = d.pop("incident_kinds", UNSET) - incident_kinds: list[IncidentTriggerParamsIncidentKindsItem] | Unset = UNSET - if _incident_kinds is not UNSET: - incident_kinds = [] - for incident_kinds_item_data in _incident_kinds: - incident_kinds_item = check_incident_trigger_params_incident_kinds_item(incident_kinds_item_data) + for incident_kinds_item_data in _incident_kinds or []: + incident_kinds_item = check_incident_trigger_params_incident_kinds_item(incident_kinds_item_data) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) + incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - incident_statuses: list[IncidentTriggerParamsIncidentStatusesItem] | Unset = UNSET - if _incident_statuses is not UNSET: - incident_statuses = [] - for incident_statuses_item_data in _incident_statuses: - incident_statuses_item = check_incident_trigger_params_incident_statuses_item( - incident_statuses_item_data - ) + for incident_statuses_item_data in _incident_statuses or []: + incident_statuses_item = check_incident_trigger_params_incident_statuses_item(incident_statuses_item_data) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: + def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: IncidentTriggerParamsIncidentCondition | Unset + incident_condition: Unset | IncidentTriggerParamsIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_incident_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: IncidentTriggerParamsIncidentConditionVisibility | Unset + incident_condition_visibility: Unset | IncidentTriggerParamsIncidentConditionVisibility if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -429,14 +424,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: IncidentTriggerParamsIncidentConditionKind | Unset + incident_condition_kind: Unset | IncidentTriggerParamsIncidentConditionKind if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_incident_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: IncidentTriggerParamsIncidentConditionStatus | Unset + incident_condition_status: Unset | IncidentTriggerParamsIncidentConditionStatus if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -445,7 +440,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: IncidentTriggerParamsIncidentConditionSubStatus | Unset + incident_condition_sub_status: Unset | IncidentTriggerParamsIncidentConditionSubStatus if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -454,7 +449,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: IncidentTriggerParamsIncidentConditionEnvironment | Unset + incident_condition_environment: Unset | IncidentTriggerParamsIncidentConditionEnvironment if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -463,7 +458,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: IncidentTriggerParamsIncidentConditionSeverity | Unset + incident_condition_severity: Unset | IncidentTriggerParamsIncidentConditionSeverity if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -472,7 +467,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: IncidentTriggerParamsIncidentConditionIncidentType | Unset + incident_condition_incident_type: Unset | IncidentTriggerParamsIncidentConditionIncidentType if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -481,7 +476,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: IncidentTriggerParamsIncidentConditionIncidentRoles | Unset + incident_condition_incident_roles: Unset | IncidentTriggerParamsIncidentConditionIncidentRoles if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -490,7 +485,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: IncidentTriggerParamsIncidentConditionService | Unset + incident_condition_service: Unset | IncidentTriggerParamsIncidentConditionService if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -499,7 +494,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: IncidentTriggerParamsIncidentConditionFunctionality | Unset + incident_condition_functionality: Unset | IncidentTriggerParamsIncidentConditionFunctionality if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -508,21 +503,21 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: IncidentTriggerParamsIncidentConditionGroup | Unset + incident_condition_group: Unset | IncidentTriggerParamsIncidentConditionGroup if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: incident_condition_group = check_incident_trigger_params_incident_condition_group(_incident_condition_group) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: IncidentTriggerParamsIncidentConditionCause | Unset + incident_condition_cause: Unset | IncidentTriggerParamsIncidentConditionCause if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: incident_condition_cause = check_incident_trigger_params_incident_condition_cause(_incident_condition_cause) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: IncidentTriggerParamsIncidentConditionLabel | Unset + incident_condition_label: Unset | IncidentTriggerParamsIncidentConditionLabel if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -533,7 +528,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_post_mortem_condition_cause = d.pop("incident_post_mortem_condition_cause", UNSET) - incident_post_mortem_condition_cause: IncidentTriggerParamsIncidentPostMortemConditionCause | Unset + incident_post_mortem_condition_cause: Unset | IncidentTriggerParamsIncidentPostMortemConditionCause if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -542,7 +537,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: IncidentTriggerParamsIncidentConditionSummary | Unset + incident_condition_summary: Unset | IncidentTriggerParamsIncidentConditionSummary if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -551,7 +546,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: IncidentTriggerParamsIncidentConditionStartedAt | Unset + incident_condition_started_at: Unset | IncidentTriggerParamsIncidentConditionStartedAt if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -560,7 +555,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: IncidentTriggerParamsIncidentConditionDetectedAt | Unset + incident_condition_detected_at: Unset | IncidentTriggerParamsIncidentConditionDetectedAt if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -569,7 +564,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset + incident_condition_acknowledged_at: Unset | IncidentTriggerParamsIncidentConditionAcknowledgedAt if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -578,7 +573,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: IncidentTriggerParamsIncidentConditionMitigatedAt | Unset + incident_condition_mitigated_at: Unset | IncidentTriggerParamsIncidentConditionMitigatedAt if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -587,7 +582,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: IncidentTriggerParamsIncidentConditionResolvedAt | Unset + incident_condition_resolved_at: Unset | IncidentTriggerParamsIncidentConditionResolvedAt if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -596,7 +591,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: IncidentTriggerParamsIncidentConditionalInactivity | Unset + incident_conditional_inactivity: Unset | IncidentTriggerParamsIncidentConditionalInactivity if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: diff --git a/rootly_sdk/models/incident_type.py b/rootly_sdk/models/incident_type.py index b0f8f6fe..3ebd7402 100644 --- a/rootly_sdk/models/incident_type.py +++ b/rootly_sdk/models/incident_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,33 +22,34 @@ class IncidentType: name (str): The name of the incident type created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the incident type - description (None | str | Unset): The description of the incident type - color (None | str | Unset): The hex color of the incident type - position (int | None | Unset): Position of the incident type - notify_emails (list[str] | None | Unset): Emails to attach to the incident type - slack_channels (list[IncidentTypeSlackChannelsType0Item] | None | Unset): Slack Channels associated with this - incident type - slack_aliases (list[IncidentTypeSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this - incident type - properties (list[IncidentTypePropertiesItem] | Unset): Array of property values for this incident type. + slug (Union[Unset, str]): The slug of the incident type + description (Union[None, Unset, str]): The description of the incident type + public_description (Union[None, Unset, str]): The status page description of the incident type + color (Union[None, Unset, str]): The hex color of the incident type + position (Union[None, Unset, int]): Position of the incident type + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the incident type + slack_channels (Union[None, Unset, list['IncidentTypeSlackChannelsType0Item']]): Slack Channels associated with + this incident type + slack_aliases (Union[None, Unset, list['IncidentTypeSlackAliasesType0Item']]): Slack Aliases associated with + this incident type + properties (Union[Unset, list['IncidentTypePropertiesItem']]): Array of property values for this incident type. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[IncidentTypeSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[IncidentTypeSlackAliasesType0Item] | None | Unset = UNSET - properties: list[IncidentTypePropertiesItem] | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["IncidentTypeSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["IncidentTypeSlackAliasesType0Item"] = UNSET + properties: Unset | list["IncidentTypePropertiesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -59,25 +58,31 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -86,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -98,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -110,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -130,6 +135,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -160,34 +167,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -198,13 +214,13 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> list[IncidentTypeSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> None | Unset | list["IncidentTypeSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -222,13 +238,13 @@ def _parse_slack_channels(data: object) -> list[IncidentTypeSlackChannelsType0It slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentTypeSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["IncidentTypeSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> None | Unset | list["IncidentTypeSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -246,20 +262,18 @@ def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentTypeSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["IncidentTypeSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[IncidentTypePropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = IncidentTypePropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = IncidentTypePropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) incident_type = cls( name=name, @@ -267,6 +281,7 @@ def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item updated_at=updated_at, slug=slug, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/incident_type_list.py b/rootly_sdk/models/incident_type_list.py index 3fcfd517..e33a72b9 100644 --- a/rootly_sdk/models/incident_type_list.py +++ b/rootly_sdk/models/incident_type_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class IncidentTypeList: """ Attributes: - data (list[IncidentTypeListDataItem]): + data (list['IncidentTypeListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentTypeListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentTypeListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_type_list = cls( data=data, diff --git a/rootly_sdk/models/incident_type_list_data_item.py b/rootly_sdk/models/incident_type_list_data_item.py index bedeef51..ed31943b 100644 --- a/rootly_sdk/models/incident_type_list_data_item.py +++ b/rootly_sdk/models/incident_type_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentTypeListDataItem: id: str type_: IncidentTypeListDataItemType - attributes: IncidentType + attributes: "IncidentType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_type_properties_item.py b/rootly_sdk/models/incident_type_properties_item.py index 5bcab317..6c91d662 100644 --- a/rootly_sdk/models/incident_type_properties_item.py +++ b/rootly_sdk/models/incident_type_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_type_response.py b/rootly_sdk/models/incident_type_response.py index 8345322e..dd8fc4e3 100644 --- a/rootly_sdk/models/incident_type_response.py +++ b/rootly_sdk/models/incident_type_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class IncidentTypeResponse: """ Attributes: data (IncidentTypeResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentTypeResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentTypeResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentTypeResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_type_response = cls( data=data, diff --git a/rootly_sdk/models/incident_type_response_data.py b/rootly_sdk/models/incident_type_response_data.py index 0467f19a..7b9f0ecb 100644 --- a/rootly_sdk/models/incident_type_response_data.py +++ b/rootly_sdk/models/incident_type_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentTypeResponseData: id: str type_: IncidentTypeResponseDataType - attributes: IncidentType + attributes: "IncidentType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py b/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py index e60d5ce2..5aadf52e 100644 --- a/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_type_slack_channels_type_0_item.py b/rootly_sdk/models/incident_type_slack_channels_type_0_item.py index b579c633..4db8b7e4 100644 --- a/rootly_sdk/models/incident_type_slack_channels_type_0_item.py +++ b/rootly_sdk/models/incident_type_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_user_type_0.py b/rootly_sdk/models/incident_user_type_0.py index dce50314..efbc92a9 100644 --- a/rootly_sdk/models/incident_user_type_0.py +++ b/rootly_sdk/models/incident_user_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentUserType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py b/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py index 3bfaac57..06ca093e 100644 --- a/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py +++ b/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,18 +13,18 @@ class IncidentZoomMeetingGlobalDialInNumbersType0Item: """ Attributes: - country (str | Unset): - country_name (str | Unset): - city (str | Unset): - number (str | Unset): - type_ (str | Unset): + country (Union[Unset, str]): + country_name (Union[Unset, str]): + city (Union[Unset, str]): + number (Union[Unset, str]): + type_ (Union[Unset, str]): """ - country: str | Unset = UNSET - country_name: str | Unset = UNSET - city: str | Unset = UNSET - number: str | Unset = UNSET - type_: str | Unset = UNSET + country: Unset | str = UNSET + country_name: Unset | str = UNSET + city: Unset | str = UNSET + number: Unset | str = UNSET + type_: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incidents_chart_response.py b/rootly_sdk/models/incidents_chart_response.py index 95932b9f..becff146 100644 --- a/rootly_sdk/models/incidents_chart_response.py +++ b/rootly_sdk/models/incidents_chart_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class IncidentsChartResponse: data (IncidentsChartResponseData): """ - data: IncidentsChartResponseData + data: "IncidentsChartResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/incidents_chart_response_data.py b/rootly_sdk/models/incidents_chart_response_data.py index 544d592e..35782e51 100644 --- a/rootly_sdk/models/incidents_chart_response_data.py +++ b/rootly_sdk/models/incidents_chart_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentsChartResponseData: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/invite_to_google_chat_space_task_params.py b/rootly_sdk/models/invite_to_google_chat_space_task_params.py index ced72472..6a099867 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class InviteToGoogleChatSpaceTaskParams: Attributes: space (InviteToGoogleChatSpaceTaskParamsSpace): emails (str): Comma separated list of emails to invite - task_type (InviteToGoogleChatSpaceTaskParamsTaskType | Unset): + task_type (Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType]): """ - space: InviteToGoogleChatSpaceTaskParamsSpace + space: "InviteToGoogleChatSpaceTaskParamsSpace" emails: str - task_type: InviteToGoogleChatSpaceTaskParamsTaskType | Unset = UNSET + task_type: Unset | InviteToGoogleChatSpaceTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() emails = self.emails - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: emails = d.pop("emails") _task_type = d.pop("task_type", UNSET) - task_type: InviteToGoogleChatSpaceTaskParamsTaskType | Unset + task_type: Unset | InviteToGoogleChatSpaceTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py b/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py index 90770cb9..0b0940eb 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToGoogleChatSpaceTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py index ef3f3b57..ac0cac25 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -45,51 +43,52 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParams: Attributes: team (InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam): channel (InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel): - task_type (InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset): - escalation_policy_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset): - service_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset): - user_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset): - group_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset): - schedule_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset): + task_type (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType]): + escalation_policy_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget]): + service_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget]): + user_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget]): + group_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget]): + schedule_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget]): """ - team: InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam - channel: InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel - task_type: InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset = UNSET - escalation_policy_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset = UNSET - user_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset = UNSET - group_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset = UNSET - schedule_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset = UNSET + team: "InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam" + channel: "InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel" + task_type: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType = UNSET + escalation_policy_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget"] = ( + UNSET + ) + service_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget"] = UNSET + user_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget"] = UNSET + group_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget"] = UNSET + schedule_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() channel = self.channel.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: dict[str, Any] | Unset = UNSET + escalation_policy_target: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: dict[str, Any] | Unset = UNSET + service_target: Unset | dict[str, Any] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: dict[str, Any] | Unset = UNSET + user_target: Unset | dict[str, Any] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: dict[str, Any] | Unset = UNSET + group_target: Unset | dict[str, Any] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: dict[str, Any] | Unset = UNSET + schedule_target: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -146,14 +145,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channel = InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel.from_dict(d.pop("channel")) _task_type = d.pop("task_type", UNSET) - task_type: InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset + task_type: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_microsoft_teams_channel_rootly_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset + escalation_policy_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -162,28 +161,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset + service_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget if isinstance(_service_target, Unset): service_target = UNSET else: service_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset + user_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget if isinstance(_user_target, Unset): user_target = UNSET else: user_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset + group_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget if isinstance(_group_target, Unset): group_target = UNSET else: group_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget.from_dict(_group_target) _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset + schedule_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget if isinstance(_schedule_target, Unset): schedule_target = UNSET else: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py index 865e2e95..4c24a4ac 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py index 4ef5fc51..4d3d9bd8 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py index 3c2a90e4..0434c72b 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py index 0616c5e2..1e28a267 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py index 167fa3e6..6a401033 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py index f828e8a0..f8579431 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py index ed58e7af..0c1ffc90 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py index ae59c5cf..00939f9c 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,27 +26,26 @@ class InviteToMicrosoftTeamsChannelTaskParams: Attributes: channel (InviteToMicrosoftTeamsChannelTaskParamsChannel): emails (str): Comma separated list of emails to invite - task_type (InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset): - team (InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset): + task_type (Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType]): + team (Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTeam]): """ - channel: InviteToMicrosoftTeamsChannelTaskParamsChannel + channel: "InviteToMicrosoftTeamsChannelTaskParamsChannel" emails: str - task_type: InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET - team: InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset = UNSET + task_type: Unset | InviteToMicrosoftTeamsChannelTaskParamsTaskType = UNSET + team: Union[Unset, "InviteToMicrosoftTeamsChannelTaskParamsTeam"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() emails = self.emails - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - team: dict[str, Any] | Unset = UNSET + team: Unset | dict[str, Any] = UNSET if not isinstance(self.team, Unset): team = self.team.to_dict() @@ -82,14 +79,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: emails = d.pop("emails") _task_type = d.pop("task_type", UNSET) - task_type: InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset + task_type: Unset | InviteToMicrosoftTeamsChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_microsoft_teams_channel_task_params_task_type(_task_type) _team = d.pop("team", UNSET) - team: InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset + team: Unset | InviteToMicrosoftTeamsChannelTaskParamsTeam if isinstance(_team, Unset): team = UNSET else: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py index 08fe1c78..5c59110f 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py index 8e6139f7..00f2cd5d 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py index 852ab3a2..b26c113a 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,18 +26,17 @@ class InviteToSlackChannelOpsgenieTaskParams: """ Attributes: - channels (list[InviteToSlackChannelOpsgenieTaskParamsChannelsItem]): + channels (list['InviteToSlackChannelOpsgenieTaskParamsChannelsItem']): schedule (InviteToSlackChannelOpsgenieTaskParamsSchedule): - task_type (InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset): + task_type (Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType]): """ - channels: list[InviteToSlackChannelOpsgenieTaskParamsChannelsItem] - schedule: InviteToSlackChannelOpsgenieTaskParamsSchedule - task_type: InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset = UNSET + channels: list["InviteToSlackChannelOpsgenieTaskParamsChannelsItem"] + schedule: "InviteToSlackChannelOpsgenieTaskParamsSchedule" + task_type: Unset | InviteToSlackChannelOpsgenieTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -84,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = InviteToSlackChannelOpsgenieTaskParamsSchedule.from_dict(d.pop("schedule")) _task_type = d.pop("task_type", UNSET) - task_type: InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset + task_type: Unset | InviteToSlackChannelOpsgenieTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py index 203b4beb..45a6009d 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelOpsgenieTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py index 395e06bf..496748be 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelOpsgenieTaskParamsSchedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py index 3351841d..009cd231 100644 --- a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py +++ b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelPagerdutyTaskParamsType0EscalationPolicy: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py index 41e59cc3..7e1c28ab 100644 --- a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py +++ b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelPagerdutyTaskParamsType1Schedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py index 37ac9795..070af339 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,52 +38,51 @@ class InviteToSlackChannelRootlyTaskParams: """ Attributes: - channels (list[InviteToSlackChannelRootlyTaskParamsChannelsItem]): - task_type (InviteToSlackChannelRootlyTaskParamsTaskType | Unset): - escalation_policy_target (InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset): - service_target (InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset): - user_target (InviteToSlackChannelRootlyTaskParamsUserTarget | Unset): - group_target (InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset): - schedule_target (InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset): + channels (list['InviteToSlackChannelRootlyTaskParamsChannelsItem']): + task_type (Union[Unset, InviteToSlackChannelRootlyTaskParamsTaskType]): + escalation_policy_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget]): + service_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsServiceTarget]): + user_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsUserTarget]): + group_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsGroupTarget]): + schedule_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsScheduleTarget]): """ - channels: list[InviteToSlackChannelRootlyTaskParamsChannelsItem] - task_type: InviteToSlackChannelRootlyTaskParamsTaskType | Unset = UNSET - escalation_policy_target: InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset = UNSET - user_target: InviteToSlackChannelRootlyTaskParamsUserTarget | Unset = UNSET - group_target: InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset = UNSET - schedule_target: InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset = UNSET + channels: list["InviteToSlackChannelRootlyTaskParamsChannelsItem"] + task_type: Unset | InviteToSlackChannelRootlyTaskParamsTaskType = UNSET + escalation_policy_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget"] = UNSET + service_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsServiceTarget"] = UNSET + user_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsUserTarget"] = UNSET + group_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsGroupTarget"] = UNSET + schedule_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsScheduleTarget"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: dict[str, Any] | Unset = UNSET + escalation_policy_target: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: dict[str, Any] | Unset = UNSET + service_target: Unset | dict[str, Any] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: dict[str, Any] | Unset = UNSET + user_target: Unset | dict[str, Any] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: dict[str, Any] | Unset = UNSET + group_target: Unset | dict[str, Any] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: dict[str, Any] | Unset = UNSET + schedule_target: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -141,14 +138,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: InviteToSlackChannelRootlyTaskParamsTaskType | Unset + task_type: Unset | InviteToSlackChannelRootlyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_slack_channel_rootly_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset + escalation_policy_target: Unset | InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -157,28 +154,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset + service_target: Unset | InviteToSlackChannelRootlyTaskParamsServiceTarget if isinstance(_service_target, Unset): service_target = UNSET else: service_target = InviteToSlackChannelRootlyTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: InviteToSlackChannelRootlyTaskParamsUserTarget | Unset + user_target: Unset | InviteToSlackChannelRootlyTaskParamsUserTarget if isinstance(_user_target, Unset): user_target = UNSET else: user_target = InviteToSlackChannelRootlyTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset + group_target: Unset | InviteToSlackChannelRootlyTaskParamsGroupTarget if isinstance(_group_target, Unset): group_target = UNSET else: group_target = InviteToSlackChannelRootlyTaskParamsGroupTarget.from_dict(_group_target) _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset + schedule_target: Unset | InviteToSlackChannelRootlyTaskParamsScheduleTarget if isinstance(_schedule_target, Unset): schedule_target = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py index dc0a4aeb..40e8480b 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py index c1ec962e..b7f8aae0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py index ddd9bad8..e22e4a4c 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsGroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py index 66307c41..68ad559b 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsScheduleTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py index 93a0ddb1..b9f9bd54 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py index 6ba36eae..ac6987fd 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsUserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py index c0d9d99d..1d7557f8 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelTaskParamsType0SlackUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py index 97ba21b9..f262daae 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelTaskParamsType1SlackUserGroupsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py index ce51bda3..01eb52a0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py index a8e85eaf..fe9170b0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,18 +24,17 @@ class InviteToSlackChannelVictorOpsTaskParams: """ Attributes: - channels (list[InviteToSlackChannelVictorOpsTaskParamsChannelsItem]): + channels (list['InviteToSlackChannelVictorOpsTaskParamsChannelsItem']): team (InviteToSlackChannelVictorOpsTaskParamsTeam): - task_type (InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset): + task_type (Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType]): """ - channels: list[InviteToSlackChannelVictorOpsTaskParamsChannelsItem] - team: InviteToSlackChannelVictorOpsTaskParamsTeam - task_type: InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset = UNSET + channels: list["InviteToSlackChannelVictorOpsTaskParamsChannelsItem"] + team: "InviteToSlackChannelVictorOpsTaskParamsTeam" + task_type: Unset | InviteToSlackChannelVictorOpsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -82,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = InviteToSlackChannelVictorOpsTaskParamsTeam.from_dict(d.pop("team")) _task_type = d.pop("task_type", UNSET) - task_type: InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset + task_type: Unset | InviteToSlackChannelVictorOpsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py index bb0cad1b..65599a9a 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelVictorOpsTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py index b00e5aa4..fda1a9f0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class InviteToSlackChannelVictorOpsTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/ip_ranges.py b/rootly_sdk/models/ip_ranges.py index f959ae26..64c416d1 100644 --- a/rootly_sdk/models/ip_ranges.py +++ b/rootly_sdk/models/ip_ranges.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/ip_ranges_response.py b/rootly_sdk/models/ip_ranges_response.py index 6cd7d27e..23b3ad46 100644 --- a/rootly_sdk/models/ip_ranges_response.py +++ b/rootly_sdk/models/ip_ranges_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class IpRangesResponse: data (IpRangesResponseData): """ - data: IpRangesResponseData + data: "IpRangesResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/ip_ranges_response_data.py b/rootly_sdk/models/ip_ranges_response_data.py index de55248c..815ecd72 100644 --- a/rootly_sdk/models/ip_ranges_response_data.py +++ b/rootly_sdk/models/ip_ranges_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class IpRangesResponseData: id: str type_: IpRangesResponseDataType - attributes: IpRanges + attributes: "IpRanges" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/jsonapi_included_resource.py b/rootly_sdk/models/jsonapi_included_resource.py index bb745c1d..cf6c95bf 100644 --- a/rootly_sdk/models/jsonapi_included_resource.py +++ b/rootly_sdk/models/jsonapi_included_resource.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,27 +20,26 @@ class JsonapiIncludedResource: Attributes: id (str): type_ (str): - attributes (JsonapiIncludedResourceAttributes | Unset): - relationships (JsonapiIncludedResourceRelationships | Unset): + attributes (Union[Unset, JsonapiIncludedResourceAttributes]): + relationships (Union[Unset, JsonapiIncludedResourceRelationships]): """ id: str type_: str - attributes: JsonapiIncludedResourceAttributes | Unset = UNSET - relationships: JsonapiIncludedResourceRelationships | Unset = UNSET + attributes: Union[Unset, "JsonapiIncludedResourceAttributes"] = UNSET + relationships: Union[Unset, "JsonapiIncludedResourceRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,14 +69,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type") _attributes = d.pop("attributes", UNSET) - attributes: JsonapiIncludedResourceAttributes | Unset + attributes: Unset | JsonapiIncludedResourceAttributes if isinstance(_attributes, Unset): attributes = UNSET else: attributes = JsonapiIncludedResourceAttributes.from_dict(_attributes) _relationships = d.pop("relationships", UNSET) - relationships: JsonapiIncludedResourceRelationships | Unset + relationships: Unset | JsonapiIncludedResourceRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/jsonapi_included_resource_attributes.py b/rootly_sdk/models/jsonapi_included_resource_attributes.py index 4941c7af..b80d55bd 100644 --- a/rootly_sdk/models/jsonapi_included_resource_attributes.py +++ b/rootly_sdk/models/jsonapi_included_resource_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class JsonapiIncludedResourceAttributes: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/jsonapi_included_resource_relationships.py b/rootly_sdk/models/jsonapi_included_resource_relationships.py index 2ed1ed48..5d006566 100644 --- a/rootly_sdk/models/jsonapi_included_resource_relationships.py +++ b/rootly_sdk/models/jsonapi_included_resource_relationships.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class JsonapiIncludedResourceRelationships: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/links.py b/rootly_sdk/models/links.py index 48bcff63..0aba5061 100644 --- a/rootly_sdk/models/links.py +++ b/rootly_sdk/models/links.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,9 +13,9 @@ class Links: Attributes: self_ (str): first (str): - prev (None | str): - next_ (None | str): - last (None | str): + prev (Union[None, str]): + next_ (Union[None, str]): + last (Union[None, str]): """ self_: str diff --git a/rootly_sdk/models/list_alert_events_feed_filteraction.py b/rootly_sdk/models/list_alert_events_feed_filteraction.py index 3fdfb294..229f0c20 100644 --- a/rootly_sdk/models/list_alert_events_feed_filteraction.py +++ b/rootly_sdk/models/list_alert_events_feed_filteraction.py @@ -1,12 +1,14 @@ from typing import Literal, cast ListAlertEventsFeedFilteraction = Literal[ + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -25,6 +27,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", @@ -35,12 +38,14 @@ ] LIST_ALERT_EVENTS_FEED_FILTERACTION_VALUES: set[ListAlertEventsFeedFilteraction] = { + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -59,6 +64,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", diff --git a/rootly_sdk/models/live_call_router.py b/rootly_sdk/models/live_call_router.py index 199b49a8..ba86dbf4 100644 --- a/rootly_sdk/models/live_call_router.py +++ b/rootly_sdk/models/live_call_router.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,80 +28,83 @@ class LiveCallRouter: name (str): The name of the live_call_router created_at (str): Date of creation updated_at (str): Date of last update - kind (LiveCallRouterKind | Unset): The kind of the live_call_router - enabled (bool | Unset): Whether the live_call_router is enabled - country_code (LiveCallRouterCountryCode | Unset): The country code of the live_call_router - phone_type (LiveCallRouterPhoneType | Unset): The phone type of the live_call_router - phone_number (str | Unset): You can select a phone number using + kind (Union[Unset, LiveCallRouterKind]): The kind of the live_call_router + enabled (Union[Unset, bool]): Whether the live_call_router is enabled + country_code (Union[Unset, LiveCallRouterCountryCode]): The country code of the live_call_router + phone_type (Union[Unset, LiveCallRouterPhoneType]): The phone type of the live_call_router + phone_number (Union[Unset, str]): You can select a phone number using [generate_phone_number](#//api/v1/live_call_routers/generate_phone_number) API and pass that phone number here to register - voicemail_greeting (str | Unset): The voicemail greeting of the live_call_router - caller_greeting (str | Unset): The caller greeting message of the live_call_router - unavailable_responder_message (None | str | Unset): The message played to the caller when a responder doesn't - answer and the call moves on to the next person in the escalation. Leave blank to use the default message. - waiting_music_url (LiveCallRouterWaitingMusicUrl | Unset): The waiting music URL of the live_call_router - sent_to_voicemail_delay (int | Unset): The delay (seconds) after which the caller in redirected to voicemail - should_redirect_to_voicemail_on_no_answer (bool | Unset): This prompts the caller to choose voicemail or connect - live - escalation_level_delay_in_seconds (int | Unset): This overrides the delay (seconds) in escalation levels - should_auto_resolve_alert_on_call_end (bool | Unset): This overrides the delay (seconds) in escalation levels - notify_via_sms (bool | Unset): Whether responders are also notified via SMS when this router pages them - notify_via_push_notification (bool | Unset): Whether responders are also notified via push notification when - this router pages them - informational_notification_message (None | str | Unset): Optional message included in the SMS/push notification. - Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name }}. - alert_urgency_id (str | Unset): This is used in escalation paths to determine who to page - calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, + voicemail_greeting (Union[Unset, str]): The voicemail greeting of the live_call_router + caller_greeting (Union[Unset, str]): The caller greeting message of the live_call_router + unavailable_responder_message (Union[None, Unset, str]): The message played to the caller when a responder + doesn't answer and the call moves on to the next person in the escalation. Leave blank to use the default + message. + waiting_music_url (Union[Unset, LiveCallRouterWaitingMusicUrl]): The waiting music URL of the live_call_router + sent_to_voicemail_delay (Union[Unset, int]): The delay (seconds) after which the caller in redirected to + voicemail + should_redirect_to_voicemail_on_no_answer (Union[Unset, bool]): This prompts the caller to choose voicemail or + connect live + escalation_level_delay_in_seconds (Union[Unset, int]): This overrides the delay (seconds) in escalation levels + should_auto_resolve_alert_on_call_end (Union[Unset, bool]): This overrides the delay (seconds) in escalation + levels + notify_via_sms (Union[Unset, bool]): Whether responders are also notified via SMS when this router pages them + notify_via_push_notification (Union[Unset, bool]): Whether responders are also notified via push notification + when this router pages them + informational_notification_message (Union[None, Unset, str]): Optional message included in the SMS/push + notification. Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name + }}. + alert_urgency_id (Union[Unset, str]): This is used in escalation paths to determine who to page + calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - paging_targets (list[LiveCallRouterPagingTargetsItem] | Unset): Paging targets that callers can select from when - this live call router is configured as a phone tree. - escalation_policy_trigger_params (LiveCallRouterEscalationPolicyTriggerParams | Unset): + paging_targets (Union[Unset, list['LiveCallRouterPagingTargetsItem']]): Paging targets that callers can select + from when this live call router is configured as a phone tree. + escalation_policy_trigger_params (Union[Unset, LiveCallRouterEscalationPolicyTriggerParams]): """ name: str created_at: str updated_at: str - kind: LiveCallRouterKind | Unset = UNSET - enabled: bool | Unset = UNSET - country_code: LiveCallRouterCountryCode | Unset = UNSET - phone_type: LiveCallRouterPhoneType | Unset = UNSET - phone_number: str | Unset = UNSET - voicemail_greeting: str | Unset = UNSET - caller_greeting: str | Unset = UNSET - unavailable_responder_message: None | str | Unset = UNSET - waiting_music_url: LiveCallRouterWaitingMusicUrl | Unset = UNSET - sent_to_voicemail_delay: int | Unset = UNSET - should_redirect_to_voicemail_on_no_answer: bool | Unset = UNSET - escalation_level_delay_in_seconds: int | Unset = UNSET - should_auto_resolve_alert_on_call_end: bool | Unset = UNSET - notify_via_sms: bool | Unset = UNSET - notify_via_push_notification: bool | Unset = UNSET - informational_notification_message: None | str | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - calling_tree_prompt: str | Unset = UNSET - paging_targets: list[LiveCallRouterPagingTargetsItem] | Unset = UNSET - escalation_policy_trigger_params: LiveCallRouterEscalationPolicyTriggerParams | Unset = UNSET + kind: Unset | LiveCallRouterKind = UNSET + enabled: Unset | bool = UNSET + country_code: Unset | LiveCallRouterCountryCode = UNSET + phone_type: Unset | LiveCallRouterPhoneType = UNSET + phone_number: Unset | str = UNSET + voicemail_greeting: Unset | str = UNSET + caller_greeting: Unset | str = UNSET + unavailable_responder_message: None | Unset | str = UNSET + waiting_music_url: Unset | LiveCallRouterWaitingMusicUrl = UNSET + sent_to_voicemail_delay: Unset | int = UNSET + should_redirect_to_voicemail_on_no_answer: Unset | bool = UNSET + escalation_level_delay_in_seconds: Unset | int = UNSET + should_auto_resolve_alert_on_call_end: Unset | bool = UNSET + notify_via_sms: Unset | bool = UNSET + notify_via_push_notification: Unset | bool = UNSET + informational_notification_message: None | Unset | str = UNSET + alert_urgency_id: Unset | str = UNSET + calling_tree_prompt: Unset | str = UNSET + paging_targets: Unset | list["LiveCallRouterPagingTargetsItem"] = UNSET + escalation_policy_trigger_params: Union[Unset, "LiveCallRouterEscalationPolicyTriggerParams"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at updated_at = self.updated_at - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind enabled = self.enabled - country_code: str | Unset = UNSET + country_code: Unset | str = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: str | Unset = UNSET + phone_type: Unset | str = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -113,13 +114,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | str | Unset + unavailable_responder_message: None | Unset | str if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: str | Unset = UNSET + waiting_music_url: Unset | str = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -135,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | str | Unset + informational_notification_message: None | Unset | str if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -145,14 +146,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: list[dict[str, Any]] | Unset = UNSET + paging_targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.paging_targets, Unset): paging_targets = [] for paging_targets_item_data in self.paging_targets: paging_targets_item = paging_targets_item_data.to_dict() paging_targets.append(paging_targets_item) - escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET + escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -223,7 +224,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _kind = d.pop("kind", UNSET) - kind: LiveCallRouterKind | Unset + kind: Unset | LiveCallRouterKind if isinstance(_kind, Unset): kind = UNSET else: @@ -232,14 +233,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _country_code = d.pop("country_code", UNSET) - country_code: LiveCallRouterCountryCode | Unset + country_code: Unset | LiveCallRouterCountryCode if isinstance(_country_code, Unset): country_code = UNSET else: country_code = check_live_call_router_country_code(_country_code) _phone_type = d.pop("phone_type", UNSET) - phone_type: LiveCallRouterPhoneType | Unset + phone_type: Unset | LiveCallRouterPhoneType if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -251,19 +252,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> None | str | Unset: + def _parse_unavailable_responder_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: LiveCallRouterWaitingMusicUrl | Unset + waiting_music_url: Unset | LiveCallRouterWaitingMusicUrl if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -281,12 +282,12 @@ def _parse_unavailable_responder_message(data: object) -> None | str | Unset: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | str | Unset: + def _parse_informational_notification_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -296,17 +297,15 @@ def _parse_informational_notification_message(data: object) -> None | str | Unse calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) + paging_targets = [] _paging_targets = d.pop("paging_targets", UNSET) - paging_targets: list[LiveCallRouterPagingTargetsItem] | Unset = UNSET - if _paging_targets is not UNSET: - paging_targets = [] - for paging_targets_item_data in _paging_targets: - paging_targets_item = LiveCallRouterPagingTargetsItem.from_dict(paging_targets_item_data) + for paging_targets_item_data in _paging_targets or []: + paging_targets_item = LiveCallRouterPagingTargetsItem.from_dict(paging_targets_item_data) - paging_targets.append(paging_targets_item) + paging_targets.append(paging_targets_item) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: LiveCallRouterEscalationPolicyTriggerParams | Unset + escalation_policy_trigger_params: Unset | LiveCallRouterEscalationPolicyTriggerParams if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py b/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py index 4963b65f..7f74f656 100644 --- a/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py +++ b/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/live_call_router_list.py b/rootly_sdk/models/live_call_router_list.py index 885ce198..77f66edd 100644 --- a/rootly_sdk/models/live_call_router_list.py +++ b/rootly_sdk/models/live_call_router_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class LiveCallRouterList: """ Attributes: - data (list[LiveCallRouterListDataItem]): + data (list['LiveCallRouterListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[LiveCallRouterListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["LiveCallRouterListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) live_call_router_list = cls( data=data, diff --git a/rootly_sdk/models/live_call_router_list_data_item.py b/rootly_sdk/models/live_call_router_list_data_item.py index e68c449c..cc64df7e 100644 --- a/rootly_sdk/models/live_call_router_list_data_item.py +++ b/rootly_sdk/models/live_call_router_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class LiveCallRouterListDataItem: id: str type_: LiveCallRouterListDataItemType - attributes: LiveCallRouter + attributes: "LiveCallRouter" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/live_call_router_paging_targets_item.py b/rootly_sdk/models/live_call_router_paging_targets_item.py index 33e6941c..9fdc04a4 100644 --- a/rootly_sdk/models/live_call_router_paging_targets_item.py +++ b/rootly_sdk/models/live_call_router_paging_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/live_call_router_response.py b/rootly_sdk/models/live_call_router_response.py index e00de14c..4feab05c 100644 --- a/rootly_sdk/models/live_call_router_response.py +++ b/rootly_sdk/models/live_call_router_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class LiveCallRouterResponse: """ Attributes: data (LiveCallRouterResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: LiveCallRouterResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "LiveCallRouterResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = LiveCallRouterResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) live_call_router_response = cls( data=data, diff --git a/rootly_sdk/models/live_call_router_response_data.py b/rootly_sdk/models/live_call_router_response_data.py index 135ae335..6f15f45b 100644 --- a/rootly_sdk/models/live_call_router_response_data.py +++ b/rootly_sdk/models/live_call_router_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class LiveCallRouterResponseData: id: str type_: LiveCallRouterResponseDataType - attributes: LiveCallRouter + attributes: "LiveCallRouter" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording.py b/rootly_sdk/models/meeting_recording.py index 8591364b..e32e79c8 100644 --- a/rootly_sdk/models/meeting_recording.py +++ b/rootly_sdk/models/meeting_recording.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -25,17 +23,17 @@ class MeetingRecording: status (MeetingRecordingStatus): Current recording lifecycle status created_at (datetime.datetime): When the recording session was created updated_at (datetime.datetime): When the recording session was last updated - started_at (datetime.datetime | None | Unset): When the bot started recording (null if bot never joined) - ended_at (datetime.datetime | None | Unset): When the recording ended - duration_minutes (float | None | Unset): Recording duration in minutes (null if not started) - speaker_count (int | Unset): Number of unique speakers detected in the transcript - word_count (int | Unset): Total word count across all transcript segments - transcript_summary (None | str | Unset): AI-generated summary of the meeting transcript (null if no transcript - or not yet analyzed) - title (None | str | Unset): Human-readable label for the recording session - meeting_url (None | str | Unset): Original meeting URL - video_url (None | str | Unset): Signed URL to stream/download the video recording - created_by (None | str | Unset): Source that created the recording (e.g. desktop_sdk, recall_bot) + started_at (Union[None, Unset, datetime.datetime]): When the bot started recording (null if bot never joined) + ended_at (Union[None, Unset, datetime.datetime]): When the recording ended + duration_minutes (Union[None, Unset, float]): Recording duration in minutes (null if not started) + speaker_count (Union[Unset, int]): Number of unique speakers detected in the transcript + word_count (Union[Unset, int]): Total word count across all transcript segments + transcript_summary (Union[None, Unset, str]): AI-generated summary of the meeting transcript (null if no + transcript or not yet analyzed) + title (Union[None, Unset, str]): Human-readable label for the recording session + meeting_url (Union[None, Unset, str]): Original meeting URL + video_url (Union[None, Unset, str]): Signed URL to stream/download the video recording + created_by (Union[None, Unset, str]): Source that created the recording (e.g. desktop_sdk, recall_bot) """ platform: MeetingRecordingPlatform @@ -43,16 +41,16 @@ class MeetingRecording: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - duration_minutes: float | None | Unset = UNSET - speaker_count: int | Unset = UNSET - word_count: int | Unset = UNSET - transcript_summary: None | str | Unset = UNSET - title: None | str | Unset = UNSET - meeting_url: None | str | Unset = UNSET - video_url: None | str | Unset = UNSET - created_by: None | str | Unset = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + duration_minutes: None | Unset | float = UNSET + speaker_count: Unset | int = UNSET + word_count: Unset | int = UNSET + transcript_summary: None | Unset | str = UNSET + title: None | Unset | str = UNSET + meeting_url: None | Unset | str = UNSET + video_url: None | Unset | str = UNSET + created_by: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -74,7 +72,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -82,7 +80,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: float | None | Unset + duration_minutes: None | Unset | float if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -92,31 +90,31 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: None | str | Unset + transcript_summary: None | Unset | str if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: None | str | Unset + meeting_url: None | Unset | str if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: None | str | Unset + video_url: None | Unset | str if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: None | str | Unset + created_by: None | Unset | str if isinstance(self.created_by, Unset): created_by = UNSET else: @@ -169,7 +167,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -180,13 +178,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -197,18 +195,18 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> float | None | Unset: + def _parse_duration_minutes(data: object) -> None | Unset | float: if data is None: return data if isinstance(data, Unset): return data - return cast(float | None | Unset, data) + return cast(None | Unset | float, data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -216,48 +214,48 @@ def _parse_duration_minutes(data: object) -> float | None | Unset: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> None | str | Unset: + def _parse_transcript_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> None | str | Unset: + def _parse_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> None | str | Unset: + def _parse_video_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> None | str | Unset: + def _parse_created_by(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) created_by = _parse_created_by(d.pop("created_by", UNSET)) diff --git a/rootly_sdk/models/meeting_recording_detail.py b/rootly_sdk/models/meeting_recording_detail.py index b736f728..7be0306d 100644 --- a/rootly_sdk/models/meeting_recording_detail.py +++ b/rootly_sdk/models/meeting_recording_detail.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,22 +28,22 @@ class MeetingRecordingDetail: status (MeetingRecordingStatus): Current recording lifecycle status created_at (datetime.datetime): When the recording session was created updated_at (datetime.datetime): When the recording session was last updated - started_at (datetime.datetime | None | Unset): When the bot started recording (null if bot never joined) - ended_at (datetime.datetime | None | Unset): When the recording ended - duration_minutes (float | None | Unset): Recording duration in minutes (null if not started) - speaker_count (int | Unset): Number of unique speakers detected in the transcript - word_count (int | Unset): Total word count across all transcript segments - transcript_summary (None | str | Unset): AI-generated summary of the meeting transcript (null if no transcript - or not yet analyzed) - title (None | str | Unset): Human-readable label for the recording session - meeting_url (None | str | Unset): Original meeting URL - video_url (None | str | Unset): Signed URL to stream/download the video recording - created_by (None | str | Unset): Source that created the recording (e.g. desktop_sdk, recall_bot) - transcript (list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset): Array of - speaker segments when populated, empty object when no transcript exists. - recall_upload_id (None | str | Unset): Recall upload identifier - recordable_id (None | str | Unset): UUID of the associated recordable (e.g. incident) - recordable_type (None | str | Unset): Type of the associated recordable (e.g. Incident) + started_at (Union[None, Unset, datetime.datetime]): When the bot started recording (null if bot never joined) + ended_at (Union[None, Unset, datetime.datetime]): When the recording ended + duration_minutes (Union[None, Unset, float]): Recording duration in minutes (null if not started) + speaker_count (Union[Unset, int]): Number of unique speakers detected in the transcript + word_count (Union[Unset, int]): Total word count across all transcript segments + transcript_summary (Union[None, Unset, str]): AI-generated summary of the meeting transcript (null if no + transcript or not yet analyzed) + title (Union[None, Unset, str]): Human-readable label for the recording session + meeting_url (Union[None, Unset, str]): Original meeting URL + video_url (Union[None, Unset, str]): Signed URL to stream/download the video recording + created_by (Union[None, Unset, str]): Source that created the recording (e.g. desktop_sdk, recall_bot) + transcript (Union['MeetingRecordingDetailTranscriptType1', Unset, list['MeetingRecordingTranscriptSegment']]): + Array of speaker segments when populated, empty object when no transcript exists. + recall_upload_id (Union[None, Unset, str]): Recall upload identifier + recordable_id (Union[None, Unset, str]): UUID of the associated recordable (e.g. incident) + recordable_type (Union[None, Unset, str]): Type of the associated recordable (e.g. Incident) """ platform: MeetingRecordingPlatform @@ -53,24 +51,23 @@ class MeetingRecordingDetail: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - duration_minutes: float | None | Unset = UNSET - speaker_count: int | Unset = UNSET - word_count: int | Unset = UNSET - transcript_summary: None | str | Unset = UNSET - title: None | str | Unset = UNSET - meeting_url: None | str | Unset = UNSET - video_url: None | str | Unset = UNSET - created_by: None | str | Unset = UNSET - transcript: list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset = UNSET - recall_upload_id: None | str | Unset = UNSET - recordable_id: None | str | Unset = UNSET - recordable_type: None | str | Unset = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + duration_minutes: None | Unset | float = UNSET + speaker_count: Unset | int = UNSET + word_count: Unset | int = UNSET + transcript_summary: None | Unset | str = UNSET + title: None | Unset | str = UNSET + meeting_url: None | Unset | str = UNSET + video_url: None | Unset | str = UNSET + created_by: None | Unset | str = UNSET + transcript: Union["MeetingRecordingDetailTranscriptType1", Unset, list["MeetingRecordingTranscriptSegment"]] = UNSET + recall_upload_id: None | Unset | str = UNSET + recordable_id: None | Unset | str = UNSET + recordable_type: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - platform: str = self.platform session_number = self.session_number @@ -81,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -89,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -97,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: float | None | Unset + duration_minutes: None | Unset | float if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -107,37 +104,37 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: None | str | Unset + transcript_summary: None | Unset | str if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: None | str | Unset + meeting_url: None | Unset | str if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: None | str | Unset + video_url: None | Unset | str if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: None | str | Unset + created_by: None | Unset | str if isinstance(self.created_by, Unset): created_by = UNSET else: created_by = self.created_by - transcript: dict[str, Any] | list[dict[str, Any]] | Unset + transcript: Unset | dict[str, Any] | list[dict[str, Any]] if isinstance(self.transcript, Unset): transcript = UNSET elif isinstance(self.transcript, list): @@ -149,19 +146,19 @@ def to_dict(self) -> dict[str, Any]: else: transcript = self.transcript.to_dict() - recall_upload_id: None | str | Unset + recall_upload_id: None | Unset | str if isinstance(self.recall_upload_id, Unset): recall_upload_id = UNSET else: recall_upload_id = self.recall_upload_id - recordable_id: None | str | Unset + recordable_id: None | Unset | str if isinstance(self.recordable_id, Unset): recordable_id = UNSET else: recordable_id = self.recordable_id - recordable_type: None | str | Unset + recordable_type: None | Unset | str if isinstance(self.recordable_type, Unset): recordable_type = UNSET else: @@ -225,7 +222,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -236,13 +233,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -253,18 +250,18 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> float | None | Unset: + def _parse_duration_minutes(data: object) -> None | Unset | float: if data is None: return data if isinstance(data, Unset): return data - return cast(float | None | Unset, data) + return cast(None | Unset | float, data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -272,54 +269,54 @@ def _parse_duration_minutes(data: object) -> float | None | Unset: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> None | str | Unset: + def _parse_transcript_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> None | str | Unset: + def _parse_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> None | str | Unset: + def _parse_video_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> None | str | Unset: + def _parse_created_by(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) created_by = _parse_created_by(d.pop("created_by", UNSET)) def _parse_transcript( data: object, - ) -> list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset: + ) -> Union["MeetingRecordingDetailTranscriptType1", Unset, list["MeetingRecordingTranscriptSegment"]]: if isinstance(data, Unset): return data try: @@ -333,7 +330,7 @@ def _parse_transcript( transcript_type_0.append(transcript_type_0_item) return transcript_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -343,30 +340,30 @@ def _parse_transcript( transcript = _parse_transcript(d.pop("transcript", UNSET)) - def _parse_recall_upload_id(data: object) -> None | str | Unset: + def _parse_recall_upload_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) recall_upload_id = _parse_recall_upload_id(d.pop("recall_upload_id", UNSET)) - def _parse_recordable_id(data: object) -> None | str | Unset: + def _parse_recordable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) recordable_id = _parse_recordable_id(d.pop("recordable_id", UNSET)) - def _parse_recordable_type(data: object) -> None | str | Unset: + def _parse_recordable_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) recordable_type = _parse_recordable_type(d.pop("recordable_type", UNSET)) diff --git a/rootly_sdk/models/meeting_recording_detail_response.py b/rootly_sdk/models/meeting_recording_detail_response.py index 2aad46f9..8a11371b 100644 --- a/rootly_sdk/models/meeting_recording_detail_response.py +++ b/rootly_sdk/models/meeting_recording_detail_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class MeetingRecordingDetailResponse: data (MeetingRecordingDetailResponseData): """ - data: MeetingRecordingDetailResponseData + data: "MeetingRecordingDetailResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/meeting_recording_detail_response_data.py b/rootly_sdk/models/meeting_recording_detail_response_data.py index c50dcff8..6b46c0ed 100644 --- a/rootly_sdk/models/meeting_recording_detail_response_data.py +++ b/rootly_sdk/models/meeting_recording_detail_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class MeetingRecordingDetailResponseData: id: str type_: MeetingRecordingDetailResponseDataType - attributes: MeetingRecordingDetail + attributes: "MeetingRecordingDetail" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py b/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py index 6faa6679..b2cff2e2 100644 --- a/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py +++ b/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class MeetingRecordingDetailTranscriptType1: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/meeting_recording_list.py b/rootly_sdk/models/meeting_recording_list.py index f60139eb..d4a6ce0a 100644 --- a/rootly_sdk/models/meeting_recording_list.py +++ b/rootly_sdk/models/meeting_recording_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class MeetingRecordingList: """ Attributes: - data (list[MeetingRecordingListDataItem]): - meta (Meta | Unset): + data (list['MeetingRecordingListDataItem']): + meta (Union[Unset, Meta]): """ - data: list[MeetingRecordingListDataItem] - meta: Meta | Unset = UNSET + data: list["MeetingRecordingListDataItem"] + meta: Union[Unset, "Meta"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -65,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/meeting_recording_list_data_item.py b/rootly_sdk/models/meeting_recording_list_data_item.py index be50f1e5..397d1c86 100644 --- a/rootly_sdk/models/meeting_recording_list_data_item.py +++ b/rootly_sdk/models/meeting_recording_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class MeetingRecordingListDataItem: id: str type_: MeetingRecordingListDataItemType - attributes: MeetingRecording + attributes: "MeetingRecording" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording_response.py b/rootly_sdk/models/meeting_recording_response.py index eac483c2..89bdf8f6 100644 --- a/rootly_sdk/models/meeting_recording_response.py +++ b/rootly_sdk/models/meeting_recording_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class MeetingRecordingResponse: data (MeetingRecordingResponseData): """ - data: MeetingRecordingResponseData + data: "MeetingRecordingResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/meeting_recording_response_data.py b/rootly_sdk/models/meeting_recording_response_data.py index bcfe346c..85ba6a2b 100644 --- a/rootly_sdk/models/meeting_recording_response_data.py +++ b/rootly_sdk/models/meeting_recording_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class MeetingRecordingResponseData: id: str type_: MeetingRecordingResponseDataType - attributes: MeetingRecording + attributes: "MeetingRecording" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording_transcript_segment.py b/rootly_sdk/models/meeting_recording_transcript_segment.py index 7335c4f7..4d968cb3 100644 --- a/rootly_sdk/models/meeting_recording_transcript_segment.py +++ b/rootly_sdk/models/meeting_recording_transcript_segment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,15 +16,14 @@ class MeetingRecordingTranscriptSegment: """ Attributes: speaker (str): Speaker label (e.g. Speaker 1) - words (list[MeetingRecordingTranscriptWord]): Timestamped words spoken by this speaker + words (list['MeetingRecordingTranscriptWord']): Timestamped words spoken by this speaker """ speaker: str - words: list[MeetingRecordingTranscriptWord] + words: list["MeetingRecordingTranscriptWord"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - speaker = self.speaker words = [] diff --git a/rootly_sdk/models/meeting_recording_transcript_word.py b/rootly_sdk/models/meeting_recording_transcript_word.py index 83d7b63f..114bcf09 100644 --- a/rootly_sdk/models/meeting_recording_transcript_word.py +++ b/rootly_sdk/models/meeting_recording_transcript_word.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,13 +14,13 @@ class MeetingRecordingTranscriptWord: """ Attributes: text (str): Transcribed word - start_timestamp (float | Unset): Start time in seconds from recording start - end_timestamp (float | Unset): End time in seconds from recording start + start_timestamp (Union[Unset, float]): Start time in seconds from recording start + end_timestamp (Union[Unset, float]): End time in seconds from recording start """ text: str - start_timestamp: float | Unset = UNSET - end_timestamp: float | Unset = UNSET + start_timestamp: Unset | float = UNSET + end_timestamp: Unset | float = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/meta.py b/rootly_sdk/models/meta.py index 5612bb1e..66e5874d 100644 --- a/rootly_sdk/models/meta.py +++ b/rootly_sdk/models/meta.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,37 +13,37 @@ class Meta: """ Attributes: - current_page (int | None): - next_page (int | None): - prev_page (int | None): + current_page (Union[None, int]): + next_page (Union[None, int]): + prev_page (Union[None, int]): total_count (int): total_pages (int): - next_cursor (None | str | Unset): + next_cursor (Union[None, Unset, str]): """ - current_page: int | None - next_page: int | None - prev_page: int | None + current_page: None | int + next_page: None | int + prev_page: None | int total_count: int total_pages: int - next_cursor: None | str | Unset = UNSET + next_cursor: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - current_page: int | None + current_page: None | int current_page = self.current_page - next_page: int | None + next_page: None | int next_page = self.next_page - prev_page: int | None + prev_page: None | int prev_page = self.prev_page total_count = self.total_count total_pages = self.total_pages - next_cursor: None | str | Unset + next_cursor: None | Unset | str if isinstance(self.next_cursor, Unset): next_cursor = UNSET else: @@ -71,24 +69,24 @@ 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_current_page(data: object) -> int | None: + def _parse_current_page(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) current_page = _parse_current_page(d.pop("current_page")) - def _parse_next_page(data: object) -> int | None: + def _parse_next_page(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) next_page = _parse_next_page(d.pop("next_page")) - def _parse_prev_page(data: object) -> int | None: + def _parse_prev_page(data: object) -> None | int: if data is None: return data - return cast(int | None, data) + return cast(None | int, data) prev_page = _parse_prev_page(d.pop("prev_page")) @@ -96,12 +94,12 @@ def _parse_prev_page(data: object) -> int | None: total_pages = d.pop("total_pages") - def _parse_next_cursor(data: object) -> None | str | Unset: + def _parse_next_cursor(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) next_cursor = _parse_next_cursor(d.pop("next_cursor", UNSET)) diff --git a/rootly_sdk/models/mitigate_incident.py b/rootly_sdk/models/mitigate_incident.py index fe1ec922..618e5265 100644 --- a/rootly_sdk/models/mitigate_incident.py +++ b/rootly_sdk/models/mitigate_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class MitigateIncident: data (MitigateIncidentData): """ - data: MitigateIncidentData + data: "MitigateIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/mitigate_incident_data.py b/rootly_sdk/models/mitigate_incident_data.py index d2daeb4a..2ba8ea98 100644 --- a/rootly_sdk/models/mitigate_incident_data.py +++ b/rootly_sdk/models/mitigate_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class MitigateIncidentData: """ type_: MitigateIncidentDataType - attributes: MitigateIncidentDataAttributes + attributes: "MitigateIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/mitigate_incident_data_attributes.py b/rootly_sdk/models/mitigate_incident_data_attributes.py index 58606b79..d18c92cc 100644 --- a/rootly_sdk/models/mitigate_incident_data_attributes.py +++ b/rootly_sdk/models/mitigate_incident_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,13 +12,13 @@ class MitigateIncidentDataAttributes: """ Attributes: - mitigation_message (None | str | Unset): How was the incident mitigated? + mitigation_message (Union[None, Unset, str]): How was the incident mitigated? """ - mitigation_message: None | str | Unset = UNSET + mitigation_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - mitigation_message: None | str | Unset + mitigation_message: None | Unset | str if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: @@ -38,12 +36,12 @@ 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_mitigation_message(data: object) -> None | str | Unset: + def _parse_mitigation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) diff --git a/rootly_sdk/models/new_alert.py b/rootly_sdk/models/new_alert.py index 092db12d..234e2282 100644 --- a/rootly_sdk/models/new_alert.py +++ b/rootly_sdk/models/new_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlert: data (NewAlertData): """ - data: NewAlertData + data: "NewAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_data.py b/rootly_sdk/models/new_alert_data.py index 64f89fa6..1c0d27b1 100644 --- a/rootly_sdk/models/new_alert_data.py +++ b/rootly_sdk/models/new_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertData: """ type_: NewAlertDataType - attributes: NewAlertDataAttributes + attributes: "NewAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_data_attributes.py b/rootly_sdk/models/new_alert_data_attributes.py index 31ed11b4..7082ee65 100644 --- a/rootly_sdk/models/new_alert_data_attributes.py +++ b/rootly_sdk/models/new_alert_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -37,64 +35,66 @@ class NewAlertDataAttributes: """ Attributes: summary (str): The summary of the alert - noise (NewAlertDataAttributesNoise | Unset): Whether the alert is marked as noise - source (str | Unset): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults to - `api`. - status (NewAlertDataAttributesStatus | Unset): Only available for organizations with Rootly On-Call enabled. Can - be one of open, triggered. - description (None | str | Unset): The description of the alert - service_ids (list[str] | None | Unset): The Service IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Service. This field will be automatically set for you. - group_ids (list[str] | None | Unset): The Group IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Group. This field will be automatically set for you. - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the alert - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the alert - started_at (datetime.datetime | None | Unset): Alert start datetime - ended_at (datetime.datetime | None | Unset): Alert end datetime - external_id (None | str | Unset): External ID - external_url (None | str | Unset): External Url - alert_urgency_id (None | str | Unset): The ID of the alert urgency - notification_target_type (NewAlertDataAttributesNotificationTargetType | Unset): Only available for + noise (Union[Unset, NewAlertDataAttributesNoise]): Whether the alert is marked as noise + source (Union[Unset, str]): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults + to `api`. + status (Union[Unset, NewAlertDataAttributesStatus]): Only available for organizations with Rootly On-Call + enabled. Can be one of open, triggered. + description (Union[None, Unset, str]): The description of the alert + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the alert. If your organization has + On-Call enabled and your notification target is a Service. This field will be automatically set for you. + group_ids (Union[None, Unset, list[str]]): The Group IDs to attach to the alert. If your organization has On- + Call enabled and your notification target is a Group. This field will be automatically set for you. + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the alert + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the alert + started_at (Union[None, Unset, datetime.datetime]): Alert start datetime + ended_at (Union[None, Unset, datetime.datetime]): Alert end datetime + external_id (Union[None, Unset, str]): External ID + external_url (Union[None, Unset, str]): External Url + alert_urgency_id (Union[None, Unset, str]): The ID of the alert urgency + notification_target_type (Union[Unset, NewAlertDataAttributesNotificationTargetType]): Only available for organizations with Rootly On-Call enabled. Can be one of Group, Service, EscalationPolicy, Functionality, User. Please contact support if you encounter issues using `Functionality` as a notification target type. - notification_target_id (None | str | Unset): Only available for organizations with Rootly On-Call enabled. The - _identifier_ of the notification target object. - notification_targets (list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset): Only available - for organizations with Rootly On-Call enabled. Page multiple destinations (any combination of Group, Service, - EscalationPolicy, Functionality, or User) in a single request. `Functionality` targets require the + notification_target_id (Union[None, Unset, str]): Only available for organizations with Rootly On-Call enabled. + The _identifier_ of the notification target object. + notification_targets (Union[None, Unset, list['NewAlertDataAttributesNotificationTargetsType0Item']]): Only + available for organizations with Rootly On-Call enabled. Page multiple destinations (any combination of Group, + Service, EscalationPolicy, Functionality, or User) in a single request. `Functionality` targets require the `enable_paging_functionalities` feature; a request that includes one while it is disabled is rejected. Applies to alert creation only. When provided, this takes precedence over the singular `notification_target_type` / `notification_target_id` fields. - labels (list[NewAlertDataAttributesLabelsItemType0 | None] | Unset): - data (NewAlertDataAttributesDataType0 | None | Unset): Additional data - deduplication_key (None | str | Unset): Alerts sharing the same deduplication key are treated as a single alert. - alert_field_values_attributes (list[NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None] | Unset): - Custom alert field values to create with the alert + labels (Union[Unset, list[Union['NewAlertDataAttributesLabelsItemType0', None]]]): + data (Union['NewAlertDataAttributesDataType0', None, Unset]): Additional data + deduplication_key (Union[None, Unset, str]): Alerts sharing the same deduplication key are treated as a single + alert. + alert_field_values_attributes (Union[Unset, + list[Union['NewAlertDataAttributesAlertFieldValuesAttributesItemType0', None]]]): Custom alert field values to + create with the alert """ summary: str - noise: NewAlertDataAttributesNoise | Unset = UNSET - source: str | Unset = UNSET - status: NewAlertDataAttributesStatus | Unset = UNSET - description: None | str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_id: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - notification_target_type: NewAlertDataAttributesNotificationTargetType | Unset = UNSET - notification_target_id: None | str | Unset = UNSET - notification_targets: list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset = UNSET - labels: list[NewAlertDataAttributesLabelsItemType0 | None] | Unset = UNSET - data: NewAlertDataAttributesDataType0 | None | Unset = UNSET - deduplication_key: None | str | Unset = UNSET - alert_field_values_attributes: list[NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None] | Unset = ( - UNSET - ) + noise: Unset | NewAlertDataAttributesNoise = UNSET + source: Unset | str = UNSET + status: Unset | NewAlertDataAttributesStatus = UNSET + description: None | Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_id: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + notification_target_type: Unset | NewAlertDataAttributesNotificationTargetType = UNSET + notification_target_id: None | Unset | str = UNSET + notification_targets: None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"] = UNSET + labels: Unset | list[Union["NewAlertDataAttributesLabelsItemType0", None]] = UNSET + data: Union["NewAlertDataAttributesDataType0", None, Unset] = UNSET + deduplication_key: None | Unset | str = UNSET + alert_field_values_attributes: ( + Unset | list[Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( @@ -105,23 +105,23 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - noise: str | Unset = UNSET + noise: Unset | str = UNSET if not isinstance(self.noise, Unset): noise = self.noise source = self.source - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -130,7 +130,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -139,7 +139,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -148,7 +148,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -157,7 +157,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -165,7 +165,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -173,35 +173,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - notification_target_type: str | Unset = UNSET + notification_target_type: Unset | str = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: None | str | Unset + notification_target_id: None | Unset | str if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - notification_targets: list[dict[str, Any]] | None | Unset + notification_targets: None | Unset | list[dict[str, Any]] if isinstance(self.notification_targets, Unset): notification_targets = UNSET elif isinstance(self.notification_targets, list): @@ -213,18 +213,18 @@ def to_dict(self) -> dict[str, Any]: else: notification_targets = self.notification_targets - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: None | dict[str, Any] if isinstance(labels_item_data, NewAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewAlertDataAttributesDataType0): @@ -232,17 +232,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: None | str | Unset + deduplication_key: None | Unset | str if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: list[dict[str, Any] | None] | Unset = UNSET + alert_field_values_attributes: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.alert_field_values_attributes, Unset): alert_field_values_attributes = [] for alert_field_values_attributes_item_data in self.alert_field_values_attributes: - alert_field_values_attributes_item: dict[str, Any] | None + alert_field_values_attributes_item: None | dict[str, Any] if isinstance( alert_field_values_attributes_item_data, NewAlertDataAttributesAlertFieldValuesAttributesItemType0 ): @@ -316,7 +316,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary") _noise = d.pop("noise", UNSET) - noise: NewAlertDataAttributesNoise | Unset + noise: Unset | NewAlertDataAttributesNoise if isinstance(_noise, Unset): noise = UNSET else: @@ -325,22 +325,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: source = d.pop("source", UNSET) _status = d.pop("status", UNSET) - status: NewAlertDataAttributesStatus | Unset + status: Unset | NewAlertDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_new_alert_data_attributes_status(_status) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -351,13 +351,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -368,13 +368,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -385,13 +385,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -402,13 +402,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -419,13 +419,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -436,41 +436,41 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: NewAlertDataAttributesNotificationTargetType | Unset + notification_target_type: Unset | NewAlertDataAttributesNotificationTargetType if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: @@ -478,18 +478,18 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset: _notification_target_type ) - def _parse_notification_target_id(data: object) -> None | str | Unset: + def _parse_notification_target_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) def _parse_notification_targets( data: object, - ) -> list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset: + ) -> None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -507,36 +507,34 @@ def _parse_notification_targets( notification_targets_type_0.append(notification_targets_type_0_item) return notification_targets_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"], data) notification_targets = _parse_notification_targets(d.pop("notification_targets", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[NewAlertDataAttributesLabelsItemType0 | None] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> NewAlertDataAttributesLabelsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = NewAlertDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["NewAlertDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = NewAlertDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewAlertDataAttributesLabelsItemType0 | None, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewAlertDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) - def _parse_data(data: object) -> NewAlertDataAttributesDataType0 | None | Unset: + def _parse_data(data: object) -> Union["NewAlertDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -547,51 +545,47 @@ def _parse_data(data: object) -> NewAlertDataAttributesDataType0 | None | Unset: data_type_0 = NewAlertDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertDataAttributesDataType0 | None | Unset, data) + return cast(Union["NewAlertDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> None | str | Unset: + def _parse_deduplication_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) + alert_field_values_attributes = [] _alert_field_values_attributes = d.pop("alert_field_values_attributes", UNSET) - alert_field_values_attributes: ( - list[NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None] | Unset - ) = UNSET - if _alert_field_values_attributes is not UNSET: - alert_field_values_attributes = [] - for alert_field_values_attributes_item_data in _alert_field_values_attributes: - - def _parse_alert_field_values_attributes_item( - data: object, - ) -> NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - alert_field_values_attributes_item_type_0 = ( - NewAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) - ) - - return alert_field_values_attributes_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None, data) - - alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( - alert_field_values_attributes_item_data - ) + for alert_field_values_attributes_item_data in _alert_field_values_attributes or []: + + def _parse_alert_field_values_attributes_item( + data: object, + ) -> Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + alert_field_values_attributes_item_type_0 = ( + NewAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) + ) - alert_field_values_attributes.append(alert_field_values_attributes_item) + return alert_field_values_attributes_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None], data) + + alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( + alert_field_values_attributes_item_data + ) + + alert_field_values_attributes.append(alert_field_values_attributes_item) new_alert_data_attributes = cls( summary=summary, diff --git a/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py b/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py index d6390a5a..32034f4e 100644 --- a/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_alert_data_attributes_data_type_0.py b/rootly_sdk/models/new_alert_data_attributes_data_type_0.py index 407a47f0..dd2efbaf 100644 --- a/rootly_sdk/models/new_alert_data_attributes_data_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewAlertDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py b/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py index 024b581d..d3341fa6 100644 --- a/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,7 +12,7 @@ class NewAlertDataAttributesLabelsItemType0: """ Attributes: key (str): Key of the tag - value (bool | float | str): Value of the tag + value (Union[bool, float, str]): Value of the tag """ key: str diff --git a/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py b/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py index 2016715d..e36f7c7f 100644 --- a/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py +++ b/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_alert_event.py b/rootly_sdk/models/new_alert_event.py index e8e54def..c838ecb9 100644 --- a/rootly_sdk/models/new_alert_event.py +++ b/rootly_sdk/models/new_alert_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertEvent: data (NewAlertEventData): """ - data: NewAlertEventData + data: "NewAlertEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_event_data.py b/rootly_sdk/models/new_alert_event_data.py index 1533615e..94a35a34 100644 --- a/rootly_sdk/models/new_alert_event_data.py +++ b/rootly_sdk/models/new_alert_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertEventData: """ type_: NewAlertEventDataType - attributes: NewAlertEventDataAttributes + attributes: "NewAlertEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_event_data_attributes.py b/rootly_sdk/models/new_alert_event_data_attributes.py index fa2ef336..be5da6d1 100644 --- a/rootly_sdk/models/new_alert_event_data_attributes.py +++ b/rootly_sdk/models/new_alert_event_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,12 +18,12 @@ class NewAlertEventDataAttributes: Attributes: kind (NewAlertEventDataAttributesKind): details (str): Note message. - user_id (int | Unset): Author of the note. + user_id (Union[Unset, int]): Author of the note. """ kind: NewAlertEventDataAttributesKind details: str - user_id: int | Unset = UNSET + user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind diff --git a/rootly_sdk/models/new_alert_field.py b/rootly_sdk/models/new_alert_field.py index be0fa49a..8a07ae9c 100644 --- a/rootly_sdk/models/new_alert_field.py +++ b/rootly_sdk/models/new_alert_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertField: data (NewAlertFieldData): """ - data: NewAlertFieldData + data: "NewAlertFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_field_data.py b/rootly_sdk/models/new_alert_field_data.py index 2be303ec..f1029426 100644 --- a/rootly_sdk/models/new_alert_field_data.py +++ b/rootly_sdk/models/new_alert_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertFieldData: """ type_: NewAlertFieldDataType - attributes: NewAlertFieldDataAttributes + attributes: "NewAlertFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_field_data_attributes.py b/rootly_sdk/models/new_alert_field_data_attributes.py index d3021a24..3ca9b928 100644 --- a/rootly_sdk/models/new_alert_field_data_attributes.py +++ b/rootly_sdk/models/new_alert_field_data_attributes.py @@ -1,10 +1,10 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define +from ..types import UNSET, Unset + T = TypeVar("T", bound="NewAlertFieldDataAttributes") @@ -13,13 +13,22 @@ class NewAlertFieldDataAttributes: """ Attributes: name (str): The name of the alert field + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. """ name: str + slug: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + field_dict: dict[str, Any] = {} field_dict.update( @@ -27,6 +36,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug return field_dict @@ -35,8 +46,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + new_alert_field_data_attributes = cls( name=name, + slug=slug, ) return new_alert_field_data_attributes diff --git a/rootly_sdk/models/new_alert_group.py b/rootly_sdk/models/new_alert_group.py index 8f3c7eaf..e61d1901 100644 --- a/rootly_sdk/models/new_alert_group.py +++ b/rootly_sdk/models/new_alert_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertGroup: data (NewAlertGroupData): """ - data: NewAlertGroupData + data: "NewAlertGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_group_data.py b/rootly_sdk/models/new_alert_group_data.py index f11830f5..c0de3056 100644 --- a/rootly_sdk/models/new_alert_group_data.py +++ b/rootly_sdk/models/new_alert_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertGroupData: """ type_: NewAlertGroupDataType - attributes: NewAlertGroupDataAttributes + attributes: "NewAlertGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_group_data_attributes.py b/rootly_sdk/models/new_alert_group_data_attributes.py index 7fe6b383..fbc22242 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes.py +++ b/rootly_sdk/models/new_alert_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -33,37 +31,45 @@ class NewAlertGroupDataAttributes: """ Attributes: name (str): The name of the alert group - description (None | str | Unset): The description of the alert urgency - time_window (int | Unset): The length of time an Alert Group should stay open and accept new alerts - targets (list[NewAlertGroupDataAttributesTargetsItem] | Unset): - attributes (list[NewAlertGroupDataAttributesAttributesItem] | Unset): This field is deprecated. Please use the - `conditions` field instead, `attributes` will be removed in the future. - group_by_alert_title (NewAlertGroupDataAttributesGroupByAlertTitle | Unset): [DEPRECATED] Whether the alerts - should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced alert - grouping instead. - group_by_alert_urgency (NewAlertGroupDataAttributesGroupByAlertUrgency | Unset): [DEPRECATED] Whether the alerts - should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with advanced alert - grouping instead. - condition_type (NewAlertGroupDataAttributesConditionType | Unset): Group alerts when ANY or ALL of the fields - are matching. - conditions (list[NewAlertGroupDataAttributesConditionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the alert urgency + time_window (Union[Unset, int]): The length of time an Alert Group should stay open and accept new alerts + targets (Union[Unset, list['NewAlertGroupDataAttributesTargetsItem']]): + attributes (Union[Unset, list['NewAlertGroupDataAttributesAttributesItem']]): This field is deprecated. Please + use the `conditions` field instead, `attributes` will be removed in the future. + group_by_alert_title (Union[Unset, NewAlertGroupDataAttributesGroupByAlertTitle]): [DEPRECATED] Whether the + alerts should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced + alert grouping instead. + group_by_alert_urgency (Union[Unset, NewAlertGroupDataAttributesGroupByAlertUrgency]): [DEPRECATED] Whether the + alerts should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with advanced + alert grouping instead. + condition_type (Union[Unset, NewAlertGroupDataAttributesConditionType]): Group alerts when ANY or ALL of the + fields are matching. + conditions (Union[Unset, list['NewAlertGroupDataAttributesConditionsItem']]): """ name: str - description: None | str | Unset = UNSET - time_window: int | Unset = UNSET - targets: list[NewAlertGroupDataAttributesTargetsItem] | Unset = UNSET - attributes: list[NewAlertGroupDataAttributesAttributesItem] | Unset = UNSET - group_by_alert_title: NewAlertGroupDataAttributesGroupByAlertTitle | Unset = UNSET - group_by_alert_urgency: NewAlertGroupDataAttributesGroupByAlertUrgency | Unset = UNSET - condition_type: NewAlertGroupDataAttributesConditionType | Unset = UNSET - conditions: list[NewAlertGroupDataAttributesConditionsItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + time_window: Unset | int = UNSET + targets: Unset | list["NewAlertGroupDataAttributesTargetsItem"] = UNSET + attributes: Unset | list["NewAlertGroupDataAttributesAttributesItem"] = UNSET + group_by_alert_title: Unset | NewAlertGroupDataAttributesGroupByAlertTitle = UNSET + group_by_alert_urgency: Unset | NewAlertGroupDataAttributesGroupByAlertUrgency = UNSET + condition_type: Unset | NewAlertGroupDataAttributesConditionType = UNSET + conditions: Unset | list["NewAlertGroupDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -71,33 +77,33 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: list[dict[str, Any]] | Unset = UNSET + targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: list[dict[str, Any]] | Unset = UNSET + attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - group_by_alert_title: int | Unset = UNSET + group_by_alert_title: Unset | int = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: int | Unset = UNSET + group_by_alert_urgency: Unset | int = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -111,6 +117,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if time_window is not UNSET: @@ -139,44 +147,49 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) time_window = d.pop("time_window", UNSET) + targets = [] _targets = d.pop("targets", UNSET) - targets: list[NewAlertGroupDataAttributesTargetsItem] | Unset = UNSET - if _targets is not UNSET: - targets = [] - for targets_item_data in _targets: - targets_item = NewAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) + for targets_item_data in _targets or []: + targets_item = NewAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) - targets.append(targets_item) + targets.append(targets_item) + attributes = [] _attributes = d.pop("attributes", UNSET) - attributes: list[NewAlertGroupDataAttributesAttributesItem] | Unset = UNSET - if _attributes is not UNSET: - attributes = [] - for attributes_item_data in _attributes: - attributes_item = NewAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) + for attributes_item_data in _attributes or []: + attributes_item = NewAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) - attributes.append(attributes_item) + attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: NewAlertGroupDataAttributesGroupByAlertTitle | Unset + group_by_alert_title: Unset | NewAlertGroupDataAttributesGroupByAlertTitle if isinstance(_group_by_alert_title, Unset): group_by_alert_title = UNSET else: group_by_alert_title = check_new_alert_group_data_attributes_group_by_alert_title(_group_by_alert_title) _group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - group_by_alert_urgency: NewAlertGroupDataAttributesGroupByAlertUrgency | Unset + group_by_alert_urgency: Unset | NewAlertGroupDataAttributesGroupByAlertUrgency if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -185,23 +198,22 @@ def _parse_description(data: object) -> None | str | Unset: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewAlertGroupDataAttributesConditionType | Unset + condition_type: Unset | NewAlertGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_alert_group_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[NewAlertGroupDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = NewAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = NewAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) new_alert_group_data_attributes = cls( name=name, + slug=slug, description=description, time_window=time_window, targets=targets, diff --git a/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py b/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py index 32f2336b..7137d960 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class NewAlertGroupDataAttributesAttributesItem: """ Attributes: - json_path (str | Unset): The JSON path to the value to group by. + json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: str | Unset = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py index b4add325..bc64e1f2 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -30,31 +28,32 @@ class NewAlertGroupDataAttributesConditionsItem: property_field_type (NewAlertGroupDataAttributesConditionsItemPropertyFieldType): The type of the property field property_field_condition_type (NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_name (str | Unset): The name of the property field. If the property field type is selected as - 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' and - 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the property - field name should be supplied in JSON Path syntax. - property_field_value (str | Unset): The value of the property field. Can be null if the property field condition - type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Need to be passed if the property - field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition. Only need to be - set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property + property_field_name (Union[Unset, str]): The name of the property field. If the property field type is selected + as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' + and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the + property field name should be supplied in JSON Path syntax. + property_field_value (Union[Unset, str]): The value of the property field. Can be null if the property field + condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Need to be passed if the + property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is + 'alert_urgency' + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition. Only need to + be set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (NewAlertGroupDataAttributesConditionsItemConditionableType | Unset): The type of the + conditionable_type (Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType]): The type of the conditionable - conditionable_id (str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is the ID - of the alert field. + conditionable_id (Union[Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, this is + the ID of the alert field. """ property_field_type: NewAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - property_field_name: str | Unset = UNSET - property_field_value: str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: NewAlertGroupDataAttributesConditionsItemConditionableType | Unset = UNSET - conditionable_id: str | Unset = UNSET + property_field_name: Unset | str = UNSET + property_field_value: Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | NewAlertGroupDataAttributesConditionsItemConditionableType = UNSET + conditionable_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,11 +65,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -79,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type @@ -127,7 +126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -138,14 +137,14 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: NewAlertGroupDataAttributesConditionsItemConditionableType | Unset + conditionable_type: Unset | NewAlertGroupDataAttributesConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: diff --git a/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py b/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py index ecc8a286..03851493 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/new_alert_retrigger_rule.py b/rootly_sdk/models/new_alert_retrigger_rule.py new file mode 100644 index 00000000..c62901d5 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_alert_retrigger_rule_data import NewAlertRetriggerRuleData + + +T = TypeVar("T", bound="NewAlertRetriggerRule") + + +@_attrs_define +class NewAlertRetriggerRule: + """ + Attributes: + data (NewAlertRetriggerRuleData): + """ + + data: "NewAlertRetriggerRuleData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_retrigger_rule_data import NewAlertRetriggerRuleData + + d = dict(src_dict) + data = NewAlertRetriggerRuleData.from_dict(d.pop("data")) + + new_alert_retrigger_rule = cls( + data=data, + ) + + new_alert_retrigger_rule.additional_properties = d + return new_alert_retrigger_rule + + @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/rootly_sdk/models/new_alert_retrigger_rule_data.py b/rootly_sdk/models/new_alert_retrigger_rule_data.py new file mode 100644 index 00000000..9adebe16 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_alert_retrigger_rule_data_type import ( + NewAlertRetriggerRuleDataType, + check_new_alert_retrigger_rule_data_type, +) + +if TYPE_CHECKING: + from ..models.new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes + + +T = TypeVar("T", bound="NewAlertRetriggerRuleData") + + +@_attrs_define +class NewAlertRetriggerRuleData: + """ + Attributes: + type_ (NewAlertRetriggerRuleDataType): + attributes (NewAlertRetriggerRuleDataAttributes): + """ + + type_: NewAlertRetriggerRuleDataType + attributes: "NewAlertRetriggerRuleDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes + + d = dict(src_dict) + type_ = check_new_alert_retrigger_rule_data_type(d.pop("type")) + + attributes = NewAlertRetriggerRuleDataAttributes.from_dict(d.pop("attributes")) + + new_alert_retrigger_rule_data = cls( + type_=type_, + attributes=attributes, + ) + + new_alert_retrigger_rule_data.additional_properties = d + return new_alert_retrigger_rule_data + + @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/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py new file mode 100644 index 00000000..1711e7d1 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py @@ -0,0 +1,124 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.new_alert_retrigger_rule_data_attributes_match_mode import ( + NewAlertRetriggerRuleDataAttributesMatchMode, + check_new_alert_retrigger_rule_data_attributes_match_mode, +) +from ..models.new_alert_retrigger_rule_data_attributes_timeout_minutes import ( + NewAlertRetriggerRuleDataAttributesTimeoutMinutes, + check_new_alert_retrigger_rule_data_attributes_timeout_minutes, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.new_alert_retrigger_rule_data_attributes_conditions_item import ( + NewAlertRetriggerRuleDataAttributesConditionsItem, + ) + + +T = TypeVar("T", bound="NewAlertRetriggerRuleDataAttributes") + + +@_attrs_define +class NewAlertRetriggerRuleDataAttributes: + """ + Attributes: + name (str): A human-readable name for the rule + match_mode (Union[Unset, NewAlertRetriggerRuleDataAttributesMatchMode]): Whether all or any of the conditions + must match + timeout_minutes (Union[Unset, NewAlertRetriggerRuleDataAttributesTimeoutMinutes]): Re-trigger the alert this + many minutes after acknowledgment. Null means never re-trigger. + position (Union[Unset, int]): The position of the rule; the first matching rule (by position) decides the + outcome + conditions (Union[Unset, list['NewAlertRetriggerRuleDataAttributesConditionsItem']]): The conditions that + determine which alerts this rule applies to. An empty array applies to every alert. + """ + + name: str + match_mode: Unset | NewAlertRetriggerRuleDataAttributesMatchMode = UNSET + timeout_minutes: Unset | NewAlertRetriggerRuleDataAttributesTimeoutMinutes = UNSET + position: Unset | int = UNSET + conditions: Unset | list["NewAlertRetriggerRuleDataAttributesConditionsItem"] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + match_mode: Unset | str = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + timeout_minutes: Unset | int = UNSET + if not isinstance(self.timeout_minutes, Unset): + timeout_minutes = self.timeout_minutes + + position = self.position + + conditions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.conditions, Unset): + conditions = [] + for conditions_item_data in self.conditions: + conditions_item = conditions_item_data.to_dict() + conditions.append(conditions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if position is not UNSET: + field_dict["position"] = position + if conditions is not UNSET: + field_dict["conditions"] = conditions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_retrigger_rule_data_attributes_conditions_item import ( + NewAlertRetriggerRuleDataAttributesConditionsItem, + ) + + d = dict(src_dict) + name = d.pop("name") + + _match_mode = d.pop("match_mode", UNSET) + match_mode: Unset | NewAlertRetriggerRuleDataAttributesMatchMode + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_new_alert_retrigger_rule_data_attributes_match_mode(_match_mode) + + _timeout_minutes = d.pop("timeout_minutes", UNSET) + timeout_minutes: Unset | NewAlertRetriggerRuleDataAttributesTimeoutMinutes + if isinstance(_timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = check_new_alert_retrigger_rule_data_attributes_timeout_minutes(_timeout_minutes) + + position = d.pop("position", UNSET) + + conditions = [] + _conditions = d.pop("conditions", UNSET) + for conditions_item_data in _conditions or []: + conditions_item = NewAlertRetriggerRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + + conditions.append(conditions_item) + + new_alert_retrigger_rule_data_attributes = cls( + name=name, + match_mode=match_mode, + timeout_minutes=timeout_minutes, + position=position, + conditions=conditions, + ) + + return new_alert_retrigger_rule_data_attributes diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py new file mode 100644 index 00000000..ebf1e048 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + NewAlertRetriggerRuleDataAttributesConditionsItemKind, + check_new_alert_retrigger_rule_data_attributes_conditions_item_kind, +) +from ..models.new_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + NewAlertRetriggerRuleDataAttributesConditionsItemOperator, + check_new_alert_retrigger_rule_data_attributes_conditions_item_operator, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewAlertRetriggerRuleDataAttributesConditionsItem") + + +@_attrs_define +class NewAlertRetriggerRuleDataAttributesConditionsItem: + """ + Attributes: + kind (NewAlertRetriggerRuleDataAttributesConditionsItemKind): The operand the condition matches on. Native + operands (urgency, source, service, group) match by record; alert_field/payload match a field value. + operator (NewAlertRetriggerRuleDataAttributesConditionsItemOperator): How the operand is compared. Native + operands support is_one_of/is_not_one_of/is_set/is_not_set; alert_field/payload additionally support the + string/regex operators. + record_ids (Union[Unset, list[UUID]]): For urgency/service/group/source conditions: the IDs of the matched + records (AlertUrgency, Service, Group, or Alerts::Source). + values (Union[Unset, list[str]]): For source conditions: non-integration source aliases (e.g. manual, api). For + alert_field/payload conditions: the values to compare against. + property_field_name (Union[Unset, str]): For alert_field conditions: the alert field id. For payload conditions: + a JSON Path (e.g. $.priority). + """ + + kind: NewAlertRetriggerRuleDataAttributesConditionsItemKind + operator: NewAlertRetriggerRuleDataAttributesConditionsItemOperator + record_ids: Unset | list[UUID] = UNSET + values: Unset | list[str] = UNSET + property_field_name: Unset | str = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + operator: str = self.operator + + record_ids: Unset | list[str] = UNSET + if not isinstance(self.record_ids, Unset): + record_ids = [] + for record_ids_item_data in self.record_ids: + record_ids_item = str(record_ids_item_data) + record_ids.append(record_ids_item) + + values: Unset | list[str] = UNSET + if not isinstance(self.values, Unset): + values = self.values + + property_field_name = self.property_field_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "kind": kind, + "operator": operator, + } + ) + if record_ids is not UNSET: + field_dict["record_ids"] = record_ids + if values is not UNSET: + field_dict["values"] = values + if property_field_name is not UNSET: + field_dict["property_field_name"] = property_field_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_new_alert_retrigger_rule_data_attributes_conditions_item_kind(d.pop("kind")) + + operator = check_new_alert_retrigger_rule_data_attributes_conditions_item_operator(d.pop("operator")) + + record_ids = [] + _record_ids = d.pop("record_ids", UNSET) + for record_ids_item_data in _record_ids or []: + record_ids_item = UUID(record_ids_item_data) + + record_ids.append(record_ids_item) + + values = cast(list[str], d.pop("values", UNSET)) + + property_field_name = d.pop("property_field_name", UNSET) + + new_alert_retrigger_rule_data_attributes_conditions_item = cls( + kind=kind, + operator=operator, + record_ids=record_ids, + values=values, + property_field_name=property_field_name, + ) + + new_alert_retrigger_rule_data_attributes_conditions_item.additional_properties = d + return new_alert_retrigger_rule_data_attributes_conditions_item + + @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/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py new file mode 100644 index 00000000..43e64777 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py @@ -0,0 +1,28 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesConditionsItemKind = Literal[ + "alert_field", "group", "payload", "service", "source", "urgency" +] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: set[ + NewAlertRetriggerRuleDataAttributesConditionsItemKind +] = { + "alert_field", + "group", + "payload", + "service", + "source", + "urgency", +} + + +def check_new_alert_retrigger_rule_data_attributes_conditions_item_kind( + value: str | None, +) -> NewAlertRetriggerRuleDataAttributesConditionsItemKind | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesConditionsItemKind, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py new file mode 100644 index 00000000..8203628d --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py @@ -0,0 +1,39 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesConditionsItemOperator = Literal[ + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: set[ + NewAlertRetriggerRuleDataAttributesConditionsItemOperator +] = { + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +} + + +def check_new_alert_retrigger_rule_data_attributes_conditions_item_operator( + value: str | None, +) -> NewAlertRetriggerRuleDataAttributesConditionsItemOperator | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesConditionsItemOperator, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py new file mode 100644 index 00000000..893aa6d5 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesMatchMode = Literal["match-all-rules", "match-any-rule"] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: set[NewAlertRetriggerRuleDataAttributesMatchMode] = { + "match-all-rules", + "match-any-rule", +} + + +def check_new_alert_retrigger_rule_data_attributes_match_mode( + value: str | None, +) -> NewAlertRetriggerRuleDataAttributesMatchMode | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesMatchMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py new file mode 100644 index 00000000..3ae3d4fe --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py @@ -0,0 +1,34 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesTimeoutMinutes = Literal[ + 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: set[ + NewAlertRetriggerRuleDataAttributesTimeoutMinutes +] = { + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_new_alert_retrigger_rule_data_attributes_timeout_minutes( + value: int, +) -> NewAlertRetriggerRuleDataAttributesTimeoutMinutes: + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesTimeoutMinutes, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_type.py b/rootly_sdk/models/new_alert_retrigger_rule_data_type.py new file mode 100644 index 00000000..66fa671d --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataType = Literal["alert_retrigger_rules"] + +NEW_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: set[NewAlertRetriggerRuleDataType] = { + "alert_retrigger_rules", +} + + +def check_new_alert_retrigger_rule_data_type(value: str | None) -> NewAlertRetriggerRuleDataType | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: + return cast(NewAlertRetriggerRuleDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_route.py b/rootly_sdk/models/new_alert_route.py index 12b360a5..44053e1b 100644 --- a/rootly_sdk/models/new_alert_route.py +++ b/rootly_sdk/models/new_alert_route.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class NewAlertRoute: """ Attributes: - data (NewAlertRouteData | Unset): + data (Union[Unset, NewAlertRouteData]): """ - data: NewAlertRouteData | Unset = UNSET + data: Union[Unset, "NewAlertRouteData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: NewAlertRouteData | Unset + data: Unset | NewAlertRouteData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/new_alert_route_data.py b/rootly_sdk/models/new_alert_route_data.py index 45913777..8f32aa22 100644 --- a/rootly_sdk/models/new_alert_route_data.py +++ b/rootly_sdk/models/new_alert_route_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class NewAlertRouteData: """ Attributes: - type_ (NewAlertRouteDataType | Unset): - attributes (NewAlertRouteDataAttributes | Unset): + type_ (Union[Unset, NewAlertRouteDataType]): + attributes (Union[Unset, NewAlertRouteDataAttributes]): """ - type_: NewAlertRouteDataType | Unset = UNSET - attributes: NewAlertRouteDataAttributes | Unset = UNSET + type_: Unset | NewAlertRouteDataType = UNSET + attributes: Union[Unset, "NewAlertRouteDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: NewAlertRouteDataType | Unset + type_: Unset | NewAlertRouteDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_alert_route_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: NewAlertRouteDataAttributes | Unset + attributes: Unset | NewAlertRouteDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/new_alert_route_data_attributes.py b/rootly_sdk/models/new_alert_route_data_attributes.py index a68d9865..6f14fe06 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes.py +++ b/rootly_sdk/models/new_alert_route_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -22,20 +20,19 @@ class NewAlertRouteDataAttributes: Attributes: name (str): The name of the alert route alerts_source_ids (list[UUID]): - enabled (bool | Unset): Whether the alert route is enabled - owning_team_ids (list[UUID] | Unset): - rules (list[NewAlertRouteDataAttributesRulesItem] | Unset): + enabled (Union[Unset, bool]): Whether the alert route is enabled + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['NewAlertRouteDataAttributesRulesItem']]): """ name: str alerts_source_ids: list[UUID] - enabled: bool | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[NewAlertRouteDataAttributesRulesItem] | Unset = UNSET + enabled: Unset | bool = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["NewAlertRouteDataAttributesRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name alerts_source_ids = [] @@ -45,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -92,23 +89,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[NewAlertRouteDataAttributesRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = NewAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = NewAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) new_alert_route_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py index 1c4d8b23..ccc3722c 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class NewAlertRouteDataAttributesRulesItem: """ Attributes: name (str): The name of the alert routing rule - destinations (list[NewAlertRouteDataAttributesRulesItemDestinationsItem]): - condition_groups (list[NewAlertRouteDataAttributesRulesItemConditionGroupsItem]): - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. + destinations (list['NewAlertRouteDataAttributesRulesItemDestinationsItem']): + condition_groups (list['NewAlertRouteDataAttributesRulesItemConditionGroupsItem']): + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. """ name: str - destinations: list[NewAlertRouteDataAttributesRulesItemDestinationsItem] - condition_groups: list[NewAlertRouteDataAttributesRulesItemConditionGroupsItem] - position: int | Unset = UNSET - fallback_rule: bool | Unset = False + destinations: list["NewAlertRouteDataAttributesRulesItemDestinationsItem"] + condition_groups: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItem"] + position: Unset | int = UNSET + fallback_rule: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name destinations = [] diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py index f5187e45..68d9d2c3 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,16 +19,15 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - conditions (list[NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem]): - position (int | Unset): The position of the condition group + conditions (list['NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']): + position (Union[Unset, int]): The position of the condition group """ - conditions: list[NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] - position: int | Unset = UNSET + conditions: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index 22a91c83..76514557 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -31,27 +29,28 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: property_field_condition_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - property_field_name (str | Unset): The name of the property field - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + property_field_name (Union[Unset, str]): The name of the property field + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, + NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ property_field_condition_type: ( NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET + property_field_name: Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET conditionable_type: ( - NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + Unset | NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType ) = UNSET - conditionable_id: None | Unset | UUID = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -85,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -135,16 +134,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -155,13 +154,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -172,15 +171,15 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + Unset | NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -189,7 +188,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -200,9 +199,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py index 988b84be..177f40d1 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/new_alert_routing_rule.py b/rootly_sdk/models/new_alert_routing_rule.py index 99586182..2dd1368b 100644 --- a/rootly_sdk/models/new_alert_routing_rule.py +++ b/rootly_sdk/models/new_alert_routing_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertRoutingRule: data (NewAlertRoutingRuleData): """ - data: NewAlertRoutingRuleData + data: "NewAlertRoutingRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_routing_rule_data.py b/rootly_sdk/models/new_alert_routing_rule_data.py index 82389749..038cc9b0 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data.py +++ b/rootly_sdk/models/new_alert_routing_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewAlertRoutingRuleData: """ type_: NewAlertRoutingRuleDataType - attributes: NewAlertRoutingRuleDataAttributes + attributes: "NewAlertRoutingRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py index 2fb376e7..e6198f3d 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -29,27 +27,26 @@ class NewAlertRoutingRuleDataAttributes: name (str): The name of the alert routing rule alerts_source_id (UUID): The ID of the alerts source destination (NewAlertRoutingRuleDataAttributesDestination): - enabled (bool | Unset): Whether the alert routing rule is enabled - owning_team_ids (list[UUID] | Unset): The IDs of the teams which own the alert routing rule. If the user doesn't - have Alert Routing Create Permission in On-Call Roles, then this field is required and can contain Team IDs the - user is an admin of. - position (int | Unset): The position of the alert routing rule for ordering evaluation - condition_type (NewAlertRoutingRuleDataAttributesConditionType | Unset): The type of condition for the alert - routing rule - conditions (list[NewAlertRoutingRuleDataAttributesConditionsItem] | Unset): + enabled (Union[Unset, bool]): Whether the alert routing rule is enabled + owning_team_ids (Union[Unset, list[UUID]]): The IDs of the teams which own the alert routing rule. If the user + doesn't have Alert Routing Create Permission in On-Call Roles, then this field is required and can contain Team + IDs the user is an admin of. + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + condition_type (Union[Unset, NewAlertRoutingRuleDataAttributesConditionType]): The type of condition for the + alert routing rule + conditions (Union[Unset, list['NewAlertRoutingRuleDataAttributesConditionsItem']]): """ name: str alerts_source_id: UUID - destination: NewAlertRoutingRuleDataAttributesDestination - enabled: bool | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - position: int | Unset = UNSET - condition_type: NewAlertRoutingRuleDataAttributesConditionType | Unset = UNSET - conditions: list[NewAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET + destination: "NewAlertRoutingRuleDataAttributesDestination" + enabled: Unset | bool = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + position: Unset | int = UNSET + condition_type: Unset | NewAlertRoutingRuleDataAttributesConditionType = UNSET + conditions: Unset | list["NewAlertRoutingRuleDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name alerts_source_id = str(self.alerts_source_id) @@ -58,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: @@ -67,11 +64,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -118,32 +115,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) position = d.pop("position", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewAlertRoutingRuleDataAttributesConditionType | Unset + condition_type: Unset | NewAlertRoutingRuleDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_alert_routing_rule_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[NewAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = NewAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = NewAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) new_alert_routing_rule_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py index 8d4358b9..2ec23593 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -31,17 +29,18 @@ class NewAlertRoutingRuleDataAttributesConditionsItem: field name should be supplied in JSON Path syntax. property_field_condition_type (NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_value (str | Unset): The value of the property field. Can be null if the property field condition - type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Need to be passed if the property - field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' + property_field_value (Union[Unset, str]): The value of the property field. Can be null if the property field + condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Need to be passed if the + property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is + 'alert_urgency' """ property_field_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType - property_field_value: str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET + property_field_value: Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py index 09bebab5..9226af15 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/new_alert_urgency.py b/rootly_sdk/models/new_alert_urgency.py index bb1f20c0..0e0e8d79 100644 --- a/rootly_sdk/models/new_alert_urgency.py +++ b/rootly_sdk/models/new_alert_urgency.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertUrgency: data (NewAlertUrgencyData): """ - data: NewAlertUrgencyData + data: "NewAlertUrgencyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_urgency_data.py b/rootly_sdk/models/new_alert_urgency_data.py index bfef8677..345905e1 100644 --- a/rootly_sdk/models/new_alert_urgency_data.py +++ b/rootly_sdk/models/new_alert_urgency_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertUrgencyData: """ type_: NewAlertUrgencyDataType - attributes: NewAlertUrgencyDataAttributes + attributes: "NewAlertUrgencyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_urgency_data_attributes.py b/rootly_sdk/models/new_alert_urgency_data_attributes.py index 9a51775d..6ec17750 100644 --- a/rootly_sdk/models/new_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/new_alert_urgency_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,24 +14,33 @@ class NewAlertUrgencyDataAttributes: Attributes: name (str): The name of the alert urgency description (str): The description of the alert urgency - position (int | None | Unset): Position of the alert urgency + position (Union[None, Unset, int]): Position of the alert urgency + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts of this urgency after N + minutes; null inherits the workspace default, negative = never. """ name: str description: str - position: int | None | Unset = UNSET + position: None | Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position + retrigger_timeout_minutes: None | Unset | int + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + field_dict: dict[str, Any] = {} field_dict.update( @@ -44,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: ) if position is not UNSET: field_dict["position"] = position + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes return field_dict @@ -54,19 +63,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + new_alert_urgency_data_attributes = cls( name=name, description=description, position=position, + retrigger_timeout_minutes=retrigger_timeout_minutes, ) return new_alert_urgency_data_attributes diff --git a/rootly_sdk/models/new_alerts_source.py b/rootly_sdk/models/new_alerts_source.py index f40df906..ecb9f870 100644 --- a/rootly_sdk/models/new_alerts_source.py +++ b/rootly_sdk/models/new_alerts_source.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertsSource: data (NewAlertsSourceData): """ - data: NewAlertsSourceData + data: "NewAlertsSourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alerts_source_data.py b/rootly_sdk/models/new_alerts_source_data.py index f5d4b12e..ab42b780 100644 --- a/rootly_sdk/models/new_alerts_source_data.py +++ b/rootly_sdk/models/new_alerts_source_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertsSourceData: """ type_: NewAlertsSourceDataType - attributes: NewAlertsSourceDataAttributes + attributes: "NewAlertsSourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alerts_source_data_attributes.py b/rootly_sdk/models/new_alerts_source_data_attributes.py index 1cec926d..18dec5e7 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -41,46 +39,50 @@ class NewAlertsSourceDataAttributes: """ Attributes: name (str): The name of the alert source - enabled (bool | Unset): Whether the alert source is enabled. Disabled sources do not create alerts from incoming - events. - source_type (NewAlertsSourceDataAttributesSourceType | Unset): The alert source type - alert_urgency_id (str | Unset): ID for the default alert urgency assigned to this alert source - deduplicate_alerts_by_key (bool | Unset): Toggle alert deduplication using deduplication key. If enabled, + enabled (Union[Unset, bool]): Whether the alert source is enabled. Disabled sources do not create alerts from + incoming events. + source_type (Union[Unset, NewAlertsSourceDataAttributesSourceType]): The alert source type + alert_urgency_id (Union[Unset, str]): ID for the default alert urgency assigned to this alert source + deduplicate_alerts_by_key (Union[Unset, bool]): Toggle alert deduplication using deduplication key. If enabled, deduplication_key_kind and deduplication_key_path are required. - deduplication_key_kind (NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset): Kind of deduplication key. - deduplication_key_path (None | str | Unset): Path to deduplication key. This is a JSON Path to extract the + deduplication_key_kind (Union[Unset, NewAlertsSourceDataAttributesDeduplicationKeyKind]): Kind of deduplication + key. + deduplication_key_path (Union[None, Unset, str]): Path to deduplication key. This is a JSON Path to extract the deduplication key from the request body. - deduplication_key_regexp (None | str | Unset): Regular expression to extract key from value found at key path. - owner_group_ids (list[str] | Unset): List of team IDs that will own the alert source - alert_template_attributes (NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset): - alert_source_urgency_rules_attributes (list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] - | Unset): List of rules that define the conditions under which the alert urgency will be set automatically based - on the alert payload - sourceable_attributes (NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset): Provide - additional attributes for generic_webhook alerts source - resolution_rule_attributes (NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset): Provide - additional attributes for email alerts source - alert_source_fields_attributes (list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset): - List of alert fields to be added to the alert source. Note: This attribute requires the alert field feature to - be enabled on your account. Contact Rootly customer support if you need assistance with this feature. + deduplication_key_regexp (Union[None, Unset, str]): Regular expression to extract key from value found at key + path. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that will own the alert source + alert_template_attributes (Union['NewAlertsSourceDataAttributesAlertTemplateAttributesType0', None, Unset]): + alert_source_urgency_rules_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem']]): List of rules that define the + conditions under which the alert urgency will be set automatically based on the alert payload + sourceable_attributes (Union['NewAlertsSourceDataAttributesSourceableAttributesType0', None, Unset]): Provide + additional attributes for the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` + apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + resolution_rule_attributes (Union['NewAlertsSourceDataAttributesResolutionRuleAttributesType0', None, Unset]): + Provide additional attributes for email alerts source + alert_source_fields_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem']]): List of alert fields to be added to the + alert source. Note: This attribute requires the alert field feature to be enabled on your account. Contact + Rootly customer support if you need assistance with this feature. """ name: str - enabled: bool | Unset = UNSET - source_type: NewAlertsSourceDataAttributesSourceType | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - deduplicate_alerts_by_key: bool | Unset = UNSET - deduplication_key_kind: NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset = UNSET - deduplication_key_path: None | str | Unset = UNSET - deduplication_key_regexp: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - alert_template_attributes: NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset = UNSET + enabled: Unset | bool = UNSET + source_type: Unset | NewAlertsSourceDataAttributesSourceType = UNSET + alert_urgency_id: Unset | str = UNSET + deduplicate_alerts_by_key: Unset | bool = UNSET + deduplication_key_kind: Unset | NewAlertsSourceDataAttributesDeduplicationKeyKind = UNSET + deduplication_key_path: None | Unset | str = UNSET + deduplication_key_regexp: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + alert_template_attributes: Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset] = UNSET alert_source_urgency_rules_attributes: ( - list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset + Unset | list["NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] ) = UNSET - sourceable_attributes: NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset = UNSET - resolution_rule_attributes: NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset = UNSET - alert_source_fields_attributes: list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = UNSET + sourceable_attributes: Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET + resolution_rule_attributes: Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = UNSET + alert_source_fields_attributes: Unset | list["NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alerts_source_data_attributes_alert_template_attributes_type_0 import ( @@ -97,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: str | Unset = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -105,27 +107,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: str | Unset = UNSET + deduplication_key_kind: Unset | str = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | str | Unset + deduplication_key_path: None | Unset | str if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | str | Unset + deduplication_key_regexp: None | Unset | str if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: dict[str, Any] | None | Unset + alert_template_attributes: None | Unset | dict[str, Any] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, NewAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -133,14 +135,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: dict[str, Any] | None | Unset + sourceable_attributes: None | Unset | dict[str, Any] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, NewAlertsSourceDataAttributesSourceableAttributesType0): @@ -148,7 +150,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: dict[str, Any] | None | Unset + resolution_rule_attributes: None | Unset | dict[str, Any] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, NewAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -156,7 +158,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: @@ -223,7 +225,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: NewAlertsSourceDataAttributesSourceType | Unset + source_type: Unset | NewAlertsSourceDataAttributesSourceType if isinstance(_source_type, Unset): source_type = UNSET else: @@ -234,7 +236,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset + deduplication_key_kind: Unset | NewAlertsSourceDataAttributesDeduplicationKeyKind if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -242,21 +244,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> None | str | Unset: + def _parse_deduplication_key_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: + def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -264,7 +266,7 @@ def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: def _parse_alert_template_attributes( data: object, - ) -> NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset: + ) -> Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -277,30 +279,26 @@ def _parse_alert_template_attributes( ) return alert_template_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset, data) + return cast(Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset], data) alert_template_attributes = _parse_alert_template_attributes(d.pop("alert_template_attributes", UNSET)) + alert_source_urgency_rules_attributes = [] _alert_source_urgency_rules_attributes = d.pop("alert_source_urgency_rules_attributes", UNSET) - alert_source_urgency_rules_attributes: ( - list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset - ) = UNSET - if _alert_source_urgency_rules_attributes is not UNSET: - alert_source_urgency_rules_attributes = [] - for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes: - alert_source_urgency_rules_attributes_item = ( - NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( - alert_source_urgency_rules_attributes_item_data - ) + for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes or []: + alert_source_urgency_rules_attributes_item = ( + NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( + alert_source_urgency_rules_attributes_item_data ) + ) - alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) + alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) def _parse_sourceable_attributes( data: object, - ) -> NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset: + ) -> Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -311,15 +309,15 @@ def _parse_sourceable_attributes( sourceable_attributes_type_0 = NewAlertsSourceDataAttributesSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset, data) + return cast(Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset], data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) def _parse_resolution_rule_attributes( data: object, - ) -> NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset: + ) -> Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -332,26 +330,22 @@ def _parse_resolution_rule_attributes( ) return resolution_rule_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset, data) + return cast(Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset], data) resolution_rule_attributes = _parse_resolution_rule_attributes(d.pop("resolution_rule_attributes", UNSET)) + alert_source_fields_attributes = [] _alert_source_fields_attributes = d.pop("alert_source_fields_attributes", UNSET) - alert_source_fields_attributes: list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = ( - UNSET - ) - if _alert_source_fields_attributes is not UNSET: - alert_source_fields_attributes = [] - for alert_source_fields_attributes_item_data in _alert_source_fields_attributes: - alert_source_fields_attributes_item = ( - NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( - alert_source_fields_attributes_item_data - ) + for alert_source_fields_attributes_item_data in _alert_source_fields_attributes or []: + alert_source_fields_attributes_item = ( + NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( + alert_source_fields_attributes_item_data ) + ) - alert_source_fields_attributes.append(alert_source_fields_attributes_item) + alert_source_fields_attributes.append(alert_source_fields_attributes_item) new_alerts_source_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py index 7b99100f..9604cf22 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,19 +13,19 @@ class NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: """ Attributes: - alert_field_id (str | Unset): The ID of the alert field - template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for - evaluation + alert_field_id (Union[Unset, str]): The ID of the alert field + template_body (Union[None, Unset, str]): Liquid expression to extract a specific value from the alert's payload + for evaluation """ - alert_field_id: str | Unset = UNSET - template_body: None | str | Unset = UNSET + alert_field_id: Unset | str = UNSET + template_body: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | str | Unset + template_body: None | Unset | str if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -48,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> None | str | Unset: + def _parse_template_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py index a410af64..936d25df 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,56 +25,57 @@ class NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: """ Attributes: - json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for - evaluation - operator (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset): Comparison + json_path (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload + for evaluation + operator (Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator]): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset): The kind of the + conditionable_type (Union[Unset, + NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind]): The kind of the conditionable - alert_urgency_id (str | Unset): The ID of the alert urgency + alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: None | str | Unset = UNSET - operator: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset = ( + json_path: None | Unset | str = UNSET + operator: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType = ( UNSET ) - conditionable_id: None | str | Unset = UNSET - kind: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET - alert_urgency_id: str | Unset = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind = UNSET + alert_urgency_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | str | Unset + json_path: None | Unset | str if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: str | Unset = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -106,17 +105,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_json_path(data: object) -> None | str | Unset: + def _parse_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset + operator: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -127,7 +126,7 @@ def _parse_json_path(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset + conditionable_type: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -137,17 +136,17 @@ def _parse_json_path(data: object) -> None | str | Unset: ) ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset + kind: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py index 7d672082..f4593a89 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class NewAlertsSourceDataAttributesAlertTemplateAttributesType0: """ Attributes: - title (None | str | Unset): The alert title. - description (None | str | Unset): The alert description. - external_url (None | str | Unset): The alert URL. + title (Union[None, Unset, str]): The alert title. + description (Union[None, Unset, str]): The alert description. + external_url (Union[None, Unset, str]): The alert URL. """ - title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET + title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -60,30 +58,30 @@ 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_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py index 7af8435b..534a697e 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,74 +32,76 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (bool | Unset): Set this to true to enable the auto resolution rule - condition_type (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset): The type of - condition to evaluate to apply auto resolution rule - identifier_matchable_type (NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | - Unset): The type of the identifier matchable - identifier_matchable_id (None | str | Unset): The ID of the identifier matchable. If identifier_matchable_type - is AlertField, this is the ID of the alert field. - identifier_reference_kind (NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | - Unset): The kind of the identifier reference - identifier_json_path (None | str | Unset): JSON path expression to extract unique alert identifier used to match - triggered alerts with resolving alerts - identifier_value_regex (None | str | Unset): Regex group to further specify the part of the string used as a - unique identifier - conditions_attributes (list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] - | Unset): List of conditions to evaluate for auto resolution + enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule + condition_type (Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType]): The type + of condition to evaluate to apply auto resolution rule + identifier_matchable_type (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType]): The type of the identifier + matchable + identifier_matchable_id (Union[None, Unset, str]): The ID of the identifier matchable. If + identifier_matchable_type is AlertField, this is the ID of the alert field. + identifier_reference_kind (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind]): The kind of the identifier + reference + identifier_json_path (Union[None, Unset, str]): JSON path expression to extract unique alert identifier used to + match triggered alerts with resolving alerts + identifier_value_regex (Union[None, Unset, str]): Regex group to further specify the part of the string used as + a unique identifier + conditions_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem']]): List of conditions + to evaluate for auto resolution """ - enabled: bool | Unset = UNSET - condition_type: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset = UNSET + enabled: Unset | bool = UNSET + condition_type: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = UNSET identifier_matchable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType ) = UNSET - identifier_matchable_id: None | str | Unset = UNSET + identifier_matchable_id: None | Unset | str = UNSET identifier_reference_kind: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind ) = UNSET - identifier_json_path: None | str | Unset = UNSET - identifier_value_regex: None | str | Unset = UNSET + identifier_json_path: None | Unset | str = UNSET + identifier_value_regex: None | Unset | str = UNSET conditions_attributes: ( - list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset + Unset | list["NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: str | Unset = UNSET + identifier_matchable_type: Unset | str = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | str | Unset + identifier_matchable_id: None | Unset | str if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: str | Unset = UNSET + identifier_reference_kind: Unset | str = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | str | Unset + identifier_json_path: None | Unset | str if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | str | Unset + identifier_value_regex: None | Unset | str if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: list[dict[str, Any]] | Unset = UNSET + conditions_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -140,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset + condition_type: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -150,7 +150,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) identifier_matchable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType ) if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET @@ -161,18 +161,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> None | str | Unset: + def _parse_identifier_matchable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) identifier_reference_kind: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind ) if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET @@ -183,38 +183,34 @@ def _parse_identifier_matchable_id(data: object) -> None | str | Unset: ) ) - def _parse_identifier_json_path(data: object) -> None | str | Unset: + def _parse_identifier_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | str | Unset: + def _parse_identifier_value_regex(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) + conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - conditions_attributes: ( - list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset - ) = UNSET - if _conditions_attributes is not UNSET: - conditions_attributes = [] - for conditions_attributes_item_data in _conditions_attributes: - conditions_attributes_item = ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) + for conditions_attributes_item_data in _conditions_attributes or []: + conditions_attributes_item = ( + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( + conditions_attributes_item_data ) + ) - conditions_attributes.append(conditions_attributes_item) + conditions_attributes.append(conditions_attributes_item) new_alerts_source_data_attributes_resolution_rule_attributes_type_0 = cls( enabled=enabled, diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py index a3163489..111fd8fc 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,55 +25,56 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset): - Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + operator (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison + operator used to evaluate the extracted value against the specified condition + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type - (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset): - The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset): The kind + conditionable_type (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The type of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind]): The + kind of the conditionable """ - field: None | str | Unset = UNSET - operator: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET + field: None | Unset | str = UNSET + operator: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = UNSET + value: Unset | str = UNSET conditionable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType ) = UNSET - conditionable_id: None | str | Unset = UNSET - kind: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | str | Unset + field: None | Unset | str if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: str | Unset = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -101,17 +100,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_field(data: object) -> None | str | Unset: + def _parse_field(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset + operator: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -123,7 +122,7 @@ def _parse_field(data: object) -> None | str | Unset: _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -132,17 +131,17 @@ def _parse_field(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset + kind: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py index 07b1013b..4b8318ca 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -19,32 +17,32 @@ @_attrs_define class NewAlertsSourceDataAttributesSourceableAttributesType0: - """Provide additional attributes for generic_webhook alerts source - - Attributes: - auto_resolve (bool | Unset): Set this to true to auto-resolve alerts based on field_mappings_attributes - conditions - resolve_state (None | str | Unset): This value is matched with the value extracted from alerts payload using - JSON path in field_mappings_attributes - accept_threaded_emails (bool | Unset): Set this to false to reject threaded emails - field_mappings_attributes - (list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset): Specify rules - to auto resolve alerts + """Provide additional attributes for the underlying source. `auto_resolve`, `resolve_state` and + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + + Attributes: + auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + conditions + resolve_state (Union[None, Unset, str]): This value is matched with the value extracted from alerts payload + using JSON path in field_mappings_attributes + accept_threaded_emails (Union[Unset, bool]): Set this to false to reject threaded emails + field_mappings_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to + auto resolve alerts """ - auto_resolve: bool | Unset = UNSET - resolve_state: None | str | Unset = UNSET - accept_threaded_emails: bool | Unset = UNSET + auto_resolve: Unset | bool = UNSET + resolve_state: None | Unset | str = UNSET + accept_threaded_emails: Unset | bool = UNSET field_mappings_attributes: ( - list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset + Unset | list["NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - auto_resolve = self.auto_resolve - resolve_state: None | str | Unset + resolve_state: None | Unset | str if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET + field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -82,31 +80,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | str | Unset: + def _parse_resolve_state(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) accept_threaded_emails = d.pop("accept_threaded_emails", UNSET) + field_mappings_attributes = [] _field_mappings_attributes = d.pop("field_mappings_attributes", UNSET) - field_mappings_attributes: ( - list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset - ) = UNSET - if _field_mappings_attributes is not UNSET: - field_mappings_attributes = [] - for field_mappings_attributes_item_data in _field_mappings_attributes: - field_mappings_attributes_item = ( - NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data - ) + for field_mappings_attributes_item_data in _field_mappings_attributes or []: + field_mappings_attributes_item = ( + NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( + field_mappings_attributes_item_data ) + ) - field_mappings_attributes.append(field_mappings_attributes_item) + field_mappings_attributes.append(field_mappings_attributes_item) new_alerts_source_data_attributes_sourceable_attributes_type_0 = cls( auto_resolve=auto_resolve, diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py index 680df17a..1aa55748 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,19 +17,19 @@ class NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset): Select - the field on which the condition to be evaluated - json_path (str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[Unset, NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField]): + Select the field on which the condition to be evaluated + json_path (Union[Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation. For `notification_target_id` only: if your account has opted in to Dynamic Notification Targets, this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET - json_path: str | Unset = UNSET + field: Unset | NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: str | Unset = UNSET + field: Unset | str = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset + field: Unset | NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/new_api_key.py b/rootly_sdk/models/new_api_key.py index 76000ed8..90819273 100644 --- a/rootly_sdk/models/new_api_key.py +++ b/rootly_sdk/models/new_api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewApiKey: data (NewApiKeyData): """ - data: NewApiKeyData + data: "NewApiKeyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_api_key_data.py b/rootly_sdk/models/new_api_key_data.py index f8653689..dd7533a0 100644 --- a/rootly_sdk/models/new_api_key_data.py +++ b/rootly_sdk/models/new_api_key_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewApiKeyData: """ type_: NewApiKeyDataType - attributes: NewApiKeyDataAttributes + attributes: "NewApiKeyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_api_key_data_attributes.py b/rootly_sdk/models/new_api_key_data_attributes.py index 8c211349..207abe0d 100644 --- a/rootly_sdk/models/new_api_key_data_attributes.py +++ b/rootly_sdk/models/new_api_key_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,19 +21,19 @@ class NewApiKeyDataAttributes: name (str): The name of the API key kind (NewApiKeyDataAttributesKind): The kind of the API key expires_at (datetime.datetime): The expiration date of the API key (ISO 8601) - description (None | str | Unset): A description of the API key - group_id (None | str | Unset): The group (team) ID. Required when kind is 'team'. - role_id (None | str | Unset): The role ID for organization API keys - on_call_role_id (None | str | Unset): The on-call role ID for organization API keys + description (Union[None, Unset, str]): A description of the API key + group_id (Union[None, Unset, str]): The group (team) ID. Required when kind is 'team'. + role_id (Union[None, Unset, str]): The role ID for organization API keys + on_call_role_id (Union[None, Unset, str]): The on-call role ID for organization API keys """ name: str kind: NewApiKeyDataAttributesKind expires_at: datetime.datetime - description: None | str | Unset = UNSET - group_id: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET + description: None | Unset | str = UNSET + group_id: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -44,25 +42,25 @@ def to_dict(self) -> dict[str, Any]: expires_at = self.expires_at.isoformat() - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - group_id: None | str | Unset + group_id: None | Unset | str if isinstance(self.group_id, Unset): group_id = UNSET else: group_id = self.group_id - role_id: None | str | Unset + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -97,39 +95,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expires_at = isoparse(d.pop("expires_at")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_group_id(data: object) -> None | str | Unset: + def _parse_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) group_id = _parse_group_id(d.pop("group_id", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/new_authorization.py b/rootly_sdk/models/new_authorization.py index 2e9cf0c3..8aa7035b 100644 --- a/rootly_sdk/models/new_authorization.py +++ b/rootly_sdk/models/new_authorization.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAuthorization: data (NewAuthorizationData): """ - data: NewAuthorizationData + data: "NewAuthorizationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_authorization_data.py b/rootly_sdk/models/new_authorization_data.py index 31b084d8..b92c08f5 100644 --- a/rootly_sdk/models/new_authorization_data.py +++ b/rootly_sdk/models/new_authorization_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAuthorizationData: """ type_: NewAuthorizationDataType - attributes: NewAuthorizationDataAttributes + attributes: "NewAuthorizationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_authorization_data_attributes.py b/rootly_sdk/models/new_authorization_data_attributes.py index b0ef4f6f..937caafc 100644 --- a/rootly_sdk/models/new_authorization_data_attributes.py +++ b/rootly_sdk/models/new_authorization_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog.py b/rootly_sdk/models/new_catalog.py index 237fa872..48c41be3 100644 --- a/rootly_sdk/models/new_catalog.py +++ b/rootly_sdk/models/new_catalog.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCatalog: data (NewCatalogData): """ - data: NewCatalogData + data: "NewCatalogData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_checklist_template.py b/rootly_sdk/models/new_catalog_checklist_template.py index 76099d53..a2365553 100644 --- a/rootly_sdk/models/new_catalog_checklist_template.py +++ b/rootly_sdk/models/new_catalog_checklist_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCatalogChecklistTemplate: data (NewCatalogChecklistTemplateData): """ - data: NewCatalogChecklistTemplateData + data: "NewCatalogChecklistTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_checklist_template_data.py b/rootly_sdk/models/new_catalog_checklist_template_data.py index 46881d35..9bc4435b 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCatalogChecklistTemplateData: """ type_: NewCatalogChecklistTemplateDataType - attributes: NewCatalogChecklistTemplateDataAttributes + attributes: "NewCatalogChecklistTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py index 1d8669c8..3720364b 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -37,27 +35,33 @@ class NewCatalogChecklistTemplateDataAttributes: name (str): The name of the checklist template catalog_type (NewCatalogChecklistTemplateDataAttributesCatalogType): The catalog type scope_type (NewCatalogChecklistTemplateDataAttributesScopeType): The scope type - description (None | str | Unset): The description of the checklist template - scope_id (str | Unset): The scope ID (team or catalog UUID) - fields (list[NewCatalogChecklistTemplateDataAttributesBuiltinField | - NewCatalogChecklistTemplateDataAttributesCustomField] | None | Unset): Template fields. Position is determined - by array order. - owners (list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset): Template owners + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the checklist template + scope_id (Union[Unset, str]): The scope ID (team or catalog UUID) + fields (Union[None, Unset, list[Union['NewCatalogChecklistTemplateDataAttributesBuiltinField', + 'NewCatalogChecklistTemplateDataAttributesCustomField']]]): Template fields. Position is determined by array + order. + owners (Union[None, Unset, list['NewCatalogChecklistTemplateDataAttributesOwnersType0Item']]): Template owners """ name: str catalog_type: NewCatalogChecklistTemplateDataAttributesCatalogType scope_type: NewCatalogChecklistTemplateDataAttributesScopeType - description: None | str | Unset = UNSET - scope_id: str | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + scope_id: Unset | str = UNSET fields: ( - list[ - NewCatalogChecklistTemplateDataAttributesBuiltinField | NewCatalogChecklistTemplateDataAttributesCustomField - ] - | None + None | Unset + | list[ + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] + ] ) = UNSET - owners: list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset = UNSET + owners: None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_catalog_checklist_template_data_attributes_builtin_field import ( @@ -70,7 +74,13 @@ def to_dict(self) -> dict[str, Any]: scope_type: str = self.scope_type - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -78,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: scope_id = self.scope_id - fields: list[dict[str, Any]] | None | Unset + fields: None | Unset | list[dict[str, Any]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -95,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: list[dict[str, Any]] | None | Unset + owners: None | Unset | list[dict[str, Any]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -116,6 +126,8 @@ def to_dict(self) -> dict[str, Any]: "scope_type": scope_type, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if scope_id is not UNSET: @@ -146,12 +158,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: scope_type = check_new_catalog_checklist_template_data_attributes_scope_type(d.pop("scope_type")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -160,12 +181,14 @@ def _parse_description(data: object) -> None | str | Unset: def _parse_fields( data: object, ) -> ( - list[ - NewCatalogChecklistTemplateDataAttributesBuiltinField - | NewCatalogChecklistTemplateDataAttributesCustomField - ] - | None + None | Unset + | list[ + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] + ] ): if data is None: return data @@ -180,10 +203,10 @@ def _parse_fields( def _parse_fields_type_0_item( data: object, - ) -> ( - NewCatalogChecklistTemplateDataAttributesBuiltinField - | NewCatalogChecklistTemplateDataAttributesCustomField - ): + ) -> Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -192,7 +215,7 @@ def _parse_fields_type_0_item( ) return fields_type_0_item_builtin_field - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -207,15 +230,17 @@ def _parse_fields_type_0_item( fields_type_0.append(fields_type_0_item) return fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[ - NewCatalogChecklistTemplateDataAttributesBuiltinField - | NewCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset, + None + | Unset + | list[ + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] + ], data, ) @@ -223,7 +248,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset: + ) -> None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -241,9 +266,9 @@ def _parse_owners( owners_type_0.append(owners_type_0_item) return owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset, data) + return cast(None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"], data) owners = _parse_owners(d.pop("owners", UNSET)) @@ -251,6 +276,7 @@ def _parse_owners( name=name, catalog_type=catalog_type, scope_type=scope_type, + slug=slug, description=description, scope_id=scope_id, fields=fields, diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py index 59cbd408..53735573 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py index 4c8ca431..df6f9e42 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class NewCatalogChecklistTemplateDataAttributesCustomField: Attributes: field_source (NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource): catalog_property_id (str): ID of the catalog property - field_key (str | Unset): Ignored for custom fields (auto-derived from catalog property) + field_key (Union[Unset, str]): Ignored for custom fields (auto-derived from catalog property) """ field_source: NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: str | Unset = UNSET + field_key: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py index 36a28929..834411cf 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_data.py b/rootly_sdk/models/new_catalog_data.py index cdb82389..47f0b5c0 100644 --- a/rootly_sdk/models/new_catalog_data.py +++ b/rootly_sdk/models/new_catalog_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogData: """ type_: NewCatalogDataType - attributes: NewCatalogDataAttributes + attributes: "NewCatalogDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_data_attributes.py b/rootly_sdk/models/new_catalog_data_attributes.py index ec3d19f4..cbfab9ba 100644 --- a/rootly_sdk/models/new_catalog_data_attributes.py +++ b/rootly_sdk/models/new_catalog_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,38 +17,47 @@ class NewCatalogDataAttributes: """ Attributes: name (str): - description (None | str | Unset): - icon (NewCatalogDataAttributesIcon | Unset): - position (int | None | Unset): Default position of the catalog when displayed in a list. - external_id (None | str | Unset): An external identifier for this catalog. Must be unique within the team. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + icon (Union[Unset, NewCatalogDataAttributesIcon]): + position (Union[None, Unset, int]): Default position of the catalog when displayed in a list. + external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. """ name: str - description: None | str | Unset = UNSET - icon: NewCatalogDataAttributesIcon | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | NewCatalogDataAttributesIcon = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: str | Unset = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -63,6 +70,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if icon is not UNSET: @@ -79,42 +88,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: NewCatalogDataAttributesIcon | Unset + icon: Unset | NewCatalogDataAttributesIcon if isinstance(_icon, Unset): icon = UNSET else: icon = check_new_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) new_catalog_data_attributes = cls( name=name, + slug=slug, description=description, icon=icon, position=position, diff --git a/rootly_sdk/models/new_catalog_entity.py b/rootly_sdk/models/new_catalog_entity.py index e69bd8cd..54f5b515 100644 --- a/rootly_sdk/models/new_catalog_entity.py +++ b/rootly_sdk/models/new_catalog_entity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCatalogEntity: data (NewCatalogEntityData): """ - data: NewCatalogEntityData + data: "NewCatalogEntityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_entity_data.py b/rootly_sdk/models/new_catalog_entity_data.py index 86bda241..1b84bedf 100644 --- a/rootly_sdk/models/new_catalog_entity_data.py +++ b/rootly_sdk/models/new_catalog_entity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogEntityData: """ type_: NewCatalogEntityDataType - attributes: NewCatalogEntityDataAttributes + attributes: "NewCatalogEntityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_entity_data_attributes.py b/rootly_sdk/models/new_catalog_entity_data_attributes.py index 1afb06cc..ae5463dc 100644 --- a/rootly_sdk/models/new_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -19,51 +17,67 @@ class NewCatalogEntityDataAttributes: """ Attributes: name (str): - description (None | str | Unset): - position (int | None | Unset): Default position of the item when displayed in a list. - backstage_id (None | str | Unset): The Backstage entity ID this catalog entity is linked to. - external_id (None | str | Unset): An external identifier for this catalog entity. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): The status page description of the catalog entity + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + backstage_id (Union[None, Unset, str]): The Backstage entity ID this catalog entity is linked to. + external_id (Union[None, Unset, str]): An external identifier for this catalog entity. Must be unique within the catalog. - properties (list[NewCatalogEntityDataAttributesPropertiesItem] | Unset): Array of property values for this - catalog entity + properties (Union[Unset, list['NewCatalogEntityDataAttributesPropertiesItem']]): Array of property values for + this catalog entity """ name: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - properties: list[NewCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + properties: Unset | list["NewCatalogEntityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -77,8 +91,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if backstage_id is not UNSET: @@ -99,54 +117,72 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_catalog_entity_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, position=position, backstage_id=backstage_id, external_id=external_id, diff --git a/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py b/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py index f5636592..16aab728 100644 --- a/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_entity_property.py b/rootly_sdk/models/new_catalog_entity_property.py index 3f7f8636..8e004ed0 100644 --- a/rootly_sdk/models/new_catalog_entity_property.py +++ b/rootly_sdk/models/new_catalog_entity_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class NewCatalogEntityProperty: data (NewCatalogEntityPropertyData): """ - data: NewCatalogEntityPropertyData + data: "NewCatalogEntityPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_entity_property_data.py b/rootly_sdk/models/new_catalog_entity_property_data.py index 81053936..a0ad259e 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data.py +++ b/rootly_sdk/models/new_catalog_entity_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCatalogEntityPropertyData: """ type_: NewCatalogEntityPropertyDataType - attributes: NewCatalogEntityPropertyDataAttributes + attributes: "NewCatalogEntityPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py index b1521147..c3ae6eaa 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -22,13 +20,13 @@ class NewCatalogEntityPropertyDataAttributes: catalog_field_id (str): key (NewCatalogEntityPropertyDataAttributesKey): value (str): - catalog_entity_id (str | Unset): + catalog_entity_id (Union[Unset, str]): """ catalog_field_id: str key: NewCatalogEntityPropertyDataAttributesKey value: str - catalog_entity_id: str | Unset = UNSET + catalog_entity_id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: catalog_field_id = self.catalog_field_id diff --git a/rootly_sdk/models/new_catalog_field.py b/rootly_sdk/models/new_catalog_field.py index e036da74..ab48fe98 100644 --- a/rootly_sdk/models/new_catalog_field.py +++ b/rootly_sdk/models/new_catalog_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,11 +19,10 @@ class NewCatalogField: data (NewCatalogFieldData): """ - data: NewCatalogFieldData + data: "NewCatalogFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_field_data.py b/rootly_sdk/models/new_catalog_field_data.py index 221de699..2ae4472c 100644 --- a/rootly_sdk/models/new_catalog_field_data.py +++ b/rootly_sdk/models/new_catalog_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogFieldData: """ type_: NewCatalogFieldDataType - attributes: NewCatalogFieldDataAttributes + attributes: "NewCatalogFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_field_data_attributes.py b/rootly_sdk/models/new_catalog_field_data_attributes.py index 2de16529..60698e04 100644 --- a/rootly_sdk/models/new_catalog_field_data_attributes.py +++ b/rootly_sdk/models/new_catalog_field_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,30 +22,39 @@ class NewCatalogFieldDataAttributes: Attributes: name (str): kind (NewCatalogFieldDataAttributesKind): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - multiple (bool | Unset): Whether the attribute accepts multiple values. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the field is required. - catalog_type (NewCatalogFieldDataAttributesCatalogType | Unset): The type of catalog the field belongs to. - external_id (None | str | Unset): An external identifier for this catalog field. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + multiple (Union[Unset, bool]): Whether the attribute accepts multiple values. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the field is required. + catalog_type (Union[Unset, NewCatalogFieldDataAttributesCatalogType]): The type of catalog the field belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog field. Must be unique within the scope. """ name: str kind: NewCatalogFieldDataAttributesKind - kind_catalog_id: None | str | Unset = UNSET - multiple: bool | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: NewCatalogFieldDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + multiple: Unset | bool = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | NewCatalogFieldDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - kind_catalog_id: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -55,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -63,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -81,6 +88,8 @@ def to_dict(self) -> dict[str, Any]: "kind": kind, } ) + if slug is not UNSET: + field_dict["slug"] = slug if kind_catalog_id is not UNSET: field_dict["kind_catalog_id"] = kind_catalog_id if multiple is not UNSET: @@ -103,47 +112,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_catalog_field_data_attributes_kind(d.pop("kind")) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: NewCatalogFieldDataAttributesCatalogType | Unset + catalog_type: Unset | NewCatalogFieldDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_new_catalog_field_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) new_catalog_field_data_attributes = cls( name=name, kind=kind, + slug=slug, kind_catalog_id=kind_catalog_id, multiple=multiple, position=position, diff --git a/rootly_sdk/models/new_catalog_property.py b/rootly_sdk/models/new_catalog_property.py index 2afbc8a2..10681fc0 100644 --- a/rootly_sdk/models/new_catalog_property.py +++ b/rootly_sdk/models/new_catalog_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,11 +19,10 @@ class NewCatalogProperty: data (NewCatalogPropertyData): """ - data: NewCatalogPropertyData + data: "NewCatalogPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_property_data.py b/rootly_sdk/models/new_catalog_property_data.py index 8e4df1f6..b578a161 100644 --- a/rootly_sdk/models/new_catalog_property_data.py +++ b/rootly_sdk/models/new_catalog_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogPropertyData: """ type_: NewCatalogPropertyDataType - attributes: NewCatalogPropertyDataAttributes + attributes: "NewCatalogPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_property_data_attributes.py b/rootly_sdk/models/new_catalog_property_data_attributes.py index 3a4d155c..0f8c785a 100644 --- a/rootly_sdk/models/new_catalog_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_property_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,30 +22,40 @@ class NewCatalogPropertyDataAttributes: Attributes: name (str): kind (NewCatalogPropertyDataAttributesKind): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - multiple (bool | Unset): Whether the attribute accepts multiple values. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the property is required. - catalog_type (NewCatalogPropertyDataAttributesCatalogType | Unset): The type of catalog the property belongs to. - external_id (None | str | Unset): An external identifier for this catalog property. Must be unique within the - scope. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + multiple (Union[Unset, bool]): Whether the attribute accepts multiple values. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the property is required. + catalog_type (Union[Unset, NewCatalogPropertyDataAttributesCatalogType]): The type of catalog the property + belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog property. Must be unique within + the scope. """ name: str kind: NewCatalogPropertyDataAttributesKind - kind_catalog_id: None | str | Unset = UNSET - multiple: bool | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: NewCatalogPropertyDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + multiple: Unset | bool = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | NewCatalogPropertyDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - kind_catalog_id: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -55,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -63,11 +71,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -81,6 +89,8 @@ def to_dict(self) -> dict[str, Any]: "kind": kind, } ) + if slug is not UNSET: + field_dict["slug"] = slug if kind_catalog_id is not UNSET: field_dict["kind_catalog_id"] = kind_catalog_id if multiple is not UNSET: @@ -103,47 +113,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_catalog_property_data_attributes_kind(d.pop("kind")) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: NewCatalogPropertyDataAttributesCatalogType | Unset + catalog_type: Unset | NewCatalogPropertyDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_new_catalog_property_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) new_catalog_property_data_attributes = cls( name=name, kind=kind, + slug=slug, kind_catalog_id=kind_catalog_id, multiple=multiple, position=position, diff --git a/rootly_sdk/models/new_cause.py b/rootly_sdk/models/new_cause.py index d00de96f..ba1af3e7 100644 --- a/rootly_sdk/models/new_cause.py +++ b/rootly_sdk/models/new_cause.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCause: data (NewCauseData): """ - data: NewCauseData + data: "NewCauseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_cause_data.py b/rootly_sdk/models/new_cause_data.py index bbe9ae91..2a5015be 100644 --- a/rootly_sdk/models/new_cause_data.py +++ b/rootly_sdk/models/new_cause_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCauseData: """ type_: NewCauseDataType - attributes: NewCauseDataAttributes + attributes: "NewCauseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_cause_data_attributes.py b/rootly_sdk/models/new_cause_data_attributes.py index 449fdadd..c44dfc09 100644 --- a/rootly_sdk/models/new_cause_data_attributes.py +++ b/rootly_sdk/models/new_cause_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -19,33 +17,50 @@ class NewCauseDataAttributes: """ Attributes: name (str): The name of the cause - description (None | str | Unset): The description of the cause - position (int | None | Unset): Position of the cause - properties (list[NewCauseDataAttributesPropertiesItem] | Unset): Array of property values for this cause. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the cause + public_description (Union[None, Unset, str]): The status page description of the cause + position (Union[None, Unset, int]): Position of the cause + properties (Union[Unset, list['NewCauseDataAttributesPropertiesItem']]): Array of property values for this + cause. """ name: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - properties: list[NewCauseDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + properties: Unset | list["NewCauseDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -59,8 +74,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if properties is not UNSET: @@ -75,36 +94,54 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewCauseDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewCauseDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewCauseDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_cause_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, position=position, properties=properties, ) diff --git a/rootly_sdk/models/new_cause_data_attributes_properties_item.py b/rootly_sdk/models/new_cause_data_attributes_properties_item.py index da071245..bf8741fb 100644 --- a/rootly_sdk/models/new_cause_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_cause_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_communications_group.py b/rootly_sdk/models/new_communications_group.py index 5f9e95a9..c59f5362 100644 --- a/rootly_sdk/models/new_communications_group.py +++ b/rootly_sdk/models/new_communications_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsGroup: data (NewCommunicationsGroupData): """ - data: NewCommunicationsGroupData + data: "NewCommunicationsGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_group_data.py b/rootly_sdk/models/new_communications_group_data.py index fb3b0193..ef36edb1 100644 --- a/rootly_sdk/models/new_communications_group_data.py +++ b/rootly_sdk/models/new_communications_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsGroupData: """ type_: NewCommunicationsGroupDataType - attributes: NewCommunicationsGroupDataAttributes + attributes: "NewCommunicationsGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_group_data_attributes.py b/rootly_sdk/models/new_communications_group_data_attributes.py index e156f4be..8f9e4197 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes.py +++ b/rootly_sdk/models/new_communications_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -29,71 +27,70 @@ class NewCommunicationsGroupDataAttributes: Attributes: name (str): The name of the communications group communication_type_id (str): The communication type ID - description (None | str | Unset): The description of the communications group - is_private (bool | None | Unset): Whether the group is private - condition_type (NewCommunicationsGroupDataAttributesConditionType | Unset): Condition type - sms_channel (bool | None | Unset): SMS channel enabled - email_channel (bool | None | Unset): Email channel enabled - member_ids (list[int] | None | Unset): Array of member user IDs - slack_channel_ids (list[str] | None | Unset): Array of Slack channel IDs - communication_group_conditions (list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] - | None | Unset): Group conditions attributes - communication_external_group_members - (list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset): External - group members attributes + description (Union[None, Unset, str]): The description of the communications group + is_private (Union[None, Unset, bool]): Whether the group is private + condition_type (Union[Unset, NewCommunicationsGroupDataAttributesConditionType]): Condition type + sms_channel (Union[None, Unset, bool]): SMS channel enabled + email_channel (Union[None, Unset, bool]): Email channel enabled + member_ids (Union[None, Unset, list[int]]): Array of member user IDs + slack_channel_ids (Union[None, Unset, list[str]]): Array of Slack channel IDs + communication_group_conditions (Union[None, Unset, + list['NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item']]): Group conditions attributes + communication_external_group_members (Union[None, Unset, + list['NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item']]): External group members + attributes """ name: str communication_type_id: str - description: None | str | Unset = UNSET - is_private: bool | None | Unset = UNSET - condition_type: NewCommunicationsGroupDataAttributesConditionType | Unset = UNSET - sms_channel: bool | None | Unset = UNSET - email_channel: bool | None | Unset = UNSET - member_ids: list[int] | None | Unset = UNSET - slack_channel_ids: list[str] | None | Unset = UNSET + description: None | Unset | str = UNSET + is_private: None | Unset | bool = UNSET + condition_type: Unset | NewCommunicationsGroupDataAttributesConditionType = UNSET + sms_channel: None | Unset | bool = UNSET + email_channel: None | Unset | bool = UNSET + member_ids: None | Unset | list[int] = UNSET + slack_channel_ids: None | Unset | list[str] = UNSET communication_group_conditions: ( - list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] ) = UNSET communication_external_group_members: ( - list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] ) = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name communication_type_id = self.communication_type_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_private: bool | None | Unset + is_private: None | Unset | bool if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: bool | None | Unset + sms_channel: None | Unset | bool if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: bool | None | Unset + email_channel: None | Unset | bool if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: list[int] | None | Unset + member_ids: None | Unset | list[int] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -102,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: list[str] | None | Unset + slack_channel_ids: None | Unset | list[str] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -111,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: list[dict[str, Any]] | None | Unset + communication_group_conditions: None | Unset | list[dict[str, Any]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -123,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: list[dict[str, Any]] | None | Unset + communication_external_group_members: None | Unset | list[dict[str, Any]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -180,50 +177,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: communication_type_id = d.pop("communication_type_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_private(data: object) -> bool | None | Unset: + def _parse_is_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewCommunicationsGroupDataAttributesConditionType | Unset + condition_type: Unset | NewCommunicationsGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_communications_group_data_attributes_condition_type(_condition_type) - def _parse_sms_channel(data: object) -> bool | None | Unset: + def _parse_sms_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> bool | None | Unset: + def _parse_email_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> list[int] | None | Unset: + def _parse_member_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -234,13 +231,13 @@ def _parse_member_ids(data: object) -> list[int] | None | Unset: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: + def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -251,15 +248,15 @@ def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset: + ) -> None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -279,10 +276,11 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset, data + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"], + data, ) communication_group_conditions = _parse_communication_group_conditions( @@ -291,7 +289,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset: + ) -> None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -313,10 +311,10 @@ def _parse_communication_external_group_members( communication_external_group_members_type_0.append(communication_external_group_members_type_0_item) return communication_external_group_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset, + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], data, ) diff --git a/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py index 4cb512ee..ef8f8260 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +13,14 @@ class NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item: """ Attributes: - name (str | Unset): Name of the external member - email (str | Unset): Email of the external member - phone_number (str | Unset): Phone number of the external member + name (Union[Unset, str]): Name of the external member + email (Union[Unset, str]): Email of the external member + phone_number (Union[Unset, str]): Phone number of the external member """ - name: str | Unset = UNSET - email: str | Unset = UNSET - phone_number: str | Unset = UNSET + name: Unset | str = UNSET + email: Unset | str = UNSET + phone_number: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py index 06d190a0..e5b2ed63 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,29 +17,29 @@ class NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: """ Attributes: - property_type (NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset): - Property type - service_ids (list[str] | None | Unset): Array of service IDs - severity_ids (list[str] | None | Unset): Array of severity IDs - functionality_ids (list[str] | None | Unset): Array of functionality IDs - group_ids (list[str] | None | Unset): Array of group IDs - incident_type_ids (list[str] | None | Unset): Array of incident type IDs + property_type (Union[Unset, + NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType]): Property type + service_ids (Union[None, Unset, list[str]]): Array of service IDs + severity_ids (Union[None, Unset, list[str]]): Array of severity IDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality IDs + group_ids (Union[None, Unset, list[str]]): Array of group IDs + incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - property_type: NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + property_type: Unset | NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = UNSET + service_ids: None | Unset | list[str] = UNSET + severity_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: str | Unset = UNSET + property_type: Unset | str = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -50,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -77,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -108,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _property_type = d.pop("property_type", UNSET) - property_type: NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset + property_type: Unset | NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType if isinstance(_property_type, Unset): property_type = UNSET else: @@ -118,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -129,13 +127,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -146,13 +144,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -163,13 +161,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -180,13 +178,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -197,9 +195,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/new_communications_stage.py b/rootly_sdk/models/new_communications_stage.py index d57d331d..255f3d6e 100644 --- a/rootly_sdk/models/new_communications_stage.py +++ b/rootly_sdk/models/new_communications_stage.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsStage: data (NewCommunicationsStageData): """ - data: NewCommunicationsStageData + data: "NewCommunicationsStageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_stage_data.py b/rootly_sdk/models/new_communications_stage_data.py index 9f3d231c..7b63efc0 100644 --- a/rootly_sdk/models/new_communications_stage_data.py +++ b/rootly_sdk/models/new_communications_stage_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsStageData: """ type_: NewCommunicationsStageDataType - attributes: NewCommunicationsStageDataAttributes + attributes: "NewCommunicationsStageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_stage_data_attributes.py b/rootly_sdk/models/new_communications_stage_data_attributes.py index 625f18e7..602a9fe6 100644 --- a/rootly_sdk/models/new_communications_stage_data_attributes.py +++ b/rootly_sdk/models/new_communications_stage_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,24 +13,33 @@ class NewCommunicationsStageDataAttributes: """ Attributes: name (str): The name of the communications stage - description (None | str | Unset): The description of the communications stage - position (int | None | Unset): Position of the communications stage + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the communications stage + position (Union[None, Unset, int]): Position of the communications stage """ name: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -45,6 +52,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -57,26 +66,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) new_communications_stage_data_attributes = cls( name=name, + slug=slug, description=description, position=position, ) diff --git a/rootly_sdk/models/new_communications_template.py b/rootly_sdk/models/new_communications_template.py index 006dea09..9736c747 100644 --- a/rootly_sdk/models/new_communications_template.py +++ b/rootly_sdk/models/new_communications_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsTemplate: data (NewCommunicationsTemplateData): """ - data: NewCommunicationsTemplateData + data: "NewCommunicationsTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_template_data.py b/rootly_sdk/models/new_communications_template_data.py index 086a413b..d82c8d18 100644 --- a/rootly_sdk/models/new_communications_template_data.py +++ b/rootly_sdk/models/new_communications_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsTemplateData: """ type_: NewCommunicationsTemplateDataType - attributes: NewCommunicationsTemplateDataAttributes + attributes: "NewCommunicationsTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_template_data_attributes.py b/rootly_sdk/models/new_communications_template_data_attributes.py index e555a355..e25d102a 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes.py +++ b/rootly_sdk/models/new_communications_template_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,40 +20,39 @@ class NewCommunicationsTemplateDataAttributes: Attributes: name (str): The name of the communications template communication_type_id (str): The communication type ID - description (None | str | Unset): The description of the communications template - position (int | None | Unset): Position of the communications template - communication_template_stages_attributes - (list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset): - Template stages attributes + description (Union[None, Unset, str]): The description of the communications template + position (Union[None, Unset, int]): Position of the communications template + communication_template_stages_attributes (Union[None, Unset, + list['NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item']]): Template stages + attributes """ name: str communication_type_id: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET communication_template_stages_attributes: ( - list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset + None | Unset | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] ) = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name communication_type_id = self.communication_type_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: list[dict[str, Any]] | None | Unset + communication_template_stages_attributes: None | Unset | list[dict[str, Any]] if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -99,27 +96,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: communication_type_id = d.pop("communication_type_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, - ) -> list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset: + ) -> ( + None | Unset | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ): if data is None: return data if isinstance(data, Unset): @@ -143,12 +142,12 @@ def _parse_communication_template_stages_attributes( ) return communication_template_stages_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] - | None - | Unset, + None + | Unset + | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], data, ) diff --git a/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py b/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py index 07f47a09..1a52b6f1 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py +++ b/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,42 +13,42 @@ class NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item: """ Attributes: - communication_stage_id (str | Unset): The communication stage ID - sms_content (None | str | Unset): SMS content for the stage - email_subject (None | str | Unset): Email subject for the stage - email_body (None | str | Unset): Email body for the stage - slack_content (None | str | Unset): Slack content for the stage + communication_stage_id (Union[Unset, str]): The communication stage ID + sms_content (Union[None, Unset, str]): SMS content for the stage + email_subject (Union[None, Unset, str]): Email subject for the stage + email_body (Union[None, Unset, str]): Email body for the stage + slack_content (Union[None, Unset, str]): Slack content for the stage """ - communication_stage_id: str | Unset = UNSET - sms_content: None | str | Unset = UNSET - email_subject: None | str | Unset = UNSET - email_body: None | str | Unset = UNSET - slack_content: None | str | Unset = UNSET + communication_stage_id: Unset | str = UNSET + sms_content: None | Unset | str = UNSET + email_subject: None | Unset | str = UNSET + email_body: None | Unset | str = UNSET + slack_content: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: communication_stage_id = self.communication_stage_id - sms_content: None | str | Unset + sms_content: None | Unset | str if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: None | str | Unset + email_subject: None | Unset | str if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: None | str | Unset + email_body: None | Unset | str if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: None | str | Unset + slack_content: None | Unset | str if isinstance(self.slack_content, Unset): slack_content = UNSET else: @@ -77,39 +75,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) communication_stage_id = d.pop("communication_stage_id", UNSET) - def _parse_sms_content(data: object) -> None | str | Unset: + def _parse_sms_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> None | str | Unset: + def _parse_email_subject(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> None | str | Unset: + def _parse_email_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> None | str | Unset: + def _parse_slack_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) diff --git a/rootly_sdk/models/new_communications_type.py b/rootly_sdk/models/new_communications_type.py index 473d00ca..13a637a3 100644 --- a/rootly_sdk/models/new_communications_type.py +++ b/rootly_sdk/models/new_communications_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsType: data (NewCommunicationsTypeData): """ - data: NewCommunicationsTypeData + data: "NewCommunicationsTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_type_data.py b/rootly_sdk/models/new_communications_type_data.py index 709dcbfd..b3f273d1 100644 --- a/rootly_sdk/models/new_communications_type_data.py +++ b/rootly_sdk/models/new_communications_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsTypeData: """ type_: NewCommunicationsTypeDataType - attributes: NewCommunicationsTypeDataAttributes + attributes: "NewCommunicationsTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_type_data_attributes.py b/rootly_sdk/models/new_communications_type_data_attributes.py index 3d65eda4..d988abff 100644 --- a/rootly_sdk/models/new_communications_type_data_attributes.py +++ b/rootly_sdk/models/new_communications_type_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,15 +13,18 @@ class NewCommunicationsTypeDataAttributes: """ Attributes: name (str): The name of the communications type - color (None | str): The color of the communications type - description (None | str | Unset): The description of the communications type - position (int | None | Unset): Position of the communications type + color (Union[None, str]): The color of the communications type + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the communications type + position (Union[None, Unset, int]): Position of the communications type """ name: str color: None | str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -31,13 +32,19 @@ def to_dict(self) -> dict[str, Any]: color: None | str color = self.color - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -51,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: "color": color, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -70,27 +79,37 @@ def _parse_color(data: object) -> None | str: color = _parse_color(d.pop("color")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) new_communications_type_data_attributes = cls( name=name, color=color, + slug=slug, description=description, position=position, ) diff --git a/rootly_sdk/models/new_custom_field.py b/rootly_sdk/models/new_custom_field.py index eedfff24..4e234541 100644 --- a/rootly_sdk/models/new_custom_field.py +++ b/rootly_sdk/models/new_custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCustomField: data (NewCustomFieldData): """ - data: NewCustomFieldData + data: "NewCustomFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_custom_field_data.py b/rootly_sdk/models/new_custom_field_data.py index 16d37a7b..4d28f75f 100644 --- a/rootly_sdk/models/new_custom_field_data.py +++ b/rootly_sdk/models/new_custom_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCustomFieldData: """ type_: NewCustomFieldDataType - attributes: NewCustomFieldDataAttributes + attributes: "NewCustomFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_custom_field_data_attributes.py b/rootly_sdk/models/new_custom_field_data_attributes.py index f91d2f06..93a5e0aa 100644 --- a/rootly_sdk/models/new_custom_field_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,37 +21,37 @@ class NewCustomFieldDataAttributes: """ Attributes: label (str): The name of the custom_field - description (None | str | Unset): The description of the custom_field - shown (list[NewCustomFieldDataAttributesShownItem] | Unset): - required (list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset): - default (None | str | Unset): The default value for text field kinds - position (int | Unset): The position of the custom_field + description (Union[None, Unset, str]): The description of the custom_field + shown (Union[Unset, list[NewCustomFieldDataAttributesShownItem]]): + required (Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]]): + default (Union[None, Unset, str]): The default value for text field kinds + position (Union[Unset, int]): The position of the custom_field """ label: str - description: None | str | Unset = UNSET - shown: list[NewCustomFieldDataAttributesShownItem] | Unset = UNSET - required: list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset = UNSET - default: None | str | Unset = UNSET - position: int | Unset = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[NewCustomFieldDataAttributesShownItem] = UNSET + required: None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item] = UNSET + default: None | Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: label = self.label - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = [] for shown_item_data in self.shown: shown_item: str = shown_item_data shown.append(shown_item) - required: list[str] | None | Unset + required: None | Unset | list[str] if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -65,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: None | str | Unset + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: @@ -98,25 +96,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) label = d.pop("label") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + shown = [] _shown = d.pop("shown", UNSET) - shown: list[NewCustomFieldDataAttributesShownItem] | Unset = UNSET - if _shown is not UNSET: - shown = [] - for shown_item_data in _shown: - shown_item = check_new_custom_field_data_attributes_shown_item(shown_item_data) + for shown_item_data in _shown or []: + shown_item = check_new_custom_field_data_attributes_shown_item(shown_item_data) - shown.append(shown_item) + shown.append(shown_item) - def _parse_required(data: object) -> list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset: + def _parse_required(data: object) -> None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item]: if data is None: return data if isinstance(data, Unset): @@ -134,18 +130,18 @@ def _parse_required(data: object) -> list[NewCustomFieldDataAttributesRequiredTy required_type_0.append(required_type_0_item) return required_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset, data) + return cast(None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item], data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/new_custom_field_option.py b/rootly_sdk/models/new_custom_field_option.py index 430c0138..21bc5210 100644 --- a/rootly_sdk/models/new_custom_field_option.py +++ b/rootly_sdk/models/new_custom_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCustomFieldOption: data (NewCustomFieldOptionData): """ - data: NewCustomFieldOptionData + data: "NewCustomFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_custom_field_option_data.py b/rootly_sdk/models/new_custom_field_option_data.py index 559f0951..44112638 100644 --- a/rootly_sdk/models/new_custom_field_option_data.py +++ b/rootly_sdk/models/new_custom_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCustomFieldOptionData: """ type_: NewCustomFieldOptionDataType - attributes: NewCustomFieldOptionDataAttributes + attributes: "NewCustomFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_custom_field_option_data_attributes.py b/rootly_sdk/models/new_custom_field_option_data_attributes.py index 327dadf0..6316c183 100644 --- a/rootly_sdk/models/new_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_option_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,15 +13,15 @@ class NewCustomFieldOptionDataAttributes: """ Attributes: value (str): The value of the custom_field_option - color (str | Unset): The hex color of the custom_field_option - default (bool | Unset): - position (int | Unset): The position of the custom_field_option + color (Union[Unset, str]): The hex color of the custom_field_option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the custom_field_option """ value: str - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/new_custom_form.py b/rootly_sdk/models/new_custom_form.py index c3bb94a5..b4884ddc 100644 --- a/rootly_sdk/models/new_custom_form.py +++ b/rootly_sdk/models/new_custom_form.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCustomForm: data (NewCustomFormData): """ - data: NewCustomFormData + data: "NewCustomFormData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_custom_form_data.py b/rootly_sdk/models/new_custom_form_data.py index 10b2b5b9..e4300fab 100644 --- a/rootly_sdk/models/new_custom_form_data.py +++ b/rootly_sdk/models/new_custom_form_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCustomFormData: """ type_: NewCustomFormDataType - attributes: NewCustomFormDataAttributes + attributes: "NewCustomFormDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_custom_form_data_attributes.py b/rootly_sdk/models/new_custom_form_data_attributes.py index 747cac35..dc91ded9 100644 --- a/rootly_sdk/models/new_custom_form_data_attributes.py +++ b/rootly_sdk/models/new_custom_form_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,21 +14,30 @@ class NewCustomFormDataAttributes: Attributes: name (str): The name of the custom form. command (str): The Slack command used to trigger this form. - description (None | str | Unset): - enabled (bool | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + enabled (Union[Unset, bool]): """ name: str command: str - description: None | str | Unset = UNSET - enabled: bool | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + enabled: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name command = self.command - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -46,6 +53,8 @@ def to_dict(self) -> dict[str, Any]: "command": command, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if enabled is not UNSET: @@ -60,12 +69,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: command = d.pop("command") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -74,6 +92,7 @@ def _parse_description(data: object) -> None | str | Unset: new_custom_form_data_attributes = cls( name=name, command=command, + slug=slug, description=description, enabled=enabled, ) diff --git a/rootly_sdk/models/new_dashboard.py b/rootly_sdk/models/new_dashboard.py index 6248ee11..83310749 100644 --- a/rootly_sdk/models/new_dashboard.py +++ b/rootly_sdk/models/new_dashboard.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewDashboard: data (NewDashboardData): """ - data: NewDashboardData + data: "NewDashboardData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_dashboard_data.py b/rootly_sdk/models/new_dashboard_data.py index c0551ebc..36644464 100644 --- a/rootly_sdk/models/new_dashboard_data.py +++ b/rootly_sdk/models/new_dashboard_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewDashboardData: """ type_: NewDashboardDataType - attributes: NewDashboardDataAttributes + attributes: "NewDashboardDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_dashboard_data_attributes.py b/rootly_sdk/models/new_dashboard_data_attributes.py index 95617d9a..81e91767 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,31 +26,31 @@ class NewDashboardDataAttributes: Attributes: name (str): The name of the dashboard owner (NewDashboardDataAttributesOwner): The owner type of the dashboard - description (None | str | Unset): The description of the dashboard - public (bool | Unset): Whether the dashboard is public - range_ (None | str | Unset): The date range for dashboard panel data - auto_refresh (bool | Unset): Whether the dashboard auto-updates the UI with new data. - color (NewDashboardDataAttributesColor | Unset): The hex color of the dashboard - icon (str | Unset): The emoji icon of the dashboard - period (NewDashboardDataAttributesPeriod | Unset): The grouping period for dashboard panel data + description (Union[None, Unset, str]): The description of the dashboard + public (Union[Unset, bool]): Whether the dashboard is public + range_ (Union[None, Unset, str]): The date range for dashboard panel data + auto_refresh (Union[Unset, bool]): Whether the dashboard auto-updates the UI with new data. + color (Union[Unset, NewDashboardDataAttributesColor]): The hex color of the dashboard + icon (Union[Unset, str]): The emoji icon of the dashboard + period (Union[Unset, NewDashboardDataAttributesPeriod]): The grouping period for dashboard panel data """ name: str owner: NewDashboardDataAttributesOwner - description: None | str | Unset = UNSET - public: bool | Unset = UNSET - range_: None | str | Unset = UNSET - auto_refresh: bool | Unset = UNSET - color: NewDashboardDataAttributesColor | Unset = UNSET - icon: str | Unset = UNSET - period: NewDashboardDataAttributesPeriod | Unset = UNSET + description: None | Unset | str = UNSET + public: Unset | bool = UNSET + range_: None | Unset | str = UNSET + auto_refresh: Unset | bool = UNSET + color: Unset | NewDashboardDataAttributesColor = UNSET + icon: Unset | str = UNSET + period: Unset | NewDashboardDataAttributesPeriod = UNSET def to_dict(self) -> dict[str, Any]: name = self.name owner: str = self.owner - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -60,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: public = self.public - range_: None | str | Unset + range_: None | Unset | str if isinstance(self.range_, Unset): range_ = UNSET else: @@ -68,13 +66,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: str | Unset = UNSET + color: Unset | str = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: str | Unset = UNSET + period: Unset | str = UNSET if not isinstance(self.period, Unset): period = self.period @@ -110,30 +108,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owner = check_new_dashboard_data_attributes_owner(d.pop("owner")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) public = d.pop("public", UNSET) - def _parse_range_(data: object) -> None | str | Unset: + def _parse_range_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: NewDashboardDataAttributesColor | Unset + color: Unset | NewDashboardDataAttributesColor if isinstance(_color, Unset): color = UNSET else: @@ -142,7 +140,7 @@ def _parse_range_(data: object) -> None | str | Unset: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: NewDashboardDataAttributesPeriod | Unset + period: Unset | NewDashboardDataAttributesPeriod if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel.py b/rootly_sdk/models/new_dashboard_panel.py index 0a030c43..1d97f0c7 100644 --- a/rootly_sdk/models/new_dashboard_panel.py +++ b/rootly_sdk/models/new_dashboard_panel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewDashboardPanel: data (NewDashboardPanelData): """ - data: NewDashboardPanelData + data: "NewDashboardPanelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_dashboard_panel_data.py b/rootly_sdk/models/new_dashboard_panel_data.py index 3cc44773..78a4f6cf 100644 --- a/rootly_sdk/models/new_dashboard_panel_data.py +++ b/rootly_sdk/models/new_dashboard_panel_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewDashboardPanelData: """ type_: NewDashboardPanelDataType - attributes: NewDashboardPanelDataAttributes + attributes: "NewDashboardPanelDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes.py b/rootly_sdk/models/new_dashboard_panel_data_attributes.py index 3571d9eb..26381827 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,13 +20,13 @@ class NewDashboardPanelDataAttributes: """ Attributes: params (NewDashboardPanelDataAttributesParams): - name (None | str | Unset): The name of the dashboard_panel - position (NewDashboardPanelDataAttributesPositionType0 | None | Unset): + name (Union[None, Unset, str]): The name of the dashboard_panel + position (Union['NewDashboardPanelDataAttributesPositionType0', None, Unset]): """ - params: NewDashboardPanelDataAttributesParams - name: None | str | Unset = UNSET - position: NewDashboardPanelDataAttributesPositionType0 | None | Unset = UNSET + params: "NewDashboardPanelDataAttributesParams" + name: None | Unset | str = UNSET + position: Union["NewDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_dashboard_panel_data_attributes_position_type_0 import ( @@ -37,13 +35,13 @@ def to_dict(self) -> dict[str, Any]: params = self.params.to_dict() - name: None | str | Unset + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: dict[str, Any] | None | Unset + position: None | Unset | dict[str, Any] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, NewDashboardPanelDataAttributesPositionType0): @@ -75,16 +73,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) params = NewDashboardPanelDataAttributesParams.from_dict(d.pop("params")) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_position(data: object) -> NewDashboardPanelDataAttributesPositionType0 | None | Unset: + def _parse_position(data: object) -> Union["NewDashboardPanelDataAttributesPositionType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -95,9 +93,9 @@ def _parse_position(data: object) -> NewDashboardPanelDataAttributesPositionType position_type_0 = NewDashboardPanelDataAttributesPositionType0.from_dict(data) return position_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewDashboardPanelDataAttributesPositionType0 | None | Unset, data) + return cast(Union["NewDashboardPanelDataAttributesPositionType0", None, Unset], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py index 299e8dc1..866c7b91 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,43 +27,42 @@ class NewDashboardPanelDataAttributesParams: """ Attributes: - display (NewDashboardPanelDataAttributesParamsDisplay | Unset): - description (str | Unset): - table_fields (list[str] | Unset): - legend (NewDashboardPanelDataAttributesParamsLegend | Unset): - datalabels (NewDashboardPanelDataAttributesParamsDatalabels | Unset): - datasets (list[NewDashboardPanelDataAttributesParamsDatasetsItem] | Unset): + display (Union[Unset, NewDashboardPanelDataAttributesParamsDisplay]): + description (Union[Unset, str]): + table_fields (Union[Unset, list[str]]): + legend (Union[Unset, NewDashboardPanelDataAttributesParamsLegend]): + datalabels (Union[Unset, NewDashboardPanelDataAttributesParamsDatalabels]): + datasets (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItem']]): """ - display: NewDashboardPanelDataAttributesParamsDisplay | Unset = UNSET - description: str | Unset = UNSET - table_fields: list[str] | Unset = UNSET - legend: NewDashboardPanelDataAttributesParamsLegend | Unset = UNSET - datalabels: NewDashboardPanelDataAttributesParamsDatalabels | Unset = UNSET - datasets: list[NewDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET + display: Unset | NewDashboardPanelDataAttributesParamsDisplay = UNSET + description: Unset | str = UNSET + table_fields: Unset | list[str] = UNSET + legend: Union[Unset, "NewDashboardPanelDataAttributesParamsLegend"] = UNSET + datalabels: Union[Unset, "NewDashboardPanelDataAttributesParamsDatalabels"] = UNSET + datasets: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - display: str | Unset = UNSET + display: Unset | str = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: list[str] | Unset = UNSET + table_fields: Unset | list[str] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: dict[str, Any] | Unset = UNSET + legend: Unset | dict[str, Any] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: dict[str, Any] | Unset = UNSET + datalabels: Unset | dict[str, Any] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: list[dict[str, Any]] | Unset = UNSET + datasets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -104,7 +101,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: NewDashboardPanelDataAttributesParamsDisplay | Unset + display: Unset | NewDashboardPanelDataAttributesParamsDisplay if isinstance(_display, Unset): display = UNSET else: @@ -115,27 +112,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: NewDashboardPanelDataAttributesParamsLegend | Unset + legend: Unset | NewDashboardPanelDataAttributesParamsLegend if isinstance(_legend, Unset): legend = UNSET else: legend = NewDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: NewDashboardPanelDataAttributesParamsDatalabels | Unset + datalabels: Unset | NewDashboardPanelDataAttributesParamsDatalabels if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = NewDashboardPanelDataAttributesParamsDatalabels.from_dict(_datalabels) + datasets = [] _datasets = d.pop("datasets", UNSET) - datasets: list[NewDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET - if _datasets is not UNSET: - datasets = [] - for datasets_item_data in _datasets: - datasets_item = NewDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) + for datasets_item_data in _datasets or []: + datasets_item = NewDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) - datasets.append(datasets_item) + datasets.append(datasets_item) new_dashboard_panel_data_attributes_params = cls( display=display, diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py index adb508ca..2293464d 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class NewDashboardPanelDataAttributesParamsDatalabels: """ Attributes: - enabled (bool | Unset): + enabled (Union[Unset, bool]): """ - enabled: bool | Unset = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py index 5e2ae7c9..64e20254 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,18 +29,18 @@ class NewDashboardPanelDataAttributesParamsDatasetsItem: """ Attributes: - name (None | str | Unset): - collection (NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset): - filter_ (list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset): - group_by (NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset): - aggregate (NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset): + name (Union[None, Unset, str]): + collection (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemCollection]): + filter_ (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem']]): + group_by (Union['NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0', None, Unset, str]): + aggregate (Union['NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0', None, Unset]): """ - name: None | str | Unset = UNSET - collection: NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset = UNSET - filter_: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - group_by: NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset = UNSET - aggregate: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset = UNSET + name: None | Unset | str = UNSET + collection: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemCollection = UNSET + filter_: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem"] = UNSET + group_by: Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET + aggregate: Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: None | str | Unset + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: str | Unset = UNSET + collection: Unset | str = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: list[dict[str, Any]] | Unset = UNSET + filter_: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: dict[str, Any] | None | str | Unset + group_by: None | Unset | dict[str, Any] | str if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: dict[str, Any] | None | Unset + aggregate: None | Unset | dict[str, Any] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -116,34 +114,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset + collection: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemCollection if isinstance(_collection, Unset): collection = UNSET else: collection = check_new_dashboard_panel_data_attributes_params_datasets_item_collection(_collection) + filter_ = [] _filter_ = d.pop("filter", UNSET) - filter_: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - if _filter_ is not UNSET: - filter_ = [] - for filter_item_data in _filter_: - filter_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) + for filter_item_data in _filter_ or []: + filter_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) - filter_.append(filter_item) + filter_.append(filter_item) def _parse_group_by( data: object, - ) -> NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset: + ) -> Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str]: if data is None: return data if isinstance(data, Unset): @@ -156,15 +152,17 @@ def _parse_group_by( ) return group_by_type_1_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset, data) + return cast( + Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str], data + ) group_by = _parse_group_by(d.pop("group_by", UNSET)) def _parse_aggregate( data: object, - ) -> NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset: + ) -> Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -175,9 +173,9 @@ def _parse_aggregate( aggregate_type_0 = NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset, data) + return cast(Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset], data) aggregate = _parse_aggregate(d.pop("aggregate", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py index e3ed83f7..a92aa09f 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,28 +17,28 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: """ Attributes: - operation (NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset): - key (None | str | Unset): - cumulative (bool | None | Unset): + operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation]): + key (Union[None, Unset, str]): + cumulative (Union[None, Unset, bool]): """ - operation: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset = UNSET - key: None | str | Unset = UNSET - cumulative: bool | None | Unset = UNSET + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = UNSET + key: None | Unset | str = UNSET + cumulative: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | str | Unset + key: None | Unset | str if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: bool | None | Unset + cumulative: None | Unset | bool if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation if isinstance(_operation, Unset): operation = UNSET else: @@ -70,21 +68,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> None | str | Unset: + def _parse_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> bool | None | Unset: + def _parse_cumulative(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py index 1a123cb7..628c4993 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem: """ Attributes: - operation (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset): - rules (list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset): + operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation]): + rules (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): """ - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset = UNSET - rules: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = UNSET + rules: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -64,22 +61,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation if isinstance(_operation, Unset): operation = UNSET else: operation = check_new_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation(_operation) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( - rules_item_data - ) + for rules_item_data in _rules or []: + rules_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) new_dashboard_panel_data_attributes_params_datasets_item_filter_item = cls( operation=operation, diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py index 1e50dd93..64adb14c 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,24 +21,24 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset): - condition (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset): - key (str | Unset): - value (str | Unset): + operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation]): + condition (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition]): + key (Union[Unset, str]): + value (Union[Unset, str]): """ - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET - condition: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET - key: str | Unset = UNSET - value: str | Unset = UNSET + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = UNSET + condition: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = UNSET + key: Unset | str = UNSET + value: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: str | Unset = UNSET + condition: Unset | str = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation if isinstance(_operation, Unset): operation = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset + condition: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py index 7119aaa4..baa6f0ba 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py index 7628e602..2b500d0d 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,14 +17,14 @@ class NewDashboardPanelDataAttributesParamsLegend: """ Attributes: - groups (NewDashboardPanelDataAttributesParamsLegendGroups | Unset): Default: 'all'. + groups (Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. """ - groups: NewDashboardPanelDataAttributesParamsLegendGroups | Unset = "all" + groups: Unset | NewDashboardPanelDataAttributesParamsLegendGroups = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: str | Unset = UNSET + groups: Unset | str = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: NewDashboardPanelDataAttributesParamsLegendGroups | Unset + groups: Unset | NewDashboardPanelDataAttributesParamsLegendGroups if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py index 4937e4d2..bc42d2ce 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_edge_connector.py b/rootly_sdk/models/new_edge_connector.py index b0ec3196..c6ec30be 100644 --- a/rootly_sdk/models/new_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEdgeConnector: edge_connector (NewEdgeConnectorEdgeConnector): """ - edge_connector: NewEdgeConnectorEdgeConnector + edge_connector: "NewEdgeConnectorEdgeConnector" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - edge_connector = self.edge_connector.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_edge_connector_action.py b/rootly_sdk/models/new_edge_connector_action.py index f8c7d5d8..3312bc3c 100644 --- a/rootly_sdk/models/new_edge_connector_action.py +++ b/rootly_sdk/models/new_edge_connector_action.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEdgeConnectorAction: action (NewEdgeConnectorActionAction): """ - action: NewEdgeConnectorActionAction + action: "NewEdgeConnectorActionAction" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action = self.action.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_edge_connector_action_action.py b/rootly_sdk/models/new_edge_connector_action_action.py index 942ab5ea..0d749327 100644 --- a/rootly_sdk/models/new_edge_connector_action_action.py +++ b/rootly_sdk/models/new_edge_connector_action_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class NewEdgeConnectorActionAction: Attributes: name (str): Action name action_type (NewEdgeConnectorActionActionActionType): Action type - metadata (NewEdgeConnectorActionActionMetadata | Unset): + metadata (Union[Unset, NewEdgeConnectorActionActionMetadata]): """ name: str action_type: NewEdgeConnectorActionActionActionType - metadata: NewEdgeConnectorActionActionMetadata | Unset = UNSET + metadata: Union[Unset, "NewEdgeConnectorActionActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name action_type: str = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_type = check_new_edge_connector_action_action_action_type(d.pop("action_type")) _metadata = d.pop("metadata", UNSET) - metadata: NewEdgeConnectorActionActionMetadata | Unset + metadata: Unset | NewEdgeConnectorActionActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata.py b/rootly_sdk/models/new_edge_connector_action_action_metadata.py index fe6cd145..2af21e6c 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,37 +23,36 @@ class NewEdgeConnectorActionActionMetadata: """ Attributes: - description (None | str | Unset): - timeout (int | None | Unset): - icon (NewEdgeConnectorActionActionMetadataIcon | Unset): - parameters (list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset): + description (Union[None, Unset, str]): + timeout (Union[None, Unset, int]): + icon (Union[Unset, NewEdgeConnectorActionActionMetadataIcon]): + parameters (Union[None, Unset, list['NewEdgeConnectorActionActionMetadataParametersType0Item']]): """ - description: None | str | Unset = UNSET - timeout: int | None | Unset = UNSET - icon: NewEdgeConnectorActionActionMetadataIcon | Unset = UNSET - parameters: list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset = UNSET + description: None | Unset | str = UNSET + timeout: None | Unset | int = UNSET + icon: Unset | NewEdgeConnectorActionActionMetadataIcon = UNSET + parameters: None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: int | None | Unset + timeout: None | Unset | int if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - icon: str | Unset = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - parameters: list[dict[str, Any]] | None | Unset + parameters: None | Unset | list[dict[str, Any]] if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -89,26 +86,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> int | None | Unset: + def _parse_timeout(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) timeout = _parse_timeout(d.pop("timeout", UNSET)) _icon = d.pop("icon", UNSET) - icon: NewEdgeConnectorActionActionMetadataIcon | Unset + icon: Unset | NewEdgeConnectorActionActionMetadataIcon if isinstance(_icon, Unset): icon = UNSET else: @@ -116,7 +113,7 @@ def _parse_timeout(data: object) -> int | None | Unset: def _parse_parameters( data: object, - ) -> list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset: + ) -> None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -134,9 +131,9 @@ def _parse_parameters( parameters_type_0.append(parameters_type_0_item) return parameters_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset, data) + return cast(None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"], data) parameters = _parse_parameters(d.pop("parameters", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py index 0cce53dd..3d886db6 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,44 +17,44 @@ class NewEdgeConnectorActionActionMetadataParametersType0Item: """ Attributes: - name (str | Unset): - type_ (NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset): - required (bool | Unset): - description (None | str | Unset): - default (None | str | Unset): Default value (any type) - options (list[str] | None | Unset): + name (Union[Unset, str]): + type_ (Union[Unset, NewEdgeConnectorActionActionMetadataParametersType0ItemType]): + required (Union[Unset, bool]): + description (Union[None, Unset, str]): + default (Union[None, Unset, str]): Default value (any type) + options (Union[None, Unset, list[str]]): """ - name: str | Unset = UNSET - type_: NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset = UNSET - required: bool | Unset = UNSET - description: None | str | Unset = UNSET - default: None | str | Unset = UNSET - options: list[str] | None | Unset = UNSET + name: Unset | str = UNSET + type_: Unset | NewEdgeConnectorActionActionMetadataParametersType0ItemType = UNSET + required: Unset | bool = UNSET + description: None | Unset | str = UNSET + default: None | Unset | str = UNSET + options: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | str | Unset + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: list[str] | None | Unset + options: None | Unset | list[str] if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -89,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset + type_: Unset | NewEdgeConnectorActionActionMetadataParametersType0ItemType if isinstance(_type_, Unset): type_ = UNSET else: @@ -97,25 +95,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> list[str] | None | Unset: + def _parse_options(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -126,9 +124,9 @@ def _parse_options(data: object) -> list[str] | None | Unset: options_type_0 = cast(list[str], data) return options_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_edge_connector.py b/rootly_sdk/models/new_edge_connector_edge_connector.py index c5d16dd9..1a8c5d5c 100644 --- a/rootly_sdk/models/new_edge_connector_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector_edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,31 +18,31 @@ class NewEdgeConnectorEdgeConnector: """ Attributes: name (str): Connector name - description (None | str | Unset): Connector description - status (NewEdgeConnectorEdgeConnectorStatus | Unset): Connector status - subscriptions (list[str] | Unset): Array of event types to subscribe to + description (Union[None, Unset, str]): Connector description + status (Union[Unset, NewEdgeConnectorEdgeConnectorStatus]): Connector status + subscriptions (Union[Unset, list[str]]): Array of event types to subscribe to """ name: str - description: None | str | Unset = UNSET - status: NewEdgeConnectorEdgeConnectorStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET + description: None | Unset | str = UNSET + status: Unset | NewEdgeConnectorEdgeConnectorStatus = UNSET + subscriptions: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions @@ -69,17 +67,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: NewEdgeConnectorEdgeConnectorStatus | Unset + status: Unset | NewEdgeConnectorEdgeConnectorStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/new_environment.py b/rootly_sdk/models/new_environment.py index 8f807574..d79e5a31 100644 --- a/rootly_sdk/models/new_environment.py +++ b/rootly_sdk/models/new_environment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEnvironment: data (NewEnvironmentData): """ - data: NewEnvironmentData + data: "NewEnvironmentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_environment_data.py b/rootly_sdk/models/new_environment_data.py index c4497ba1..4408f696 100644 --- a/rootly_sdk/models/new_environment_data.py +++ b/rootly_sdk/models/new_environment_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewEnvironmentData: """ type_: NewEnvironmentDataType - attributes: NewEnvironmentDataAttributes + attributes: "NewEnvironmentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_environment_data_attributes.py b/rootly_sdk/models/new_environment_data_attributes.py index fe57fc2c..654b7bf5 100644 --- a/rootly_sdk/models/new_environment_data_attributes.py +++ b/rootly_sdk/models/new_environment_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,58 +23,74 @@ class NewEnvironmentDataAttributes: """ Attributes: name (str): The name of the environment - description (None | str | Unset): The description of the environment - color (None | str | Unset): The hex color of the environment - position (int | None | Unset): Position of the environment - external_id (None | str | Unset): The external id associated to this environment - notify_emails (list[str] | None | Unset): Emails to attach to the environment - slack_channels (list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the environment + public_description (Union[None, Unset, str]): The status page description of the environment + color (Union[None, Unset, str]): The hex color of the environment + position (Union[None, Unset, int]): Position of the environment + external_id (Union[None, Unset, str]): The external id associated to this environment + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the environment + slack_channels (Union[None, Unset, list['NewEnvironmentDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this environment + slack_aliases (Union[None, Unset, list['NewEnvironmentDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this environment - slack_aliases (list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this environment - properties (list[NewEnvironmentDataAttributesPropertiesItem] | Unset): Array of property values for this + properties (Union[Unset, list['NewEnvironmentDataAttributesPropertiesItem']]): Array of property values for this environment. """ name: str - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[NewEnvironmentDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["NewEnvironmentDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -85,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -97,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -109,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -123,8 +137,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -155,43 +173,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -202,15 +238,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -228,15 +264,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -254,24 +290,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewEnvironmentDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_environment_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, color=color, position=position, external_id=external_id, diff --git a/rootly_sdk/models/new_environment_data_attributes_properties_item.py b/rootly_sdk/models/new_environment_data_attributes_properties_item.py index 417ca4ce..1205e4d5 100644 --- a/rootly_sdk/models/new_environment_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py index cc449822..c59113a3 100644 --- a/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py index 49ec61b3..fef9736b 100644 --- a/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_escalation_policy.py b/rootly_sdk/models/new_escalation_policy.py index eaf02f09..3145c93b 100644 --- a/rootly_sdk/models/new_escalation_policy.py +++ b/rootly_sdk/models/new_escalation_policy.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEscalationPolicy: data (NewEscalationPolicyData): """ - data: NewEscalationPolicyData + data: "NewEscalationPolicyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_escalation_policy_data.py b/rootly_sdk/models/new_escalation_policy_data.py index 63bf20fd..7abe00c2 100644 --- a/rootly_sdk/models/new_escalation_policy_data.py +++ b/rootly_sdk/models/new_escalation_policy_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewEscalationPolicyData: """ type_: NewEscalationPolicyDataType - attributes: NewEscalationPolicyDataAttributes + attributes: "NewEscalationPolicyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes.py b/rootly_sdk/models/new_escalation_policy_data_attributes.py index ca904842..79022943 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,20 +19,20 @@ class NewEscalationPolicyDataAttributes: """ Attributes: name (str): The name of the escalation policy - description (None | str | Unset): The description of the escalation policy - repeat_count (int | Unset): The number of times this policy will be executed until someone acknowledges the - alert - group_ids (list[str] | Unset): Associated groups (alerting the group will trigger escalation policy) - service_ids (list[str] | Unset): Associated services (alerting the service will trigger escalation policy) - business_hours (NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset): + description (Union[None, Unset, str]): The description of the escalation policy + repeat_count (Union[Unset, int]): The number of times this policy will be executed until someone acknowledges + the alert + group_ids (Union[Unset, list[str]]): Associated groups (alerting the group will trigger escalation policy) + service_ids (Union[Unset, list[str]]): Associated services (alerting the service will trigger escalation policy) + business_hours (Union['NewEscalationPolicyDataAttributesBusinessHoursType0', None, Unset]): """ name: str - description: None | str | Unset = UNSET - repeat_count: int | Unset = UNSET - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - business_hours: NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset = UNSET + description: None | Unset | str = UNSET + repeat_count: Unset | int = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + business_hours: Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_data_attributes_business_hours_type_0 import ( @@ -43,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -51,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: dict[str, Any] | None | Unset + business_hours: None | Unset | dict[str, Any] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, NewEscalationPolicyDataAttributesBusinessHoursType0): @@ -96,12 +94,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -111,7 +109,9 @@ def _parse_description(data: object) -> None | str | Unset: service_ids = cast(list[str], d.pop("service_ids", UNSET)) - def _parse_business_hours(data: object) -> NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset: + def _parse_business_hours( + data: object, + ) -> Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -122,9 +122,9 @@ def _parse_business_hours(data: object) -> NewEscalationPolicyDataAttributesBusi business_hours_type_0 = NewEscalationPolicyDataAttributesBusinessHoursType0.from_dict(data) return business_hours_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset, data) + return cast(Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset], data) business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py index 60b5e2e1..3b974e86 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,24 +21,25 @@ class NewEscalationPolicyDataAttributesBusinessHoursType0: """ Attributes: - time_zone (NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset): Time zone for business hours - days (list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset): Business days - start_time (None | str | Unset): Start time for business hours (HH:MM) - end_time (None | str | Unset): End time for business hours (HH:MM) + time_zone (Union[Unset, NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone]): Time zone for business + hours + days (Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]): Business days + start_time (Union[None, Unset, str]): Start time for business hours (HH:MM) + end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset = UNSET - days: list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset = UNSET - start_time: None | str | Unset = UNSET - end_time: None | str | Unset = UNSET + time_zone: Unset | NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone = UNSET + days: None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] = UNSET + start_time: None | Unset | str = UNSET + end_time: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: str | Unset = UNSET + time_zone: Unset | str = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: list[str] | None | Unset + days: None | Unset | list[str] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | str | Unset + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | str | Unset + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset + time_zone: Unset | NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -90,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset: + ) -> None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]: if data is None: return data if isinstance(data, Unset): @@ -110,27 +109,27 @@ def _parse_days( days_type_0.append(days_type_0_item) return days_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset, data) + return cast(None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | str | Unset: + def _parse_start_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | str | Unset: + def _parse_end_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_level.py b/rootly_sdk/models/new_escalation_policy_level.py index 2470c8e6..29fe8142 100644 --- a/rootly_sdk/models/new_escalation_policy_level.py +++ b/rootly_sdk/models/new_escalation_policy_level.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEscalationPolicyLevel: data (NewEscalationPolicyLevelData): """ - data: NewEscalationPolicyLevelData + data: "NewEscalationPolicyLevelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_escalation_policy_level_data.py b/rootly_sdk/models/new_escalation_policy_level_data.py index f8b43279..519cc25e 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data.py +++ b/rootly_sdk/models/new_escalation_policy_level_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewEscalationPolicyLevelData: """ type_: NewEscalationPolicyLevelDataType - attributes: NewEscalationPolicyLevelDataAttributes + attributes: "NewEscalationPolicyLevelDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py index 247dcb2b..1ada703f 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py @@ -1,10 +1,16 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define +from ..models.new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode, +) +from ..models.new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope, +) from ..models.new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy, @@ -29,28 +35,48 @@ class NewEscalationPolicyLevelDataAttributes: """ Attributes: position (int): Position of the escalation policy level - notification_target_params (list[NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | - None]): Escalation level's notification targets - delay (int | Unset): Delay before notifying targets in the next Escalation Level. - paging_strategy_configuration_strategy - (NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset): Default: 'default'. - paging_strategy_configuration_schedule_strategy - (NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset): Default: - 'on_call_only'. - escalation_policy_path_id (None | str | Unset): The ID of the dynamic escalation policy path the level will + notification_target_params + (list[Union['NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0', None]]): Escalation + level's notification targets + delay (Union[Unset, int]): Delay before notifying targets in the next Escalation Level. + paging_strategy_configuration_strategy (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy]): Default: 'default'. + paging_strategy_configuration_schedule_strategy (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy]): Default: 'on_call_only'. + paging_strategy_configuration_repeats (Union[None, Unset, int]): Number of times to rotate through the roster + (cycle-based round robin). + paging_strategy_configuration_repeats_mode (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode]): Controls how repeats are + interpreted: 'users' pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope]): Scope of rotation ordering: + active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (Union[None, Unset, int]): Number of users to page at a time + (cycle-based round robin). + escalation_policy_path_id (Union[None, Unset, str]): The ID of the dynamic escalation policy path the level will belong to. If nothing is specified it will add the level to your default path. """ position: int - notification_target_params: list[NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None] - delay: int | Unset = UNSET + notification_target_params: list[ + Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None] + ] + delay: Unset | int = UNSET paging_strategy_configuration_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy ) = "default" paging_strategy_configuration_schedule_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy ) = "on_call_only" - escalation_policy_path_id: None | str | Unset = UNSET + paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats_mode: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) = UNSET + paging_strategy_configuration_rotation_scope: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) = UNSET + paging_strategy_configuration_page_users_count: None | Unset | int = UNSET + escalation_policy_path_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_level_data_attributes_notification_target_params_item_type_0 import ( @@ -61,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: dict[str, Any] | None + notification_target_params_item: None | dict[str, Any] if isinstance( notification_target_params_item_data, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -73,15 +99,35 @@ def to_dict(self) -> dict[str, Any]: delay = self.delay - paging_strategy_configuration_strategy: str | Unset = UNSET + paging_strategy_configuration_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: str | Unset = UNSET + paging_strategy_configuration_schedule_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - escalation_policy_path_id: None | str | Unset + paging_strategy_configuration_repeats: None | Unset | int + if isinstance(self.paging_strategy_configuration_repeats, Unset): + paging_strategy_configuration_repeats = UNSET + else: + paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats + + paging_strategy_configuration_repeats_mode: Unset | str = UNSET + if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode + + paging_strategy_configuration_rotation_scope: Unset | str = UNSET + if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope + + paging_strategy_configuration_page_users_count: None | Unset | int + if isinstance(self.paging_strategy_configuration_page_users_count, Unset): + paging_strategy_configuration_page_users_count = UNSET + else: + paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count + + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: @@ -103,6 +149,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["paging_strategy_configuration_schedule_strategy"] = ( paging_strategy_configuration_schedule_strategy ) + if paging_strategy_configuration_repeats is not UNSET: + field_dict["paging_strategy_configuration_repeats"] = paging_strategy_configuration_repeats + if paging_strategy_configuration_repeats_mode is not UNSET: + field_dict["paging_strategy_configuration_repeats_mode"] = paging_strategy_configuration_repeats_mode + if paging_strategy_configuration_rotation_scope is not UNSET: + field_dict["paging_strategy_configuration_rotation_scope"] = paging_strategy_configuration_rotation_scope + if paging_strategy_configuration_page_users_count is not UNSET: + field_dict["paging_strategy_configuration_page_users_count"] = ( + paging_strategy_configuration_page_users_count + ) if escalation_policy_path_id is not UNSET: field_dict["escalation_policy_path_id"] = escalation_policy_path_id @@ -123,7 +179,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_notification_target_params_item( data: object, - ) -> NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None: + ) -> Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]: if data is None: return data try: @@ -134,9 +190,11 @@ def _parse_notification_target_params_item( ) return notification_target_params_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None, data) + return cast( + Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None], data + ) notification_target_params_item = _parse_notification_target_params_item( notification_target_params_item_data @@ -148,7 +206,7 @@ def _parse_notification_target_params_item( _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) paging_strategy_configuration_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy ) if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET @@ -163,7 +221,7 @@ def _parse_notification_target_params_item( "paging_strategy_configuration_schedule_strategy", UNSET ) paging_strategy_configuration_schedule_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET @@ -174,12 +232,60 @@ def _parse_notification_target_params_item( ) ) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( + d.pop("paging_strategy_configuration_repeats", UNSET) + ) + + _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) + paging_strategy_configuration_repeats_mode: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) + if isinstance(_paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = UNSET + else: + paging_strategy_configuration_repeats_mode = ( + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + _paging_strategy_configuration_repeats_mode + ) + ) + + _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) + paging_strategy_configuration_rotation_scope: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) + if isinstance(_paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = UNSET + else: + paging_strategy_configuration_rotation_scope = ( + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + _paging_strategy_configuration_rotation_scope + ) + ) + + def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( + d.pop("paging_strategy_configuration_page_users_count", UNSET) + ) + + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) @@ -189,6 +295,10 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: delay=delay, paging_strategy_configuration_strategy=paging_strategy_configuration_strategy, paging_strategy_configuration_schedule_strategy=paging_strategy_configuration_schedule_strategy, + paging_strategy_configuration_repeats=paging_strategy_configuration_repeats, + paging_strategy_configuration_repeats_mode=paging_strategy_configuration_repeats_mode, + paging_strategy_configuration_rotation_scope=paging_strategy_configuration_rotation_scope, + paging_strategy_configuration_page_users_count=paging_strategy_configuration_page_users_count, escalation_policy_path_id=escalation_policy_path_id, ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py index 9609b665..fa456696 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -27,13 +25,13 @@ class NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0: Microsoft Teams channel, then the Rootly channel UUID. type_ (NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type): The type of the notification target - team_members (NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset): For - targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. + team_members (Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers]): + For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset = UNSET + team_members: Unset | NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: str | Unset = UNSET + team_members: Unset | str = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset + team_members: Unset | NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py new file mode 100644 index 00000000..ebc1070f --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] + +NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: set[ + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode +] = { + "all", + "users", +} + + +def check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + value: str | None, +) -> NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: + return cast(NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py new file mode 100644 index 00000000..622265ef --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py @@ -0,0 +1,24 @@ +from typing import Literal, cast + +NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope = Literal[ + "active_rotation", "entire_schedule" +] + +NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: set[ + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope +] = { + "active_rotation", + "entire_schedule", +} + + +def check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + value: str | None, +) -> NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: + return cast(NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path.py b/rootly_sdk/models/new_escalation_policy_path.py index 9af97aa7..44d4209f 100644 --- a/rootly_sdk/models/new_escalation_policy_path.py +++ b/rootly_sdk/models/new_escalation_policy_path.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEscalationPolicyPath: data (NewEscalationPolicyPathData): """ - data: NewEscalationPolicyPathData + data: "NewEscalationPolicyPathData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_escalation_policy_path_data.py b/rootly_sdk/models/new_escalation_policy_path_data.py index e0b9e314..9dd2784d 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data.py +++ b/rootly_sdk/models/new_escalation_policy_path_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewEscalationPolicyPathData: """ type_: NewEscalationPolicyPathDataType - attributes: NewEscalationPolicyPathDataAttributes + attributes: "NewEscalationPolicyPathDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py index d4d8fd4f..2e64dd84 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -65,60 +63,65 @@ class NewEscalationPolicyPathDataAttributes: """ Attributes: name (str): The name of the escalation path - notification_type (NewEscalationPolicyPathDataAttributesNotificationType | Unset): Notification rule type to be - used Default: 'audible'. - path_type (NewEscalationPolicyPathDataAttributesPathType | Unset): The type of escalation path to create + notification_type (Union[Unset, NewEscalationPolicyPathDataAttributesNotificationType]): Notification rule type + to be used Default: 'audible'. + path_type (Union[Unset, NewEscalationPolicyPathDataAttributesPathType]): The type of escalation path to create Default: 'escalation'. - after_deferral_behavior (NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset): What happens after - a deferral path finishes. Required for deferral paths. - after_deferral_path_id (None | str | Unset): The escalation path to execute after this deferral path when + after_deferral_behavior (Union[Unset, NewEscalationPolicyPathDataAttributesAfterDeferralBehavior]): What happens + after a deferral path finishes. Required for deferral paths. + after_deferral_path_id (Union[None, Unset, str]): The escalation path to execute after this deferral path when after_deferral_behavior is execute_path. - default (bool | None | Unset): Whether this escalation path is the default path - match_mode (NewEscalationPolicyPathDataAttributesMatchMode | Unset): How path rules are matched. Default: + default (Union[None, Unset, bool]): Whether this escalation path is the default path + match_mode (Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode]): How path rules are matched. Default: 'match-all-rules'. - position (int | Unset): The position of this path in the paths for this EP. - repeat (bool | None | Unset): Whether this path should be repeated until someone acknowledges the alert - repeat_count (int | None | Unset): The number of times this path will be executed until someone acknowledges the - alert - initial_delay (int | Unset): Initial delay for escalation path in minutes. Maximum 1 week (10080). - rules (list[NewEscalationPolicyPathDataAttributesRulesItemType0 | - NewEscalationPolicyPathDataAttributesRulesItemType1 | NewEscalationPolicyPathDataAttributesRulesItemType2 | - NewEscalationPolicyPathDataAttributesRulesItemType3 | NewEscalationPolicyPathDataAttributesRulesItemType4 | - NewEscalationPolicyPathDataAttributesRulesItemType5 | NewEscalationPolicyPathDataAttributesRulesItemType6 | - NewEscalationPolicyPathDataAttributesRulesItemType7] | Unset): Escalation path conditions - time_restriction_time_zone (NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset): Time zone - used for time restrictions. - time_restrictions (list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset): If time + position (Union[Unset, int]): The position of this path in the paths for this EP. + repeat (Union[None, Unset, bool]): Whether this path should be repeated until someone acknowledges the alert + repeat_count (Union[None, Unset, int]): The number of times this path will be executed until someone + acknowledges the alert + initial_delay (Union[Unset, int]): Initial delay for escalation path in minutes. Maximum 1 week (10080). + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts on this path after N + minutes; null inherits the urgency/workspace default, negative = never. + rules (Union[Unset, list[Union['NewEscalationPolicyPathDataAttributesRulesItemType0', + 'NewEscalationPolicyPathDataAttributesRulesItemType1', 'NewEscalationPolicyPathDataAttributesRulesItemType2', + 'NewEscalationPolicyPathDataAttributesRulesItemType3', 'NewEscalationPolicyPathDataAttributesRulesItemType4', + 'NewEscalationPolicyPathDataAttributesRulesItemType5', 'NewEscalationPolicyPathDataAttributesRulesItemType6', + 'NewEscalationPolicyPathDataAttributesRulesItemType7']]]): Escalation path conditions + time_restriction_time_zone (Union[Unset, NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone]): Time + zone used for time restrictions. + time_restrictions (Union[Unset, list['NewEscalationPolicyPathDataAttributesTimeRestrictionsItem']]): If time restrictions are set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ name: str - notification_type: NewEscalationPolicyPathDataAttributesNotificationType | Unset = "audible" - path_type: NewEscalationPolicyPathDataAttributesPathType | Unset = "escalation" - after_deferral_behavior: NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset = UNSET - after_deferral_path_id: None | str | Unset = UNSET - default: bool | None | Unset = UNSET - match_mode: NewEscalationPolicyPathDataAttributesMatchMode | Unset = "match-all-rules" - position: int | Unset = UNSET - repeat: bool | None | Unset = UNSET - repeat_count: int | None | Unset = UNSET - initial_delay: int | Unset = UNSET + notification_type: Unset | NewEscalationPolicyPathDataAttributesNotificationType = "audible" + path_type: Unset | NewEscalationPolicyPathDataAttributesPathType = "escalation" + after_deferral_behavior: Unset | NewEscalationPolicyPathDataAttributesAfterDeferralBehavior = UNSET + after_deferral_path_id: None | Unset | str = UNSET + default: None | Unset | bool = UNSET + match_mode: Unset | NewEscalationPolicyPathDataAttributesMatchMode = "match-all-rules" + position: Unset | int = UNSET + repeat: None | Unset | bool = UNSET + repeat_count: None | Unset | int = UNSET + initial_delay: Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET rules: ( - list[ - NewEscalationPolicyPathDataAttributesRulesItemType0 - | NewEscalationPolicyPathDataAttributesRulesItemType1 - | NewEscalationPolicyPathDataAttributesRulesItemType2 - | NewEscalationPolicyPathDataAttributesRulesItemType3 - | NewEscalationPolicyPathDataAttributesRulesItemType4 - | NewEscalationPolicyPathDataAttributesRulesItemType5 - | NewEscalationPolicyPathDataAttributesRulesItemType6 - | NewEscalationPolicyPathDataAttributesRulesItemType7 + Unset + | list[ + Union[ + "NewEscalationPolicyPathDataAttributesRulesItemType0", + "NewEscalationPolicyPathDataAttributesRulesItemType1", + "NewEscalationPolicyPathDataAttributesRulesItemType2", + "NewEscalationPolicyPathDataAttributesRulesItemType3", + "NewEscalationPolicyPathDataAttributesRulesItemType4", + "NewEscalationPolicyPathDataAttributesRulesItemType5", + "NewEscalationPolicyPathDataAttributesRulesItemType6", + "NewEscalationPolicyPathDataAttributesRulesItemType7", + ] ] - | Unset ) = UNSET - time_restriction_time_zone: NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset = UNSET - time_restrictions: list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET + time_restriction_time_zone: Unset | NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = UNSET + time_restrictions: Unset | list["NewEscalationPolicyPathDataAttributesTimeRestrictionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_path_data_attributes_rules_item_type_0 import ( @@ -145,43 +148,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - notification_type: str | Unset = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: str | Unset = UNSET + path_type: Unset | str = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: str | Unset = UNSET + after_deferral_behavior: Unset | str = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | str | Unset + after_deferral_path_id: None | Unset | str if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: bool | None | Unset + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: str | Unset = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: bool | None | Unset + repeat: None | Unset | bool if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: int | None | Unset + repeat_count: None | Unset | int if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -189,7 +192,13 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - rules: list[dict[str, Any]] | Unset = UNSET + retrigger_timeout_minutes: None | Unset | int + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -213,11 +222,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: str | Unset = UNSET + time_restriction_time_zone: Unset | str = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: list[dict[str, Any]] | Unset = UNSET + time_restrictions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -251,6 +260,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_count"] = repeat_count if initial_delay is not UNSET: field_dict["initial_delay"] = initial_delay + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if rules is not UNSET: field_dict["rules"] = rules if time_restriction_time_zone is not UNSET: @@ -294,21 +305,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") _notification_type = d.pop("notification_type", UNSET) - notification_type: NewEscalationPolicyPathDataAttributesNotificationType | Unset + notification_type: Unset | NewEscalationPolicyPathDataAttributesNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_new_escalation_policy_path_data_attributes_notification_type(_notification_type) _path_type = d.pop("path_type", UNSET) - path_type: NewEscalationPolicyPathDataAttributesPathType | Unset + path_type: Unset | NewEscalationPolicyPathDataAttributesPathType if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_new_escalation_policy_path_data_attributes_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset + after_deferral_behavior: Unset | NewEscalationPolicyPathDataAttributesAfterDeferralBehavior if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -316,26 +327,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _after_deferral_behavior ) - def _parse_after_deferral_path_id(data: object) -> None | str | Unset: + def _parse_after_deferral_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: NewEscalationPolicyPathDataAttributesMatchMode | Unset + match_mode: Unset | NewEscalationPolicyPathDataAttributesMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -343,124 +354,119 @@ def _parse_default(data: object) -> bool | None | Unset: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> bool | None | Unset: + def _parse_repeat(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> int | None | Unset: + def _parse_repeat_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) repeat_count = _parse_repeat_count(d.pop("repeat_count", UNSET)) initial_delay = d.pop("initial_delay", UNSET) + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + + rules = [] _rules = d.pop("rules", UNSET) - rules: ( - list[ - NewEscalationPolicyPathDataAttributesRulesItemType0 - | NewEscalationPolicyPathDataAttributesRulesItemType1 - | NewEscalationPolicyPathDataAttributesRulesItemType2 - | NewEscalationPolicyPathDataAttributesRulesItemType3 - | NewEscalationPolicyPathDataAttributesRulesItemType4 - | NewEscalationPolicyPathDataAttributesRulesItemType5 - | NewEscalationPolicyPathDataAttributesRulesItemType6 - | NewEscalationPolicyPathDataAttributesRulesItemType7 - ] - | Unset - ) = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - - def _parse_rules_item( - data: object, - ) -> ( - NewEscalationPolicyPathDataAttributesRulesItemType0 - | NewEscalationPolicyPathDataAttributesRulesItemType1 - | NewEscalationPolicyPathDataAttributesRulesItemType2 - | NewEscalationPolicyPathDataAttributesRulesItemType3 - | NewEscalationPolicyPathDataAttributesRulesItemType4 - | NewEscalationPolicyPathDataAttributesRulesItemType5 - | NewEscalationPolicyPathDataAttributesRulesItemType6 - | NewEscalationPolicyPathDataAttributesRulesItemType7 - ): - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_0 = NewEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - - return rules_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_1 = NewEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) - - return rules_item_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_2 = NewEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) - - return rules_item_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_3 = NewEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) - - return rules_item_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_4 = NewEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) - - return rules_item_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_5 = NewEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) - - return rules_item_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_6 = NewEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) - - return rules_item_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass + for rules_item_data in _rules or []: + + def _parse_rules_item( + data: object, + ) -> Union[ + "NewEscalationPolicyPathDataAttributesRulesItemType0", + "NewEscalationPolicyPathDataAttributesRulesItemType1", + "NewEscalationPolicyPathDataAttributesRulesItemType2", + "NewEscalationPolicyPathDataAttributesRulesItemType3", + "NewEscalationPolicyPathDataAttributesRulesItemType4", + "NewEscalationPolicyPathDataAttributesRulesItemType5", + "NewEscalationPolicyPathDataAttributesRulesItemType6", + "NewEscalationPolicyPathDataAttributesRulesItemType7", + ]: + try: if not isinstance(data, dict): raise TypeError() - rules_item_type_7 = NewEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) + rules_item_type_0 = NewEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - return rules_item_type_7 + return rules_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_1 = NewEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) - rules_item = _parse_rules_item(rules_item_data) + return rules_item_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_2 = NewEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) - rules.append(rules_item) + return rules_item_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_3 = NewEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) + + return rules_item_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_4 = NewEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) + + return rules_item_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_5 = NewEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) + + return rules_item_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_6 = NewEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) + + return rules_item_type_6 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + rules_item_type_7 = NewEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) + + return rules_item_type_7 + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset + time_restriction_time_zone: Unset | NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -468,16 +474,14 @@ def _parse_rules_item( _time_restriction_time_zone ) + time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - time_restrictions: list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET - if _time_restrictions is not UNSET: - time_restrictions = [] - for time_restrictions_item_data in _time_restrictions: - time_restrictions_item = NewEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( - time_restrictions_item_data - ) + for time_restrictions_item_data in _time_restrictions or []: + time_restrictions_item = NewEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( + time_restrictions_item_data + ) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) new_escalation_policy_path_data_attributes = cls( name=name, @@ -491,6 +495,7 @@ def _parse_rules_item( repeat=repeat, repeat_count=repeat_count, initial_delay=initial_delay, + retrigger_timeout_minutes=retrigger_timeout_minutes, rules=rules, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py index 7966b6c7..38c00a05 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py index 0494dba8..d85a1090 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py index c367486f..173fe30c 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,15 +24,15 @@ class NewEscalationPolicyPathDataAttributesRulesItemType2: rule_type (NewEscalationPolicyPathDataAttributesRulesItemType2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (NewEscalationPolicyPathDataAttributesRulesItemType2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: NewEscalationPolicyPathDataAttributesRulesItemType2RuleType json_path: str operator: NewEscalationPolicyPathDataAttributesRulesItemType2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_new_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py index 2d43753c..e5bc643d 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,14 +26,14 @@ class NewEscalationPolicyPathDataAttributesRulesItemType3: fieldable_id (str): The ID of the alert field operator (NewEscalationPolicyPathDataAttributesRulesItemType3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: NewEscalationPolicyPathDataAttributesRulesItemType3RuleType fieldable_type: str fieldable_id: str operator: NewEscalationPolicyPathDataAttributesRulesItemType3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py index 7af44d76..969d678c 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py index cbb79731..fc7aeb81 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class NewEscalationPolicyPathDataAttributesRulesItemType5: Attributes: rule_type (NewEscalationPolicyPathDataAttributesRulesItemType5RuleType): The type of the escalation path rule time_zone (NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone): Time zone for the deferral window - time_blocks (list[NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem]): Time windows during which - alerts are deferred + time_blocks (list['NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem']): Time windows during + which alerts are deferred """ rule_type: NewEscalationPolicyPathDataAttributesRulesItemType5RuleType time_zone: NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone - time_blocks: list[NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem] + time_blocks: list["NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py index 7f77f267..ea865059 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py index f96b8c64..f3774fac 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py index 34200850..6aecf847 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py index 6b6d14be..6f80bec8 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_form_field.py b/rootly_sdk/models/new_form_field.py index b551a72f..478e6ca9 100644 --- a/rootly_sdk/models/new_form_field.py +++ b/rootly_sdk/models/new_form_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormField: data (NewFormFieldData): """ - data: NewFormFieldData + data: "NewFormFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_data.py b/rootly_sdk/models/new_form_field_data.py index ed8569e0..029c332a 100644 --- a/rootly_sdk/models/new_form_field_data.py +++ b/rootly_sdk/models/new_form_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFormFieldData: """ type_: NewFormFieldDataType - attributes: NewFormFieldDataAttributes + attributes: "NewFormFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_data_attributes.py b/rootly_sdk/models/new_form_field_data_attributes.py index b33f425d..04f0bbef 100644 --- a/rootly_sdk/models/new_form_field_data_attributes.py +++ b/rootly_sdk/models/new_form_field_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,62 +26,71 @@ class NewFormFieldDataAttributes: Attributes: kind (NewFormFieldDataAttributesKind): The kind of the form field name (str): The name of the form field - input_kind (NewFormFieldDataAttributesInputKind | Unset): The input kind of the form field - value_kind (NewFormFieldDataAttributesValueKind | Unset): The value kind of the form field - value_kind_catalog_id (None | str | Unset): The ID of the catalog used when value_kind is `catalog_entity` - description (None | str | Unset): The description of the form field - shown (list[str] | Unset): - required (list[str] | Unset): - show_on_incident_details (bool | Unset): Whether the form field is shown on the incident details panel - enabled (bool | Unset): Whether the form field is enabled - default_values (list[str] | Unset): - auto_set_by_catalog_property_id (None | str | Unset): Catalog property ID to auto-set this form field. Only + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + input_kind (Union[Unset, NewFormFieldDataAttributesInputKind]): The input kind of the form field + value_kind (Union[Unset, NewFormFieldDataAttributesValueKind]): The value kind of the form field + value_kind_catalog_id (Union[None, Unset, str]): The ID of the catalog used when value_kind is `catalog_entity` + description (Union[None, Unset, str]): The description of the form field + shown (Union[Unset, list[str]]): + required (Union[Unset, list[str]]): + show_on_incident_details (Union[Unset, bool]): Whether the form field is shown on the incident details panel + enabled (Union[Unset, bool]): Whether the form field is enabled + default_values (Union[Unset, list[str]]): + auto_set_by_catalog_property_id (Union[None, Unset, str]): Catalog property ID to auto-set this form field. Only reference-kind catalog properties are supported. """ kind: NewFormFieldDataAttributesKind name: str - input_kind: NewFormFieldDataAttributesInputKind | Unset = UNSET - value_kind: NewFormFieldDataAttributesValueKind | Unset = UNSET - value_kind_catalog_id: None | str | Unset = UNSET - description: None | str | Unset = UNSET - shown: list[str] | Unset = UNSET - required: list[str] | Unset = UNSET - show_on_incident_details: bool | Unset = UNSET - enabled: bool | Unset = UNSET - default_values: list[str] | Unset = UNSET - auto_set_by_catalog_property_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + input_kind: Unset | NewFormFieldDataAttributesInputKind = UNSET + value_kind: Unset | NewFormFieldDataAttributesValueKind = UNSET + value_kind_catalog_id: None | Unset | str = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[str] = UNSET + required: Unset | list[str] = UNSET + show_on_incident_details: Unset | bool = UNSET + enabled: Unset | bool = UNSET + default_values: Unset | list[str] = UNSET + auto_set_by_catalog_property_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind name = self.name - input_kind: str | Unset = UNSET + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + input_kind: Unset | str = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: str | Unset = UNSET + value_kind: Unset | str = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: None | str | Unset + value_kind_catalog_id: None | Unset | str if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: value_kind_catalog_id = self.value_kind_catalog_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: list[str] | Unset = UNSET + required: Unset | list[str] = UNSET if not isinstance(self.required, Unset): required = self.required @@ -91,11 +98,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: list[str] | Unset = UNSET + default_values: Unset | list[str] = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: None | str | Unset + auto_set_by_catalog_property_id: None | Unset | str if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -109,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if input_kind is not UNSET: field_dict["input_kind"] = input_kind if value_kind is not UNSET: @@ -139,35 +148,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _input_kind = d.pop("input_kind", UNSET) - input_kind: NewFormFieldDataAttributesInputKind | Unset + input_kind: Unset | NewFormFieldDataAttributesInputKind if isinstance(_input_kind, Unset): input_kind = UNSET else: input_kind = check_new_form_field_data_attributes_input_kind(_input_kind) _value_kind = d.pop("value_kind", UNSET) - value_kind: NewFormFieldDataAttributesValueKind | Unset + value_kind: Unset | NewFormFieldDataAttributesValueKind if isinstance(_value_kind, Unset): value_kind = UNSET else: value_kind = check_new_form_field_data_attributes_value_kind(_value_kind) - def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_value_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -181,12 +199,12 @@ def _parse_description(data: object) -> None | str | Unset: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) @@ -195,6 +213,7 @@ def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: new_form_field_data_attributes = cls( kind=kind, name=name, + slug=slug, input_kind=input_kind, value_kind=value_kind, value_kind_catalog_id=value_kind_catalog_id, diff --git a/rootly_sdk/models/new_form_field_option.py b/rootly_sdk/models/new_form_field_option.py index 250f489a..79703c57 100644 --- a/rootly_sdk/models/new_form_field_option.py +++ b/rootly_sdk/models/new_form_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldOption: data (NewFormFieldOptionData): """ - data: NewFormFieldOptionData + data: "NewFormFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_option_data.py b/rootly_sdk/models/new_form_field_option_data.py index 0cfabe8d..2f424967 100644 --- a/rootly_sdk/models/new_form_field_option_data.py +++ b/rootly_sdk/models/new_form_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFormFieldOptionData: """ type_: NewFormFieldOptionDataType - attributes: NewFormFieldOptionDataAttributes + attributes: "NewFormFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_option_data_attributes.py b/rootly_sdk/models/new_form_field_option_data_attributes.py index b9f918b7..0ea3b51f 100644 --- a/rootly_sdk/models/new_form_field_option_data_attributes.py +++ b/rootly_sdk/models/new_form_field_option_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,16 +14,16 @@ class NewFormFieldOptionDataAttributes: Attributes: form_field_id (str): The ID of the form field value (str): The value of the form field option - color (str | Unset): The hex color of the form field option - default (bool | Unset): - position (int | Unset): The position of the form field option + color (Union[Unset, str]): The hex color of the form field option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the form field option """ form_field_id: str value: str - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id diff --git a/rootly_sdk/models/new_form_field_placement.py b/rootly_sdk/models/new_form_field_placement.py index 0319e261..3f1a430c 100644 --- a/rootly_sdk/models/new_form_field_placement.py +++ b/rootly_sdk/models/new_form_field_placement.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldPlacement: data (NewFormFieldPlacementData): """ - data: NewFormFieldPlacementData + data: "NewFormFieldPlacementData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_placement_condition.py b/rootly_sdk/models/new_form_field_placement_condition.py index 622bd443..e70a15e2 100644 --- a/rootly_sdk/models/new_form_field_placement_condition.py +++ b/rootly_sdk/models/new_form_field_placement_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldPlacementCondition: data (NewFormFieldPlacementConditionData): """ - data: NewFormFieldPlacementConditionData + data: "NewFormFieldPlacementConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_placement_condition_data.py b/rootly_sdk/models/new_form_field_placement_condition_data.py index 5e26d9a4..eb94f22a 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormFieldPlacementConditionData: """ type_: NewFormFieldPlacementConditionDataType - attributes: NewFormFieldPlacementConditionDataAttributes + attributes: "NewFormFieldPlacementConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py index eef1987c..e99d57d1 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,14 +26,14 @@ class NewFormFieldPlacementConditionDataAttributes: form_field_id (str): The condition field. comparison (NewFormFieldPlacementConditionDataAttributesComparison): The condition comparison. values (list[str]): The values for comparison. - position (int | Unset): The condition position. + position (Union[Unset, int]): The condition position. """ conditioned: NewFormFieldPlacementConditionDataAttributesConditioned form_field_id: str comparison: NewFormFieldPlacementConditionDataAttributesComparison values: list[str] - position: int | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_form_field_placement_data.py b/rootly_sdk/models/new_form_field_placement_data.py index 878cd08d..44210baf 100644 --- a/rootly_sdk/models/new_form_field_placement_data.py +++ b/rootly_sdk/models/new_form_field_placement_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormFieldPlacementData: """ type_: NewFormFieldPlacementDataType - attributes: NewFormFieldPlacementDataAttributes + attributes: "NewFormFieldPlacementDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_placement_data_attributes.py b/rootly_sdk/models/new_form_field_placement_data_attributes.py index a424cde9..ae44a676 100644 --- a/rootly_sdk/models/new_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,24 +21,25 @@ class NewFormFieldPlacementDataAttributes: """ Attributes: - form_set_id (str): The form set this field is placed in. + form_set_id (str): The form set this field is placed in. The form set must have the same `resource_type` as the + form field, otherwise the request is rejected with 422. form (str): The form this field is placed on. - position (int | Unset): The position of the field placement. - required (bool | Unset): Whether the field is unconditionally required on this form. - required_operator (NewFormFieldPlacementDataAttributesRequiredOperator | Unset): Logical operator when + position (Union[Unset, int]): The position of the field placement. + required (Union[Unset, bool]): Whether the field is unconditionally required on this form. + required_operator (Union[Unset, NewFormFieldPlacementDataAttributesRequiredOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (NewFormFieldPlacementDataAttributesPlacementOperator | Unset): Logical operator when + placement_operator (Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=placement - non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. + non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ form_set_id: str form: str - position: int | Unset = UNSET - required: bool | Unset = UNSET - required_operator: NewFormFieldPlacementDataAttributesRequiredOperator | Unset = UNSET - placement_operator: NewFormFieldPlacementDataAttributesPlacementOperator | Unset = UNSET - non_editable: bool | Unset = UNSET + position: Unset | int = UNSET + required: Unset | bool = UNSET + required_operator: Unset | NewFormFieldPlacementDataAttributesRequiredOperator = UNSET + placement_operator: Unset | NewFormFieldPlacementDataAttributesPlacementOperator = UNSET + non_editable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,11 +51,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: str | Unset = UNSET + required_operator: Unset | str = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: str | Unset = UNSET + placement_operator: Unset | str = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -95,14 +94,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) _required_operator = d.pop("required_operator", UNSET) - required_operator: NewFormFieldPlacementDataAttributesRequiredOperator | Unset + required_operator: Unset | NewFormFieldPlacementDataAttributesRequiredOperator if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_new_form_field_placement_data_attributes_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: NewFormFieldPlacementDataAttributesPlacementOperator | Unset + placement_operator: Unset | NewFormFieldPlacementDataAttributesPlacementOperator if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/new_form_field_position.py b/rootly_sdk/models/new_form_field_position.py index 23be155c..c876c3a3 100644 --- a/rootly_sdk/models/new_form_field_position.py +++ b/rootly_sdk/models/new_form_field_position.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldPosition: data (NewFormFieldPositionData): """ - data: NewFormFieldPositionData + data: "NewFormFieldPositionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_position_data.py b/rootly_sdk/models/new_form_field_position_data.py index 29c52e99..24542508 100644 --- a/rootly_sdk/models/new_form_field_position_data.py +++ b/rootly_sdk/models/new_form_field_position_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormFieldPositionData: """ type_: NewFormFieldPositionDataType - attributes: NewFormFieldPositionDataAttributes + attributes: "NewFormFieldPositionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_position_data_attributes.py b/rootly_sdk/models/new_form_field_position_data_attributes.py index 8bbc0e05..d4037f7f 100644 --- a/rootly_sdk/models/new_form_field_position_data_attributes.py +++ b/rootly_sdk/models/new_form_field_position_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_form_field_position_data_attributes_form.py b/rootly_sdk/models/new_form_field_position_data_attributes_form.py index 7903b4c1..5b74b39c 100644 --- a/rootly_sdk/models/new_form_field_position_data_attributes_form.py +++ b/rootly_sdk/models/new_form_field_position_data_attributes_form.py @@ -8,6 +8,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -18,6 +19,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", ] @@ -30,6 +32,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -40,6 +43,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", } diff --git a/rootly_sdk/models/new_form_set.py b/rootly_sdk/models/new_form_set.py index e8de4c16..af5fe62b 100644 --- a/rootly_sdk/models/new_form_set.py +++ b/rootly_sdk/models/new_form_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormSet: data (NewFormSetData): """ - data: NewFormSetData + data: "NewFormSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_set_condition.py b/rootly_sdk/models/new_form_set_condition.py index 56277d51..1ca4d3cd 100644 --- a/rootly_sdk/models/new_form_set_condition.py +++ b/rootly_sdk/models/new_form_set_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormSetCondition: data (NewFormSetConditionData): """ - data: NewFormSetConditionData + data: "NewFormSetConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_set_condition_data.py b/rootly_sdk/models/new_form_set_condition_data.py index 7ddcc521..f5e62dc1 100644 --- a/rootly_sdk/models/new_form_set_condition_data.py +++ b/rootly_sdk/models/new_form_set_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormSetConditionData: """ type_: NewFormSetConditionDataType - attributes: NewFormSetConditionDataAttributes + attributes: "NewFormSetConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_set_condition_data_attributes.py b/rootly_sdk/models/new_form_set_condition_data_attributes.py index 072db657..50e8eb01 100644 --- a/rootly_sdk/models/new_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/new_form_set_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_form_set_data.py b/rootly_sdk/models/new_form_set_data.py index e6242641..5dd21340 100644 --- a/rootly_sdk/models/new_form_set_data.py +++ b/rootly_sdk/models/new_form_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFormSetData: """ type_: NewFormSetDataType - attributes: NewFormSetDataAttributes + attributes: "NewFormSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_set_data_attributes.py b/rootly_sdk/models/new_form_set_data_attributes.py index 8d930d67..6b8ce73d 100644 --- a/rootly_sdk/models/new_form_set_data_attributes.py +++ b/rootly_sdk/models/new_form_set_data_attributes.py @@ -1,10 +1,10 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define +from ..types import UNSET, Unset + T = TypeVar("T", bound="NewFormSetDataAttributes") @@ -19,17 +19,27 @@ class NewFormSetDataAttributes: `web_scheduled_incident_form`, `web_update_scheduled_incident_form`, `slack_new_incident_form`, `slack_update_incident_form`, `slack_update_incident_status_form`, `slack_incident_mitigation_form`, `slack_incident_resolution_form`, `slack_incident_cancellation_form`, `slack_scheduled_incident_form`, - `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form` + `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form`, + `microsoft_teams_new_incident_form` + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. """ name: str forms: list[str] + slug: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name forms = self.forms + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + field_dict: dict[str, Any] = {} field_dict.update( @@ -38,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: "forms": forms, } ) + if slug is not UNSET: + field_dict["slug"] = slug return field_dict @@ -48,9 +60,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: forms = cast(list[str], d.pop("forms")) + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + new_form_set_data_attributes = cls( name=name, forms=forms, + slug=slug, ) return new_form_set_data_attributes diff --git a/rootly_sdk/models/new_functionality.py b/rootly_sdk/models/new_functionality.py index 1338aa78..ab4c8a72 100644 --- a/rootly_sdk/models/new_functionality.py +++ b/rootly_sdk/models/new_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFunctionality: data (NewFunctionalityData): """ - data: NewFunctionalityData + data: "NewFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_functionality_data.py b/rootly_sdk/models/new_functionality_data.py index dd92c8a4..97c55928 100644 --- a/rootly_sdk/models/new_functionality_data.py +++ b/rootly_sdk/models/new_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFunctionalityData: """ type_: NewFunctionalityDataType - attributes: NewFunctionalityDataAttributes + attributes: "NewFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_functionality_data_attributes.py b/rootly_sdk/models/new_functionality_data_attributes.py index 8459211c..6afdde6a 100644 --- a/rootly_sdk/models/new_functionality_data_attributes.py +++ b/rootly_sdk/models/new_functionality_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -29,76 +27,84 @@ class NewFunctionalityDataAttributes: """ Attributes: name (str): The name of the functionality - description (None | str | Unset): The description of the functionality - public_description (None | str | Unset): The public description of the functionality - notify_emails (list[str] | None | Unset): Emails to attach to the functionality - color (None | str | Unset): The hex color of the functionality - position (int | None | Unset): Position of the functionality - backstage_id (None | str | Unset): The Backstage entity id associated to this functionality. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the functionality + public_description (Union[None, Unset, str]): The status page description of the functionality + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the functionality + color (Union[None, Unset, str]): The hex color of the functionality + position (Union[None, Unset, int]): Position of the functionality + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this functionality - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this functionality - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this functionality - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this functionality - cortex_id (None | str | Unset): The Cortex group id associated to this functionality - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this functionality - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (NewFunctionalityDataAttributesShowUptimeLastDays | Unset): Show uptime over x days + external_id (Union[None, Unset, str]): The external id associated to this functionality + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this functionality + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this functionality + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this functionality + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this functionality + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this functionality + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, NewFunctionalityDataAttributesShowUptimeLastDays]): Show uptime over x days Default: 60. - environment_ids (list[str] | None | Unset): Environments associated with this functionality - service_ids (list[str] | None | Unset): Services associated with this functionality - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this functionality - owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality - escalation_policy_id (None | str | Unset): The escalation policy id of the functionality - slack_channels (list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this functionality - slack_aliases (list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + environment_ids (Union[None, Unset, list[str]]): Environments associated with this functionality + service_ids (Union[None, Unset, list[str]]): Services associated with this functionality + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this functionality + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this functionality + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the functionality + slack_channels (Union[None, Unset, list['NewFunctionalityDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this functionality + slack_aliases (Union[None, Unset, list['NewFunctionalityDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this functionality - properties (list[NewFunctionalityDataAttributesPropertiesItem] | Unset): Array of property values for this - functionality. + properties (Union[Unset, list['NewFunctionalityDataAttributesPropertiesItem']]): Array of property values for + this functionality. """ name: str - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: NewFunctionalityDataAttributesShowUptimeLastDays | Unset = 60 - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[NewFunctionalityDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | NewFunctionalityDataAttributesShowUptimeLastDays = 60 + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["NewFunctionalityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -107,71 +113,71 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -180,7 +186,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -189,7 +195,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -198,7 +204,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -207,13 +213,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | str | Unset + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -225,7 +231,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -237,7 +243,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -251,6 +257,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if public_description is not UNSET: @@ -313,25 +321,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -342,104 +359,104 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: NewFunctionalityDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Unset | NewFunctionalityDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -447,7 +464,7 @@ def _parse_show_uptime(data: object) -> bool | None | Unset: _show_uptime_last_days ) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -458,13 +475,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -475,13 +492,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -492,13 +509,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -509,24 +526,24 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -544,15 +561,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -570,23 +587,22 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewFunctionalityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_functionality_data_attributes = cls( name=name, + slug=slug, description=description, public_description=public_description, notify_emails=notify_emails, diff --git a/rootly_sdk/models/new_functionality_data_attributes_properties_item.py b/rootly_sdk/models/new_functionality_data_attributes_properties_item.py index b3518fb5..a1cca45b 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py index ca6ead65..a304c3b3 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py index 2d997f77..608aa018 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_heartbeat.py b/rootly_sdk/models/new_heartbeat.py index 81b7f3aa..efd23daf 100644 --- a/rootly_sdk/models/new_heartbeat.py +++ b/rootly_sdk/models/new_heartbeat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewHeartbeat: data (NewHeartbeatData): """ - data: NewHeartbeatData + data: "NewHeartbeatData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_heartbeat_data.py b/rootly_sdk/models/new_heartbeat_data.py index 0cc6923b..14046489 100644 --- a/rootly_sdk/models/new_heartbeat_data.py +++ b/rootly_sdk/models/new_heartbeat_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewHeartbeatData: """ type_: NewHeartbeatDataType - attributes: NewHeartbeatDataAttributes + attributes: "NewHeartbeatDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_heartbeat_data_attributes.py b/rootly_sdk/models/new_heartbeat_data_attributes.py index d53146f8..628ddb7e 100644 --- a/rootly_sdk/models/new_heartbeat_data_attributes.py +++ b/rootly_sdk/models/new_heartbeat_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -29,11 +27,11 @@ class NewHeartbeatDataAttributes: notification_target_id (str): notification_target_type (NewHeartbeatDataAttributesNotificationTargetType): The type of the notification target. Please contact support if you encounter issues using `Functionality` as a target type. - description (None | str | Unset): The description of the heartbeat - alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires. - alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires. - owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat - enabled (bool | Unset): Whether to trigger alerts when heartbeat is expired. + description (Union[None, Unset, str]): The description of the heartbeat + alert_description (Union[None, Unset, str]): Description of alerts triggered when heartbeat expires. + alert_urgency_id (Union[None, Unset, str]): Urgency of alerts triggered when heartbeat expires. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that own this heartbeat + enabled (Union[Unset, bool]): Whether to trigger alerts when heartbeat is expired. """ name: str @@ -42,11 +40,11 @@ class NewHeartbeatDataAttributes: interval_unit: NewHeartbeatDataAttributesIntervalUnit notification_target_id: str notification_target_type: NewHeartbeatDataAttributesNotificationTargetType - description: None | str | Unset = UNSET - alert_description: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - enabled: bool | Unset = UNSET + description: None | Unset | str = UNSET + alert_description: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + enabled: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -61,25 +59,25 @@ def to_dict(self) -> dict[str, Any]: notification_target_type: str = self.notification_target_type - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: None | str | Unset + alert_description: None | Unset | str if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -127,30 +125,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("notification_target_type") ) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> None | str | Unset: + def _parse_alert_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) diff --git a/rootly_sdk/models/new_incident.py b/rootly_sdk/models/new_incident.py index 04757579..9be29c67 100644 --- a/rootly_sdk/models/new_incident.py +++ b/rootly_sdk/models/new_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncident: data (NewIncidentData): """ - data: NewIncidentData + data: "NewIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_action_item.py b/rootly_sdk/models/new_incident_action_item.py index 849b7b39..004ae495 100644 --- a/rootly_sdk/models/new_incident_action_item.py +++ b/rootly_sdk/models/new_incident_action_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentActionItem: data (NewIncidentActionItemData): """ - data: NewIncidentActionItemData + data: "NewIncidentActionItemData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_action_item_data.py b/rootly_sdk/models/new_incident_action_item_data.py index 7e266944..9ee79a63 100644 --- a/rootly_sdk/models/new_incident_action_item_data.py +++ b/rootly_sdk/models/new_incident_action_item_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentActionItemData: """ type_: NewIncidentActionItemDataType - attributes: NewIncidentActionItemDataAttributes + attributes: "NewIncidentActionItemDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes.py b/rootly_sdk/models/new_incident_action_item_data_attributes.py index 784b3739..9e4f798d 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -33,91 +31,92 @@ class NewIncidentActionItemDataAttributes: """ Attributes: summary (str): The summary of the action item - description (None | str | Unset): The description of the action item - kind (NewIncidentActionItemDataAttributesKind | Unset): The kind of the action item - assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item - assigned_to_group_ids (list[str] | Unset): IDs of groups you wish to assign this action item - priority (NewIncidentActionItemDataAttributesPriority | Unset): The priority of the action item - status (NewIncidentActionItemDataAttributesStatus | Unset): The status of the action item - due_date (None | str | Unset): The due date of the action item - jira_issue_id (None | str | Unset): The Jira issue ID. - jira_issue_key (None | str | Unset): The Jira issue key. - jira_issue_url (None | str | Unset): The Jira issue URL. - form_field_selections (list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset): - Custom field values to set on the action item. Ignored unless custom fields for action items are enabled for the - organization. + description (Union[None, Unset, str]): The description of the action item + kind (Union[Unset, NewIncidentActionItemDataAttributesKind]): The kind of the action item + assigned_to_user_id (Union[None, Unset, int]): ID of user you wish to assign this action item + assigned_to_group_ids (Union[Unset, list[str]]): IDs of groups you wish to assign this action item + priority (Union[Unset, NewIncidentActionItemDataAttributesPriority]): The priority of the action item + status (Union[Unset, NewIncidentActionItemDataAttributesStatus]): The status of the action item + due_date (Union[None, Unset, str]): The due date of the action item + jira_issue_id (Union[None, Unset, str]): The Jira issue ID. + jira_issue_key (Union[None, Unset, str]): The Jira issue key. + jira_issue_url (Union[None, Unset, str]): The Jira issue URL. + form_field_selections (Union[None, Unset, + list['NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item']]): Custom field values to set on the + action item. Ignored unless custom fields for action items are enabled for the organization. """ summary: str - description: None | str | Unset = UNSET - kind: NewIncidentActionItemDataAttributesKind | Unset = UNSET - assigned_to_user_id: int | None | Unset = UNSET - assigned_to_group_ids: list[str] | Unset = UNSET - priority: NewIncidentActionItemDataAttributesPriority | Unset = UNSET - status: NewIncidentActionItemDataAttributesStatus | Unset = UNSET - due_date: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - form_field_selections: list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset = UNSET + description: None | Unset | str = UNSET + kind: Unset | NewIncidentActionItemDataAttributesKind = UNSET + assigned_to_user_id: None | Unset | int = UNSET + assigned_to_group_ids: Unset | list[str] = UNSET + priority: Unset | NewIncidentActionItemDataAttributesPriority = UNSET + status: Unset | NewIncidentActionItemDataAttributesStatus = UNSET + due_date: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + form_field_selections: None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: - summary = self.summary - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: int | None | Unset + assigned_to_user_id: None | Unset | int if isinstance(self.assigned_to_user_id, Unset): assigned_to_user_id = UNSET else: assigned_to_user_id = self.assigned_to_user_id - assigned_to_group_ids: list[str] | Unset = UNSET + assigned_to_group_ids: Unset | list[str] = UNSET if not isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = self.assigned_to_group_ids - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | str | Unset + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | str | Unset + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | str | Unset + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | str | Unset + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: list[dict[str, Any]] | None | Unset + form_field_selections: None | Unset | list[dict[str, Any]] if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -170,86 +169,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewIncidentActionItemDataAttributesKind | Unset + kind: Unset | NewIncidentActionItemDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_action_item_data_attributes_kind(_kind) - def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + def _parse_assigned_to_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) assigned_to_group_ids = cast(list[str], d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: NewIncidentActionItemDataAttributesPriority | Unset + priority: Unset | NewIncidentActionItemDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: NewIncidentActionItemDataAttributesStatus | Unset + status: Unset | NewIncidentActionItemDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset: + ) -> None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -269,9 +268,9 @@ def _parse_form_field_selections( form_field_selections_type_0.append(form_field_selections_type_0_item) return form_field_selections_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"], data) form_field_selections = _parse_form_field_selections(d.pop("form_field_selections", UNSET)) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py b/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py index f8730f92..d7c28de8 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,41 +13,42 @@ class NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ Attributes: form_field_id (str): ID of the custom field - id (str | Unset): ID of an existing selection. Required when updating or removing a field's existing value. - value (list[str] | None | str | Unset): Value for text, textarea, rich text, date, datetime, number, checkbox, - or tag fields - selected_option_ids (list[str] | Unset): IDs of the selected custom field options - selected_user_ids (list[int] | Unset): IDs of the selected users - selected_group_ids (list[str] | Unset): IDs of the selected teams - selected_service_ids (list[str] | Unset): IDs of the selected services - selected_functionality_ids (list[str] | Unset): IDs of the selected functionalities - selected_catalog_entity_ids (list[str] | Unset): IDs of the selected catalog entities - selected_environment_ids (list[str] | Unset): IDs of the selected environments - selected_cause_ids (list[str] | Unset): IDs of the selected causes - selected_incident_type_ids (list[str] | Unset): IDs of the selected incident types - field_destroy (bool | None | Unset): Set to true to remove the field's value from the action item + id (Union[Unset, str]): ID of an existing selection. Required when updating or removing a field's existing + value. + value (Union[None, Unset, list[str], str]): Value for text, textarea, rich text, date, datetime, number, + checkbox, or tag fields + selected_option_ids (Union[Unset, list[str]]): IDs of the selected custom field options + selected_user_ids (Union[Unset, list[int]]): IDs of the selected users + selected_group_ids (Union[Unset, list[str]]): IDs of the selected teams + selected_service_ids (Union[Unset, list[str]]): IDs of the selected services + selected_functionality_ids (Union[Unset, list[str]]): IDs of the selected functionalities + selected_catalog_entity_ids (Union[Unset, list[str]]): IDs of the selected catalog entities + selected_environment_ids (Union[Unset, list[str]]): IDs of the selected environments + selected_cause_ids (Union[Unset, list[str]]): IDs of the selected causes + selected_incident_type_ids (Union[Unset, list[str]]): IDs of the selected incident types + field_destroy (Union[None, Unset, bool]): Set to true to remove the field's value from the action item """ form_field_id: str - id: str | Unset = UNSET - value: list[str] | None | str | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET - field_destroy: bool | None | Unset = UNSET + id: Unset | str = UNSET + value: None | Unset | list[str] | str = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET + field_destroy: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: list[str] | None | str | Unset + value: None | Unset | list[str] | str if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -58,43 +57,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: bool | None | Unset + field_destroy: None | Unset | bool if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -141,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> list[str] | None | str | Unset: + def _parse_value(data: object) -> None | Unset | list[str] | str: if data is None: return data if isinstance(data, Unset): @@ -152,9 +151,9 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: value_type_1 = cast(list[str], data) return value_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | str | Unset, data) + return cast(None | Unset | list[str] | str, data) value = _parse_value(d.pop("value", UNSET)) @@ -176,12 +175,12 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> bool | None | Unset: + def _parse_field_destroy(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/new_incident_custom_field_selection.py b/rootly_sdk/models/new_incident_custom_field_selection.py index 2b9c1ab1..ed0e7abc 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection.py +++ b/rootly_sdk/models/new_incident_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentCustomFieldSelection: data (NewIncidentCustomFieldSelectionData): """ - data: NewIncidentCustomFieldSelectionData + data: "NewIncidentCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_custom_field_selection_data.py b/rootly_sdk/models/new_incident_custom_field_selection_data.py index d5151e61..a59f3532 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewIncidentCustomFieldSelectionData: """ type_: NewIncidentCustomFieldSelectionDataType - attributes: NewIncidentCustomFieldSelectionDataAttributes + attributes: "NewIncidentCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py index 9d28b839..31f89ff4 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,13 +13,13 @@ class NewIncidentCustomFieldSelectionDataAttributes: """ Attributes: custom_field_id (int): The custom field for this selection - value (None | str): The selected value for text kind custom fields - selected_option_ids (list[int] | Unset): + value (Union[None, str]): The selected value for text kind custom fields + selected_option_ids (Union[Unset, list[int]]): """ custom_field_id: int value: None | str - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id @@ -29,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: value: None | str value = self.value - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids diff --git a/rootly_sdk/models/new_incident_data.py b/rootly_sdk/models/new_incident_data.py index 34e87501..ebe1a219 100644 --- a/rootly_sdk/models/new_incident_data.py +++ b/rootly_sdk/models/new_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentData: """ type_: NewIncidentDataType - attributes: NewIncidentDataAttributes + attributes: "NewIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_data_attributes.py b/rootly_sdk/models/new_incident_data_attributes.py index 8a795611..abb989bf 100644 --- a/rootly_sdk/models/new_incident_data_attributes.py +++ b/rootly_sdk/models/new_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,149 +24,149 @@ class NewIncidentDataAttributes: """ Attributes: - title (None | str | Unset): The title of the incident. We will autogenerate one if null - kind (NewIncidentDataAttributesKind | Unset): The kind of the incident Default: 'normal'. - parent_incident_id (None | str | Unset): ID of parent incident - duplicate_incident_id (None | str | Unset): ID of duplicated incident - private (bool | None | Unset): Create an incident as private. Once an incident is made as private it cannot be - undone Default: False. - summary (None | str | Unset): The summary of the incident - user_id (None | str | Unset): User ID of the creator of the incident. Default to the user attached to the Api - Key - severity_id (None | str | Unset): The Severity ID to attach to the incident - public_title (None | str | Unset): The public title of the incident - alert_ids (list[str] | None | Unset): The Alert IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident - muted_service_ids (list[str] | None | Unset): The Service IDs to mute alerts for during maintenance. Alerts for - these services will still be triggered and attached to the incident, but won't page responders. - labels (NewIncidentDataAttributesLabelsType0 | None | Unset): Labels to attach to the incidents. eg: + title (Union[None, Unset, str]): The title of the incident. We will autogenerate one if null + kind (Union[Unset, NewIncidentDataAttributesKind]): The kind of the incident Default: 'normal'. + parent_incident_id (Union[None, Unset, str]): ID of parent incident + duplicate_incident_id (Union[None, Unset, str]): ID of duplicated incident + private (Union[None, Unset, bool]): Create an incident as private. Once an incident is made as private it cannot + be undone Default: False. + summary (Union[None, Unset, str]): The summary of the incident + user_id (Union[None, Unset, str]): User ID of the creator of the incident. Default to the user attached to the + Api Key + severity_id (Union[None, Unset, str]): The Severity ID to attach to the incident + public_title (Union[None, Unset, str]): The public title of the incident + alert_ids (Union[None, Unset, list[str]]): The Alert IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident + muted_service_ids (Union[None, Unset, list[str]]): The Service IDs to mute alerts for during maintenance. Alerts + for these services will still be triggered and attached to the incident, but won't page responders. + labels (Union['NewIncidentDataAttributesLabelsType0', None, Unset]): Labels to attach to the incidents. eg: {"platform":"osx", "version": "1.29"} - slack_channel_name (None | str | Unset): Slack channel name - slack_channel_id (None | str | Unset): Slack channel id - slack_channel_url (None | str | Unset): Slack channel url - slack_channel_archived (bool | None | Unset): Whether the Slack channel is archived - google_drive_parent_id (None | str | Unset): Google Drive parent folder ID - google_drive_url (None | str | Unset): Google Drive URL - jira_issue_key (None | str | Unset): Jira issue key - jira_issue_id (None | str | Unset): Jira issue ID - jira_issue_url (None | str | Unset): Jira issue URL - notify_emails (list[str] | None | Unset): Emails you want to notify - status (NewIncidentDataAttributesStatus | Unset): The status of the incident - url (str | Unset): The url to the incident - scheduled_for (None | str | Unset): Date of when the maintenance begins - scheduled_until (None | str | Unset): Date of when the maintenance ends - in_triage_at (None | str | Unset): Date of triage - started_at (None | str | Unset): Date of start - detected_at (None | str | Unset): Date of detection - acknowledged_at (None | str | Unset): Date of acknowledgment - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - closed_at (None | str | Unset): Date of closure - cancelled_at (None | str | Unset): Date of cancellation + slack_channel_name (Union[None, Unset, str]): Slack channel name + slack_channel_id (Union[None, Unset, str]): Slack channel id + slack_channel_url (Union[None, Unset, str]): Slack channel url + slack_channel_archived (Union[None, Unset, bool]): Whether the Slack channel is archived + google_drive_parent_id (Union[None, Unset, str]): Google Drive parent folder ID + google_drive_url (Union[None, Unset, str]): Google Drive URL + jira_issue_key (Union[None, Unset, str]): Jira issue key + jira_issue_id (Union[None, Unset, str]): Jira issue ID + jira_issue_url (Union[None, Unset, str]): Jira issue URL + notify_emails (Union[None, Unset, list[str]]): Emails you want to notify + status (Union[Unset, NewIncidentDataAttributesStatus]): The status of the incident + url (Union[Unset, str]): The url to the incident + scheduled_for (Union[None, Unset, str]): Date of when the maintenance begins + scheduled_until (Union[None, Unset, str]): Date of when the maintenance ends + in_triage_at (Union[None, Unset, str]): Date of triage + started_at (Union[None, Unset, str]): Date of start + detected_at (Union[None, Unset, str]): Date of detection + acknowledged_at (Union[None, Unset, str]): Date of acknowledgment + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + closed_at (Union[None, Unset, str]): Date of closure + cancelled_at (Union[None, Unset, str]): Date of cancellation """ - title: None | str | Unset = UNSET - kind: NewIncidentDataAttributesKind | Unset = "normal" - parent_incident_id: None | str | Unset = UNSET - duplicate_incident_id: None | str | Unset = UNSET - private: bool | None | Unset = False - summary: None | str | Unset = UNSET - user_id: None | str | Unset = UNSET - severity_id: None | str | Unset = UNSET - public_title: None | str | Unset = UNSET - alert_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - cause_ids: list[str] | None | Unset = UNSET - muted_service_ids: list[str] | None | Unset = UNSET - labels: NewIncidentDataAttributesLabelsType0 | None | Unset = UNSET - slack_channel_name: None | str | Unset = UNSET - slack_channel_id: None | str | Unset = UNSET - slack_channel_url: None | str | Unset = UNSET - slack_channel_archived: bool | None | Unset = UNSET - google_drive_parent_id: None | str | Unset = UNSET - google_drive_url: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - status: NewIncidentDataAttributesStatus | Unset = UNSET - url: str | Unset = UNSET - scheduled_for: None | str | Unset = UNSET - scheduled_until: None | str | Unset = UNSET - in_triage_at: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - closed_at: None | str | Unset = UNSET - cancelled_at: None | str | Unset = UNSET + title: None | Unset | str = UNSET + kind: Unset | NewIncidentDataAttributesKind = "normal" + parent_incident_id: None | Unset | str = UNSET + duplicate_incident_id: None | Unset | str = UNSET + private: None | Unset | bool = False + summary: None | Unset | str = UNSET + user_id: None | Unset | str = UNSET + severity_id: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + alert_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + cause_ids: None | Unset | list[str] = UNSET + muted_service_ids: None | Unset | list[str] = UNSET + labels: Union["NewIncidentDataAttributesLabelsType0", None, Unset] = UNSET + slack_channel_name: None | Unset | str = UNSET + slack_channel_id: None | Unset | str = UNSET + slack_channel_url: None | Unset | str = UNSET + slack_channel_archived: None | Unset | bool = UNSET + google_drive_parent_id: None | Unset | str = UNSET + google_drive_url: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + status: Unset | NewIncidentDataAttributesStatus = UNSET + url: Unset | str = UNSET + scheduled_for: None | Unset | str = UNSET + scheduled_until: None | Unset | str = UNSET + in_triage_at: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + closed_at: None | Unset | str = UNSET + cancelled_at: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_incident_data_attributes_labels_type_0 import NewIncidentDataAttributesLabelsType0 - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: None | str | Unset + parent_incident_id: None | Unset | str if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | str | Unset + duplicate_incident_id: None | Unset | str if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - private: bool | None | Unset + private: None | Unset | bool if isinstance(self.private, Unset): private = UNSET else: private = self.private - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - user_id: None | str | Unset + user_id: None | Unset | str if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - severity_id: None | str | Unset + severity_id: None | Unset | str if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: None | str | Unset + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: list[str] | None | Unset + alert_ids: None | Unset | list[str] if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -177,7 +175,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -186,7 +184,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -195,7 +193,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -204,7 +202,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -213,7 +211,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -222,7 +220,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: list[str] | None | Unset + cause_ids: None | Unset | list[str] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -231,7 +229,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - muted_service_ids: list[str] | None | Unset + muted_service_ids: None | Unset | list[str] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -240,7 +238,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - labels: dict[str, Any] | None | Unset + labels: None | Unset | dict[str, Any] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, NewIncidentDataAttributesLabelsType0): @@ -248,61 +246,61 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_name: None | str | Unset + slack_channel_name: None | Unset | str if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_id: None | str | Unset + slack_channel_id: None | Unset | str if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_url: None | str | Unset + slack_channel_url: None | Unset | str if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: bool | None | Unset + slack_channel_archived: None | Unset | bool if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: None | str | Unset + google_drive_parent_id: None | Unset | str if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: None | str | Unset + google_drive_url: None | Unset | str if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: None | str | Unset + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | str | Unset + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | str | Unset + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -311,67 +309,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status url = self.url - scheduled_for: None | str | Unset + scheduled_for: None | Unset | str if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | str | Unset + scheduled_until: None | Unset | str if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: None | str | Unset + in_triage_at: None | Unset | str if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | str | Unset + closed_at: None | Unset | str if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | str | Unset + cancelled_at: None | Unset | str if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -469,86 +467,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewIncidentDataAttributesKind | Unset + kind: Unset | NewIncidentDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> None | str | Unset: + def _parse_parent_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | str | Unset: + def _parse_duplicate_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_private(data: object) -> bool | None | Unset: + def _parse_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) private = _parse_private(d.pop("private", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_user_id(data: object) -> None | str | Unset: + def _parse_user_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_severity_id(data: object) -> None | str | Unset: + def _parse_severity_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -559,13 +557,13 @@ def _parse_alert_ids(data: object) -> list[str] | None | Unset: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -576,13 +574,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -593,13 +591,13 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -610,13 +608,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -627,13 +625,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -644,13 +642,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> list[str] | None | Unset: + def _parse_cause_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -661,13 +659,13 @@ def _parse_cause_ids(data: object) -> list[str] | None | Unset: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: + def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -678,13 +676,13 @@ def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_labels(data: object) -> NewIncidentDataAttributesLabelsType0 | None | Unset: + def _parse_labels(data: object) -> Union["NewIncidentDataAttributesLabelsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -695,94 +693,94 @@ def _parse_labels(data: object) -> NewIncidentDataAttributesLabelsType0 | None | labels_type_0 = NewIncidentDataAttributesLabelsType0.from_dict(data) return labels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewIncidentDataAttributesLabelsType0 | None | Unset, data) + return cast(Union["NewIncidentDataAttributesLabelsType0", None, Unset], data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_name(data: object) -> None | str | Unset: + def _parse_slack_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_id(data: object) -> None | str | Unset: + def _parse_slack_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_url(data: object) -> None | str | Unset: + def _parse_slack_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> bool | None | Unset: + def _parse_slack_channel_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | str | Unset: + def _parse_google_drive_parent_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> None | str | Unset: + def _parse_google_drive_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -793,14 +791,14 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) _status = d.pop("status", UNSET) - status: NewIncidentDataAttributesStatus | Unset + status: Unset | NewIncidentDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: @@ -808,93 +806,93 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: url = d.pop("url", UNSET) - def _parse_scheduled_for(data: object) -> None | str | Unset: + def _parse_scheduled_for(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | str | Unset: + def _parse_scheduled_until(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> None | str | Unset: + def _parse_in_triage_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | str | Unset: + def _parse_closed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | str | Unset: + def _parse_cancelled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) diff --git a/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py b/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py index 5e4e81b3..538c971f 100644 --- a/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py +++ b/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewIncidentDataAttributesLabelsType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_incident_event.py b/rootly_sdk/models/new_incident_event.py index 423b6167..86de32cc 100644 --- a/rootly_sdk/models/new_incident_event.py +++ b/rootly_sdk/models/new_incident_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentEvent: data (NewIncidentEventData): """ - data: NewIncidentEventData + data: "NewIncidentEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_event_data.py b/rootly_sdk/models/new_incident_event_data.py index 3c9d261d..6304f06d 100644 --- a/rootly_sdk/models/new_incident_event_data.py +++ b/rootly_sdk/models/new_incident_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentEventData: """ type_: NewIncidentEventDataType - attributes: NewIncidentEventDataAttributes + attributes: "NewIncidentEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_event_data_attributes.py b/rootly_sdk/models/new_incident_event_data_attributes.py index c7702049..1255db60 100644 --- a/rootly_sdk/models/new_incident_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,16 +17,16 @@ class NewIncidentEventDataAttributes: """ Attributes: event (str): The summary of the incident event - visibility (NewIncidentEventDataAttributesVisibility | Unset): The visibility of the incident action item + visibility (Union[Unset, NewIncidentEventDataAttributesVisibility]): The visibility of the incident action item """ event: str - visibility: NewIncidentEventDataAttributesVisibility | Unset = UNSET + visibility: Unset | NewIncidentEventDataAttributesVisibility = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: str | Unset = UNSET + visibility: Unset | str = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _visibility = d.pop("visibility", UNSET) - visibility: NewIncidentEventDataAttributesVisibility | Unset + visibility: Unset | NewIncidentEventDataAttributesVisibility if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/new_incident_event_functionality.py b/rootly_sdk/models/new_incident_event_functionality.py index 6d66318c..14bfcce4 100644 --- a/rootly_sdk/models/new_incident_event_functionality.py +++ b/rootly_sdk/models/new_incident_event_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentEventFunctionality: data (NewIncidentEventFunctionalityData): """ - data: NewIncidentEventFunctionalityData + data: "NewIncidentEventFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_event_functionality_data.py b/rootly_sdk/models/new_incident_event_functionality_data.py index 3f7e2f4d..16c96a63 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data.py +++ b/rootly_sdk/models/new_incident_event_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentEventFunctionalityData: """ type_: NewIncidentEventFunctionalityDataType - attributes: NewIncidentEventFunctionalityDataAttributes + attributes: "NewIncidentEventFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_event_functionality_data_attributes.py b/rootly_sdk/models/new_incident_event_functionality_data_attributes.py index e14b6383..26cb7912 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_functionality_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_event_service.py b/rootly_sdk/models/new_incident_event_service.py index 95f67979..97f4925c 100644 --- a/rootly_sdk/models/new_incident_event_service.py +++ b/rootly_sdk/models/new_incident_event_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentEventService: data (NewIncidentEventServiceData): """ - data: NewIncidentEventServiceData + data: "NewIncidentEventServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_event_service_data.py b/rootly_sdk/models/new_incident_event_service_data.py index 72500c26..71e69bfd 100644 --- a/rootly_sdk/models/new_incident_event_service_data.py +++ b/rootly_sdk/models/new_incident_event_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentEventServiceData: """ type_: NewIncidentEventServiceDataType - attributes: NewIncidentEventServiceDataAttributes + attributes: "NewIncidentEventServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_event_service_data_attributes.py b/rootly_sdk/models/new_incident_event_service_data_attributes.py index 8e2c72b4..7e6413f0 100644 --- a/rootly_sdk/models/new_incident_event_service_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_service_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_feedback.py b/rootly_sdk/models/new_incident_feedback.py index d1a89314..93f6dcb0 100644 --- a/rootly_sdk/models/new_incident_feedback.py +++ b/rootly_sdk/models/new_incident_feedback.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentFeedback: data (NewIncidentFeedbackData): """ - data: NewIncidentFeedbackData + data: "NewIncidentFeedbackData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_feedback_data.py b/rootly_sdk/models/new_incident_feedback_data.py index dbc9e5fe..dfb54c06 100644 --- a/rootly_sdk/models/new_incident_feedback_data.py +++ b/rootly_sdk/models/new_incident_feedback_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentFeedbackData: """ type_: NewIncidentFeedbackDataType - attributes: NewIncidentFeedbackDataAttributes + attributes: "NewIncidentFeedbackDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_feedback_data_attributes.py b/rootly_sdk/models/new_incident_feedback_data_attributes.py index 0f7b6fec..eea1850a 100644 --- a/rootly_sdk/models/new_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/new_incident_feedback_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,12 +18,12 @@ class NewIncidentFeedbackDataAttributes: Attributes: feedback (str): The feedback of the incident feedback rating (NewIncidentFeedbackDataAttributesRating): The rating of the incident feedback - anonymous (bool | Unset): Is the feedback anonymous? + anonymous (Union[Unset, bool]): Is the feedback anonymous? """ feedback: str rating: NewIncidentFeedbackDataAttributesRating - anonymous: bool | Unset = UNSET + anonymous: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback diff --git a/rootly_sdk/models/new_incident_form_field_selection.py b/rootly_sdk/models/new_incident_form_field_selection.py index 6510663e..c3af5a5d 100644 --- a/rootly_sdk/models/new_incident_form_field_selection.py +++ b/rootly_sdk/models/new_incident_form_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentFormFieldSelection: data (NewIncidentFormFieldSelectionData): """ - data: NewIncidentFormFieldSelectionData + data: "NewIncidentFormFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_form_field_selection_data.py b/rootly_sdk/models/new_incident_form_field_selection_data.py index afba8396..5468b67e 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentFormFieldSelectionData: """ type_: NewIncidentFormFieldSelectionDataType - attributes: NewIncidentFormFieldSelectionDataAttributes + attributes: "NewIncidentFormFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py index 10a4cf9e..5eb356f5 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,75 +14,75 @@ class NewIncidentFormFieldSelectionDataAttributes: Attributes: incident_id (str): form_field_id (str): The custom field for this selection - value (None | str | Unset): The selected value for text kind custom fields - selected_catalog_entity_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_environment_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ incident_id: str form_field_id: str - value: None | str | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id form_field_id = self.form_field_id - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -126,12 +124,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id") - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set.py b/rootly_sdk/models/new_incident_permission_set.py index ea88d5ab..a6e79085 100644 --- a/rootly_sdk/models/new_incident_permission_set.py +++ b/rootly_sdk/models/new_incident_permission_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentPermissionSet: data (NewIncidentPermissionSetData): """ - data: NewIncidentPermissionSetData + data: "NewIncidentPermissionSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_permission_set_boolean.py b/rootly_sdk/models/new_incident_permission_set_boolean.py index 7fabf216..5cb940b0 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentPermissionSetBoolean: data (NewIncidentPermissionSetBooleanData): """ - data: NewIncidentPermissionSetBooleanData + data: "NewIncidentPermissionSetBooleanData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data.py b/rootly_sdk/models/new_incident_permission_set_boolean_data.py index f522dff8..616b4b97 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewIncidentPermissionSetBooleanData: """ type_: NewIncidentPermissionSetBooleanDataType - attributes: NewIncidentPermissionSetBooleanDataAttributes + attributes: "NewIncidentPermissionSetBooleanDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py index 6b11f358..ae802724 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -26,19 +24,18 @@ class NewIncidentPermissionSetBooleanDataAttributes: Attributes: incident_permission_set_id (str): kind (NewIncidentPermissionSetBooleanDataAttributesKind): - private (bool | Unset): - enabled (bool | Unset): - severity_params (NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset): + private (Union[Unset, bool]): + enabled (Union[Unset, bool]): + severity_params (Union[Unset, NewIncidentPermissionSetBooleanDataAttributesSeverityParams]): """ incident_permission_set_id: str kind: NewIncidentPermissionSetBooleanDataAttributesKind - private: bool | Unset = UNSET - enabled: bool | Unset = UNSET - severity_params: NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset = UNSET + private: Unset | bool = UNSET + enabled: Unset | bool = UNSET + severity_params: Union[Unset, "NewIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - incident_permission_set_id = self.incident_permission_set_id kind: str = self.kind @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -84,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset + severity_params: Unset | NewIncidentPermissionSetBooleanDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py index 8785fea3..fd4c5616 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,18 +13,18 @@ class NewIncidentPermissionSetBooleanDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - create_enabled: bool | Unset = False - applies_to_unassigned: bool | Unset = True - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Unset | bool = True + create_enabled: Unset | bool = False + applies_to_unassigned: Unset | bool = True + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set_data.py b/rootly_sdk/models/new_incident_permission_set_data.py index fb6362a2..a4a36ed2 100644 --- a/rootly_sdk/models/new_incident_permission_set_data.py +++ b/rootly_sdk/models/new_incident_permission_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentPermissionSetData: """ type_: NewIncidentPermissionSetDataType - attributes: NewIncidentPermissionSetDataAttributes + attributes: "NewIncidentPermissionSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_permission_set_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_data_attributes.py index 6da0aeb4..dc5020e0 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,38 +21,48 @@ class NewIncidentPermissionSetDataAttributes: """ Attributes: name (str): The incident permission set name. - description (None | str | Unset): The incident permission set description. - private_incident_permissions (list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | - Unset): - public_incident_permissions (list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The incident permission set description. + private_incident_permissions (Union[Unset, + list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem]]): + public_incident_permissions (Union[Unset, + list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem]]): """ name: str - description: None | str | Unset = UNSET - private_incident_permissions: list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset = ( + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + private_incident_permissions: Unset | list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] = ( UNSET ) - public_incident_permissions: list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset = ( + public_incident_permissions: Unset | list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] = ( UNSET ) def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: list[str] | Unset = UNSET + private_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: list[str] | Unset = UNSET + public_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -68,6 +76,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if private_incident_permissions is not UNSET: @@ -82,47 +92,49 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - private_incident_permissions: ( - list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset - ) = UNSET - if _private_incident_permissions is not UNSET: - private_incident_permissions = [] - for private_incident_permissions_item_data in _private_incident_permissions: - private_incident_permissions_item = ( - check_new_incident_permission_set_data_attributes_private_incident_permissions_item( - private_incident_permissions_item_data - ) + for private_incident_permissions_item_data in _private_incident_permissions or []: + private_incident_permissions_item = ( + check_new_incident_permission_set_data_attributes_private_incident_permissions_item( + private_incident_permissions_item_data ) + ) - private_incident_permissions.append(private_incident_permissions_item) + private_incident_permissions.append(private_incident_permissions_item) + public_incident_permissions = [] _public_incident_permissions = d.pop("public_incident_permissions", UNSET) - public_incident_permissions: ( - list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset - ) = UNSET - if _public_incident_permissions is not UNSET: - public_incident_permissions = [] - for public_incident_permissions_item_data in _public_incident_permissions: - public_incident_permissions_item = ( - check_new_incident_permission_set_data_attributes_public_incident_permissions_item( - public_incident_permissions_item_data - ) + for public_incident_permissions_item_data in _public_incident_permissions or []: + public_incident_permissions_item = ( + check_new_incident_permission_set_data_attributes_public_incident_permissions_item( + public_incident_permissions_item_data ) + ) - public_incident_permissions.append(public_incident_permissions_item) + public_incident_permissions.append(public_incident_permissions_item) new_incident_permission_set_data_attributes = cls( name=name, + slug=slug, description=description, private_incident_permissions=private_incident_permissions, public_incident_permissions=public_incident_permissions, diff --git a/rootly_sdk/models/new_incident_permission_set_resource.py b/rootly_sdk/models/new_incident_permission_set_resource.py index 409075ea..df9037a6 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource.py +++ b/rootly_sdk/models/new_incident_permission_set_resource.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentPermissionSetResource: data (NewIncidentPermissionSetResourceData): """ - data: NewIncidentPermissionSetResourceData + data: "NewIncidentPermissionSetResourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data.py b/rootly_sdk/models/new_incident_permission_set_resource_data.py index 6e0dc6ca..e42e991f 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewIncidentPermissionSetResourceData: """ type_: NewIncidentPermissionSetResourceDataType - attributes: NewIncidentPermissionSetResourceDataAttributes + attributes: "NewIncidentPermissionSetResourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py index 4ed0a0bf..e195b196 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -26,21 +24,20 @@ class NewIncidentPermissionSetResourceDataAttributes: Attributes: incident_permission_set_id (str): kind (NewIncidentPermissionSetResourceDataAttributesKind): - private (bool | Unset): - resource_id (str | Unset): - resource_type (str | Unset): - severity_params (NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset): + private (Union[Unset, bool]): + resource_id (Union[Unset, str]): + resource_type (Union[Unset, str]): + severity_params (Union[Unset, NewIncidentPermissionSetResourceDataAttributesSeverityParams]): """ incident_permission_set_id: str kind: NewIncidentPermissionSetResourceDataAttributesKind - private: bool | Unset = UNSET - resource_id: str | Unset = UNSET - resource_type: str | Unset = UNSET - severity_params: NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset = UNSET + private: Unset | bool = UNSET + resource_id: Unset | str = UNSET + resource_type: Unset | str = UNSET + severity_params: Union[Unset, "NewIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - incident_permission_set_id = self.incident_permission_set_id kind: str = self.kind @@ -51,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -92,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource_type = d.pop("resource_type", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset + severity_params: Unset | NewIncidentPermissionSetResourceDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py index c5db1e9f..e610b5e1 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,18 +13,18 @@ class NewIncidentPermissionSetResourceDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - create_enabled: bool | Unset = False - applies_to_unassigned: bool | Unset = True - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Unset | bool = True + create_enabled: Unset | bool = False + applies_to_unassigned: Unset | bool = True + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/new_incident_role.py b/rootly_sdk/models/new_incident_role.py index 0904e87b..6638789a 100644 --- a/rootly_sdk/models/new_incident_role.py +++ b/rootly_sdk/models/new_incident_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentRole: data (NewIncidentRoleData): """ - data: NewIncidentRoleData + data: "NewIncidentRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_role_data.py b/rootly_sdk/models/new_incident_role_data.py index 1611d57e..b7be2d03 100644 --- a/rootly_sdk/models/new_incident_role_data.py +++ b/rootly_sdk/models/new_incident_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentRoleData: """ type_: NewIncidentRoleDataType - attributes: NewIncidentRoleDataAttributes + attributes: "NewIncidentRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_role_data_attributes.py b/rootly_sdk/models/new_incident_role_data_attributes.py index bdf3cc53..b9d3caf1 100644 --- a/rootly_sdk/models/new_incident_role_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,38 +13,47 @@ class NewIncidentRoleDataAttributes: """ Attributes: name (str): The name of the incident role - summary (None | str | Unset): The summary of the incident role - description (None | str | Unset): The description of the incident role - position (int | None | Unset): Position of the incident role - optional (bool | Unset): - enabled (bool | Unset): - allow_multi_user_assignment (bool | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + summary (Union[None, Unset, str]): The summary of the incident role + description (Union[None, Unset, str]): The description of the incident role + position (Union[None, Unset, int]): Position of the incident role + optional (Union[Unset, bool]): + enabled (Union[Unset, bool]): + allow_multi_user_assignment (Union[Unset, bool]): """ name: str - summary: None | str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - optional: bool | Unset = UNSET - enabled: bool | Unset = UNSET - allow_multi_user_assignment: bool | Unset = UNSET + slug: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + optional: Unset | bool = UNSET + enabled: Unset | bool = UNSET + allow_multi_user_assignment: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - summary: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -65,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if summary is not UNSET: field_dict["summary"] = summary if description is not UNSET: @@ -85,30 +94,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_summary(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) @@ -120,6 +138,7 @@ def _parse_position(data: object) -> int | None | Unset: new_incident_role_data_attributes = cls( name=name, + slug=slug, summary=summary, description=description, position=position, diff --git a/rootly_sdk/models/new_incident_role_task.py b/rootly_sdk/models/new_incident_role_task.py index b5513090..b9c26306 100644 --- a/rootly_sdk/models/new_incident_role_task.py +++ b/rootly_sdk/models/new_incident_role_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentRoleTask: data (NewIncidentRoleTaskData): """ - data: NewIncidentRoleTaskData + data: "NewIncidentRoleTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_role_task_data.py b/rootly_sdk/models/new_incident_role_task_data.py index 35bda731..47f96898 100644 --- a/rootly_sdk/models/new_incident_role_task_data.py +++ b/rootly_sdk/models/new_incident_role_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentRoleTaskData: """ type_: NewIncidentRoleTaskDataType - attributes: NewIncidentRoleTaskDataAttributes + attributes: "NewIncidentRoleTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_role_task_data_attributes.py b/rootly_sdk/models/new_incident_role_task_data_attributes.py index 9de0da86..02f7f4c8 100644 --- a/rootly_sdk/models/new_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_task_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,28 +17,28 @@ class NewIncidentRoleTaskDataAttributes: """ Attributes: task (str): The task of the incident task - incident_role_id (str | Unset): - description (None | str | Unset): The description of the incident task - priority (NewIncidentRoleTaskDataAttributesPriority | Unset): The priority of the incident task + incident_role_id (Union[Unset, str]): + description (Union[None, Unset, str]): The description of the incident task + priority (Union[Unset, NewIncidentRoleTaskDataAttributesPriority]): The priority of the incident task """ task: str - incident_role_id: str | Unset = UNSET - description: None | str | Unset = UNSET - priority: NewIncidentRoleTaskDataAttributesPriority | Unset = UNSET + incident_role_id: Unset | str = UNSET + description: None | Unset | str = UNSET + priority: Unset | NewIncidentRoleTaskDataAttributesPriority = UNSET def to_dict(self) -> dict[str, Any]: task = self.task incident_role_id = self.incident_role_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -67,17 +65,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: NewIncidentRoleTaskDataAttributesPriority | Unset + priority: Unset | NewIncidentRoleTaskDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/new_incident_status_page_event.py b/rootly_sdk/models/new_incident_status_page_event.py index 87aec609..084ae8e3 100644 --- a/rootly_sdk/models/new_incident_status_page_event.py +++ b/rootly_sdk/models/new_incident_status_page_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentStatusPageEvent: data (NewIncidentStatusPageEventData): """ - data: NewIncidentStatusPageEventData + data: "NewIncidentStatusPageEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_status_page_event_data.py b/rootly_sdk/models/new_incident_status_page_event_data.py index 14e5a75a..2eb740df 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data.py +++ b/rootly_sdk/models/new_incident_status_page_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentStatusPageEventData: """ type_: NewIncidentStatusPageEventDataType - attributes: NewIncidentStatusPageEventDataAttributes + attributes: "NewIncidentStatusPageEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py index 528e5f80..064c28c0 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -13,6 +11,12 @@ ) from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.new_incident_status_page_event_data_attributes_status_page_components_type_0_item import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item, + ) + + T = TypeVar("T", bound="NewIncidentStatusPageEventDataAttributes") @@ -21,43 +25,51 @@ class NewIncidentStatusPageEventDataAttributes: """ Attributes: event (str): The summary of the incident event - status_page_id (str | Unset): Unique ID of the status page you wish to post the event to - status (NewIncidentStatusPageEventDataAttributesStatus | Unset): The status of the incident event - notify_subscribers (bool | None | Unset): Notify all status pages subscribers Default: False. - should_tweet (bool | None | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update - Default: False. - started_at (datetime.datetime | None | Unset): When the event started. Defaults to the time of creation. + status_page_id (Union[Unset, str]): Unique ID of the status page you wish to post the event to + status (Union[Unset, NewIncidentStatusPageEventDataAttributesStatus]): The status of the incident event + notify_subscribers (Union[None, Unset, bool]): Notify all status pages subscribers Default: False. + should_tweet (Union[None, Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your + update Default: False. + started_at (Union[None, Unset, datetime.datetime]): When the event started. Defaults to the time of creation. + status_page_components (Union[None, Unset, + list['NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item']]): Affected status page components + and their statuses. Requires the status-page-v3-phase-1 feature. Ignored for terminal event statuses (resolved, + completed), which clear component impact. A status is required per component except for scheduled maintenance + incidents. """ event: str - status_page_id: str | Unset = UNSET - status: NewIncidentStatusPageEventDataAttributesStatus | Unset = UNSET - notify_subscribers: bool | None | Unset = False - should_tweet: bool | None | Unset = False - started_at: datetime.datetime | None | Unset = UNSET + status_page_id: Unset | str = UNSET + status: Unset | NewIncidentStatusPageEventDataAttributesStatus = UNSET + notify_subscribers: None | Unset | bool = False + should_tweet: None | Unset | bool = False + started_at: None | Unset | datetime.datetime = UNSET + status_page_components: ( + None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: bool | None | Unset + notify_subscribers: None | Unset | bool if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: bool | None | Unset + should_tweet: None | Unset | bool if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -65,6 +77,18 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at + status_page_components: None | Unset | list[dict[str, Any]] + if isinstance(self.status_page_components, Unset): + status_page_components = UNSET + elif isinstance(self.status_page_components, list): + status_page_components = [] + for status_page_components_type_0_item_data in self.status_page_components: + status_page_components_type_0_item = status_page_components_type_0_item_data.to_dict() + status_page_components.append(status_page_components_type_0_item) + + else: + status_page_components = self.status_page_components + field_dict: dict[str, Any] = {} field_dict.update( @@ -82,42 +106,48 @@ def to_dict(self) -> dict[str, Any]: field_dict["should_tweet"] = should_tweet if started_at is not UNSET: field_dict["started_at"] = started_at + if status_page_components is not UNSET: + field_dict["status_page_components"] = status_page_components return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_incident_status_page_event_data_attributes_status_page_components_type_0_item import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item, + ) + d = dict(src_dict) event = d.pop("event") status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: NewIncidentStatusPageEventDataAttributesStatus | Unset + status: Unset | NewIncidentStatusPageEventDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> bool | None | Unset: + def _parse_should_tweet(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -128,12 +158,42 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) + def _parse_status_page_components( + data: object, + ) -> None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + status_page_components_type_0 = [] + _status_page_components_type_0 = data + for status_page_components_type_0_item_data in _status_page_components_type_0: + status_page_components_type_0_item = ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item.from_dict( + status_page_components_type_0_item_data + ) + ) + + status_page_components_type_0.append(status_page_components_type_0_item) + + return status_page_components_type_0 + except: # noqa: E722 + pass + return cast( + None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"], data + ) + + status_page_components = _parse_status_page_components(d.pop("status_page_components", UNSET)) + new_incident_status_page_event_data_attributes = cls( event=event, status_page_id=status_page_id, @@ -141,6 +201,7 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: notify_subscribers=notify_subscribers, should_tweet=should_tweet, started_at=started_at, + status_page_components=status_page_components, ) return new_incident_status_page_event_data_attributes diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py new file mode 100644 index 00000000..61be84a5 --- /dev/null +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus, + check_new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item") + + +@_attrs_define +class NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item: + """ + Attributes: + status_page_component_id (str): Unique ID of a component on the event's status page + status (Union[Unset, NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus]): The status + to record for the component + """ + + status_page_component_id: str + status: Unset | NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus = UNSET + + def to_dict(self) -> dict[str, Any]: + status_page_component_id = self.status_page_component_id + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "status_page_component_id": status_page_component_id, + } + ) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_component_id = d.pop("status_page_component_id") + + _status = d.pop("status", UNSET) + status: Unset | NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = check_new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status( + _status + ) + + new_incident_status_page_event_data_attributes_status_page_components_type_0_item = cls( + status_page_component_id=status_page_component_id, + status=status, + ) + + return new_incident_status_page_event_data_attributes_status_page_components_type_0_item diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py new file mode 100644 index 00000000..041e8b02 --- /dev/null +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py @@ -0,0 +1,26 @@ +from typing import Literal, cast + +NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus = Literal[ + "degraded_performance", "major_outage", "operational", "partial_outage" +] + +NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_PAGE_COMPONENTS_TYPE_0_ITEM_STATUS_VALUES: set[ + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus +] = { + "degraded_performance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status( + value: str | None, +) -> NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus | None: + if value is None: + return None + if value in NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_PAGE_COMPONENTS_TYPE_0_ITEM_STATUS_VALUES: + return cast(NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_PAGE_COMPONENTS_TYPE_0_ITEM_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_incident_sub_status.py b/rootly_sdk/models/new_incident_sub_status.py index 6514f78e..8a1dd81b 100644 --- a/rootly_sdk/models/new_incident_sub_status.py +++ b/rootly_sdk/models/new_incident_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentSubStatus: data (NewIncidentSubStatusData): """ - data: NewIncidentSubStatusData + data: "NewIncidentSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_sub_status_data.py b/rootly_sdk/models/new_incident_sub_status_data.py index 6124b0a8..7d41ff0f 100644 --- a/rootly_sdk/models/new_incident_sub_status_data.py +++ b/rootly_sdk/models/new_incident_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentSubStatusData: """ type_: NewIncidentSubStatusDataType - attributes: NewIncidentSubStatusDataAttributes + attributes: "NewIncidentSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_sub_status_data_attributes.py b/rootly_sdk/models/new_incident_sub_status_data_attributes.py index b63d1823..27d2e96e 100644 --- a/rootly_sdk/models/new_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_incident_sub_status_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,19 +16,19 @@ class NewIncidentSubStatusDataAttributes: sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's sub-status was assigned. assigned_at (str): - assigned_by_user_id (int | None | Unset): + assigned_by_user_id (Union[None, Unset, int]): """ sub_status_id: str assigned_at: str - assigned_by_user_id: int | None | Unset = UNSET + assigned_by_user_id: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: int | None | Unset + assigned_by_user_id: None | Unset | int if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -56,12 +54,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") - def _parse_assigned_by_user_id(data: object) -> int | None | Unset: + def _parse_assigned_by_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/new_incident_type.py b/rootly_sdk/models/new_incident_type.py index e92d9824..114709ac 100644 --- a/rootly_sdk/models/new_incident_type.py +++ b/rootly_sdk/models/new_incident_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentType: data (NewIncidentTypeData): """ - data: NewIncidentTypeData + data: "NewIncidentTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_type_data.py b/rootly_sdk/models/new_incident_type_data.py index 9409b7a5..59b64a71 100644 --- a/rootly_sdk/models/new_incident_type_data.py +++ b/rootly_sdk/models/new_incident_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentTypeData: """ type_: NewIncidentTypeDataType - attributes: NewIncidentTypeDataAttributes + attributes: "NewIncidentTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_type_data_attributes.py b/rootly_sdk/models/new_incident_type_data_attributes.py index 3c96c37c..895db080 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes.py +++ b/rootly_sdk/models/new_incident_type_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,50 +23,66 @@ class NewIncidentTypeDataAttributes: """ Attributes: name (str): The name of the incident type - description (None | str | Unset): The description of the incident type - color (None | str | Unset): The hex color of the incident type - position (int | None | Unset): Position of the incident type - notify_emails (list[str] | None | Unset): Emails to attach to the incident type - slack_channels (list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the incident type + public_description (Union[None, Unset, str]): The status page description of the incident type + color (Union[None, Unset, str]): The hex color of the incident type + position (Union[None, Unset, int]): Position of the incident type + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the incident type + slack_channels (Union[None, Unset, list['NewIncidentTypeDataAttributesSlackChannelsType0Item']]): Slack Channels associated with this incident type - slack_aliases (list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + slack_aliases (Union[None, Unset, list['NewIncidentTypeDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this incident type - properties (list[NewIncidentTypeDataAttributesPropertiesItem] | Unset): Array of property values for this - incident type. + properties (Union[Unset, list['NewIncidentTypeDataAttributesPropertiesItem']]): Array of property values for + this incident type. """ name: str - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[NewIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["NewIncidentTypeDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -77,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -89,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -101,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -115,8 +129,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -147,34 +165,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -185,15 +221,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -211,15 +247,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -237,24 +273,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_incident_type_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py b/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py index 5d2658eb..87ffc52a 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py index 99bf6dd1..3bb39fbe 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py index 722bc1fe..b7bde900 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_live_call_router.py b/rootly_sdk/models/new_live_call_router.py index bafd6e61..6bc1a616 100644 --- a/rootly_sdk/models/new_live_call_router.py +++ b/rootly_sdk/models/new_live_call_router.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewLiveCallRouter: data (NewLiveCallRouterData): """ - data: NewLiveCallRouterData + data: "NewLiveCallRouterData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_live_call_router_data.py b/rootly_sdk/models/new_live_call_router_data.py index 26152d3d..db6aba36 100644 --- a/rootly_sdk/models/new_live_call_router_data.py +++ b/rootly_sdk/models/new_live_call_router_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewLiveCallRouterData: """ type_: NewLiveCallRouterDataType - attributes: NewLiveCallRouterDataAttributes + attributes: "NewLiveCallRouterDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_live_call_router_data_attributes.py b/rootly_sdk/models/new_live_call_router_data_attributes.py index ffd5bcf2..af5e361b 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -47,30 +45,34 @@ class NewLiveCallRouterDataAttributes: [generate_phone_number](#//api/v1/live_call_routers/generate_phone_number) API and pass that phone number here to register voicemail_greeting (str): The voicemail greeting of the live_call_router - paging_targets (list[NewLiveCallRouterDataAttributesPagingTargetsItem]): Paging targets that callers can select - from when this live call router is configured as a phone tree. - enabled (bool | Unset): Whether the live_call_router is enabled - caller_greeting (str | Unset): The caller greeting message of the live_call_router - unavailable_responder_message (None | str | Unset): The message played to the caller when a responder doesn't - answer and the call moves on to the next person in the escalation. Leave blank to use the default message. - waiting_music_url (NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset): The waiting music URL of the + paging_targets (list['NewLiveCallRouterDataAttributesPagingTargetsItem']): Paging targets that callers can + select from when this live call router is configured as a phone tree. + enabled (Union[Unset, bool]): Whether the live_call_router is enabled + caller_greeting (Union[Unset, str]): The caller greeting message of the live_call_router + unavailable_responder_message (Union[None, Unset, str]): The message played to the caller when a responder + doesn't answer and the call moves on to the next person in the escalation. Leave blank to use the default + message. + waiting_music_url (Union[Unset, NewLiveCallRouterDataAttributesWaitingMusicUrl]): The waiting music URL of the live_call_router - sent_to_voicemail_delay (int | Unset): The delay (seconds) after which the caller in redirected to voicemail - should_redirect_to_voicemail_on_no_answer (bool | Unset): This prompts the caller to choose voicemail or connect - live - escalation_level_delay_in_seconds (int | Unset): This overrides the delay (seconds) in escalation levels - should_auto_resolve_alert_on_call_end (bool | Unset): This overrides the delay (seconds) in escalation levels - notify_via_sms (bool | Unset): Whether responders are also notified via SMS when this router pages them - notify_via_push_notification (bool | Unset): Whether responders are also notified via push notification when - this router pages them - informational_notification_message (None | str | Unset): Optional message included in the SMS/push notification. - Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name }}. - alert_urgency_id (str | Unset): This is used in escalation paths to determine who to page - calling_tree_enabled (bool | Unset): Whether the live call router is configured as a phone tree, requiring + sent_to_voicemail_delay (Union[Unset, int]): The delay (seconds) after which the caller in redirected to + voicemail + should_redirect_to_voicemail_on_no_answer (Union[Unset, bool]): This prompts the caller to choose voicemail or + connect live + escalation_level_delay_in_seconds (Union[Unset, int]): This overrides the delay (seconds) in escalation levels + should_auto_resolve_alert_on_call_end (Union[Unset, bool]): This overrides the delay (seconds) in escalation + levels + notify_via_sms (Union[Unset, bool]): Whether responders are also notified via SMS when this router pages them + notify_via_push_notification (Union[Unset, bool]): Whether responders are also notified via push notification + when this router pages them + informational_notification_message (Union[None, Unset, str]): Optional message included in the SMS/push + notification. Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name + }}. + alert_urgency_id (Union[Unset, str]): This is used in escalation paths to determine who to page + calling_tree_enabled (Union[Unset, bool]): Whether the live call router is configured as a phone tree, requiring callers to press a key before being connected - calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, + calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - escalation_policy_trigger_params (NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset): + escalation_policy_trigger_params (Union[Unset, NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams]): """ kind: NewLiveCallRouterDataAttributesKind @@ -79,25 +81,26 @@ class NewLiveCallRouterDataAttributes: phone_type: NewLiveCallRouterDataAttributesPhoneType phone_number: str voicemail_greeting: str - paging_targets: list[NewLiveCallRouterDataAttributesPagingTargetsItem] - enabled: bool | Unset = UNSET - caller_greeting: str | Unset = UNSET - unavailable_responder_message: None | str | Unset = UNSET - waiting_music_url: NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset = UNSET - sent_to_voicemail_delay: int | Unset = UNSET - should_redirect_to_voicemail_on_no_answer: bool | Unset = UNSET - escalation_level_delay_in_seconds: int | Unset = UNSET - should_auto_resolve_alert_on_call_end: bool | Unset = UNSET - notify_via_sms: bool | Unset = UNSET - notify_via_push_notification: bool | Unset = UNSET - informational_notification_message: None | str | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - calling_tree_enabled: bool | Unset = UNSET - calling_tree_prompt: str | Unset = UNSET - escalation_policy_trigger_params: NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset = UNSET + paging_targets: list["NewLiveCallRouterDataAttributesPagingTargetsItem"] + enabled: Unset | bool = UNSET + caller_greeting: Unset | str = UNSET + unavailable_responder_message: None | Unset | str = UNSET + waiting_music_url: Unset | NewLiveCallRouterDataAttributesWaitingMusicUrl = UNSET + sent_to_voicemail_delay: Unset | int = UNSET + should_redirect_to_voicemail_on_no_answer: Unset | bool = UNSET + escalation_level_delay_in_seconds: Unset | int = UNSET + should_auto_resolve_alert_on_call_end: Unset | bool = UNSET + notify_via_sms: Unset | bool = UNSET + notify_via_push_notification: Unset | bool = UNSET + informational_notification_message: None | Unset | str = UNSET + alert_urgency_id: Unset | str = UNSET + calling_tree_enabled: Unset | bool = UNSET + calling_tree_prompt: Unset | str = UNSET + escalation_policy_trigger_params: Union[Unset, "NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: - kind: str = self.kind name = self.name @@ -119,13 +122,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | str | Unset + unavailable_responder_message: None | Unset | str if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: str | Unset = UNSET + waiting_music_url: Unset | str = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -141,7 +144,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | str | Unset + informational_notification_message: None | Unset | str if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -153,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET + escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -236,19 +239,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> None | str | Unset: + def _parse_unavailable_responder_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset + waiting_music_url: Unset | NewLiveCallRouterDataAttributesWaitingMusicUrl if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -266,12 +269,12 @@ def _parse_unavailable_responder_message(data: object) -> None | str | Unset: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | str | Unset: + def _parse_informational_notification_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -284,7 +287,7 @@ def _parse_informational_notification_message(data: object) -> None | str | Unse calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset + escalation_policy_trigger_params: Unset | NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py b/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py index 53411b43..c3c3136b 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py b/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py index fbd27620..8993b484 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_on_call_pay_report.py b/rootly_sdk/models/new_on_call_pay_report.py index dedd08a5..cdcb2e67 100644 --- a/rootly_sdk/models/new_on_call_pay_report.py +++ b/rootly_sdk/models/new_on_call_pay_report.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOnCallPayReport: data (NewOnCallPayReportData): """ - data: NewOnCallPayReportData + data: "NewOnCallPayReportData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_on_call_pay_report_data.py b/rootly_sdk/models/new_on_call_pay_report_data.py index a50b78a5..84e4a7df 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data.py +++ b/rootly_sdk/models/new_on_call_pay_report_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOnCallPayReportData: """ type_: NewOnCallPayReportDataType - attributes: NewOnCallPayReportDataAttributes + attributes: "NewOnCallPayReportDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_on_call_pay_report_data_attributes.py b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py index ee306056..120e42a2 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data_attributes.py +++ b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,25 +16,25 @@ class NewOnCallPayReportDataAttributes: Attributes: start_date (datetime.date): The start date for the report period. end_date (datetime.date): The end date for the report period. - schedule_ids (list[str] | Unset): List of schedule UUIDs to scope the report. - time_zone (str | Unset): IANA timezone used to compute day and weekend boundaries. Defaults to the team's + schedule_ids (Union[Unset, list[str]]): List of schedule UUIDs to scope the report. + time_zone (Union[Unset, str]): IANA timezone used to compute day and weekend boundaries. Defaults to the team's timezone. - use_responders_time_zone (bool | Unset): When true, day and weekend boundaries are computed in each responder's - personal timezone instead of the report-wide timezone. + use_responders_time_zone (Union[Unset, bool]): When true, day and weekend boundaries are computed in each + responder's personal timezone instead of the report-wide timezone. """ start_date: datetime.date end_date: datetime.date - schedule_ids: list[str] | Unset = UNSET - time_zone: str | Unset = UNSET - use_responders_time_zone: bool | Unset = UNSET + schedule_ids: Unset | list[str] = UNSET + time_zone: Unset | str = UNSET + use_responders_time_zone: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: start_date = self.start_date.isoformat() end_date = self.end_date.isoformat() - schedule_ids: list[str] | Unset = UNSET + schedule_ids: Unset | list[str] = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids diff --git a/rootly_sdk/models/new_on_call_role.py b/rootly_sdk/models/new_on_call_role.py index da10105a..62976edf 100644 --- a/rootly_sdk/models/new_on_call_role.py +++ b/rootly_sdk/models/new_on_call_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOnCallRole: data (NewOnCallRoleData): """ - data: NewOnCallRoleData + data: "NewOnCallRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_on_call_role_data.py b/rootly_sdk/models/new_on_call_role_data.py index e48c91f9..05e59c36 100644 --- a/rootly_sdk/models/new_on_call_role_data.py +++ b/rootly_sdk/models/new_on_call_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOnCallRoleData: """ type_: NewOnCallRoleDataType - attributes: NewOnCallRoleDataAttributes + attributes: "NewOnCallRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_on_call_role_data_attributes.py b/rootly_sdk/models/new_on_call_role_data_attributes.py index 6b1abb86..cd1c4d48 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -111,230 +109,242 @@ class NewOnCallRoleDataAttributes: """ Attributes: name (str): The role name. - system_role (str | Unset): The kind of role (user and custom type roles are only editable) Default: 'custom'. - alert_fields_permissions (list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset): - alert_groups_permissions (list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset): - alert_routing_rules_permissions (list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset): - on_call_readiness_report_permissions (list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | - Unset): - on_call_roles_permissions (list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset): - alert_sources_permissions (list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset): - alert_urgency_permissions (list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset): - alerts_permissions (list[NewOnCallRoleDataAttributesAlertsPermissionsItem] | Unset): - api_keys_permissions (list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[NewOnCallRoleDataAttributesAuditsPermissionsItem] | Unset): - contacts_permissions (list[NewOnCallRoleDataAttributesContactsPermissionsItem] | Unset): - escalation_policies_permissions (list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset): - groups_permissions (list[NewOnCallRoleDataAttributesGroupsPermissionsItem] | Unset): - heartbeats_permissions (list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset): - integrations_permissions (list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset): - live_call_routing_permissions (list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset): - schedule_override_permissions (list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset): - schedules_permissions (list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset): - services_permissions (list[NewOnCallRoleDataAttributesServicesPermissionsItem] | Unset): - functionalities_permissions (list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - webhooks_permissions (list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + system_role (Union[Unset, str]): The kind of role (user and custom type roles are only editable) Default: + 'custom'. + alert_fields_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem]]): + alert_groups_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem]]): + alert_routing_rules_permissions (Union[Unset, + list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem]]): + on_call_readiness_report_permissions (Union[Unset, + list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem]]): + on_call_roles_permissions (Union[Unset, list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem]]): + alert_sources_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem]]): + alert_urgency_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem]]): + alerts_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[NewOnCallRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAuditsPermissionsItem]]): + contacts_permissions (Union[Unset, list[NewOnCallRoleDataAttributesContactsPermissionsItem]]): + escalation_policies_permissions (Union[Unset, + list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem]]): + groups_permissions (Union[Unset, list[NewOnCallRoleDataAttributesGroupsPermissionsItem]]): + heartbeats_permissions (Union[Unset, list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem]]): + integrations_permissions (Union[Unset, list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[NewOnCallRoleDataAttributesInvitationsPermissionsItem]]): + live_call_routing_permissions (Union[Unset, list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]]): + schedule_override_permissions (Union[Unset, list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem]]): + schedules_permissions (Union[Unset, list[NewOnCallRoleDataAttributesSchedulesPermissionsItem]]): + services_permissions (Union[Unset, list[NewOnCallRoleDataAttributesServicesPermissionsItem]]): + functionalities_permissions (Union[Unset, list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[NewOnCallRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[NewOnCallRoleDataAttributesCatalogsPermissionsItem]]): """ name: str - system_role: str | Unset = "custom" - alert_fields_permissions: list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - alert_groups_permissions: list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - alert_routing_rules_permissions: list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset = UNSET + slug: None | Unset | str = UNSET + system_role: Unset | str = "custom" + alert_fields_permissions: Unset | list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] = UNSET + alert_groups_permissions: Unset | list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] = UNSET + alert_routing_rules_permissions: Unset | list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] = UNSET on_call_readiness_report_permissions: ( - list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset + Unset | list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] ) = UNSET - on_call_roles_permissions: list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - alert_sources_permissions: list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - alert_urgency_permissions: list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - alerts_permissions: list[NewOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[NewOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - contacts_permissions: list[NewOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - escalation_policies_permissions: list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset = UNSET - groups_permissions: list[NewOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - heartbeats_permissions: list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - integrations_permissions: list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - live_call_routing_permissions: list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = UNSET - schedule_override_permissions: list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = UNSET - schedules_permissions: list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - services_permissions: list[NewOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - functionalities_permissions: list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET + on_call_roles_permissions: Unset | list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] = UNSET + alert_sources_permissions: Unset | list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] = UNSET + alert_urgency_permissions: Unset | list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] = UNSET + alerts_permissions: Unset | list[NewOnCallRoleDataAttributesAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[NewOnCallRoleDataAttributesAuditsPermissionsItem] = UNSET + contacts_permissions: Unset | list[NewOnCallRoleDataAttributesContactsPermissionsItem] = UNSET + escalation_policies_permissions: Unset | list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] = UNSET + groups_permissions: Unset | list[NewOnCallRoleDataAttributesGroupsPermissionsItem] = UNSET + heartbeats_permissions: Unset | list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] = UNSET + integrations_permissions: Unset | list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] = UNSET + live_call_routing_permissions: Unset | list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] = UNSET + schedule_override_permissions: Unset | list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] = UNSET + schedules_permissions: Unset | list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] = UNSET + services_permissions: Unset | list[NewOnCallRoleDataAttributesServicesPermissionsItem] = UNSET + functionalities_permissions: Unset | list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + system_role = self.system_role - alert_fields_permissions: list[str] | Unset = UNSET + alert_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: list[str] | Unset = UNSET + alert_groups_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: list[str] | Unset = UNSET + alert_routing_rules_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: list[str] | Unset = UNSET + on_call_readiness_report_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: list[str] | Unset = UNSET + on_call_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alert_sources_permissions: list[str] | Unset = UNSET + alert_sources_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: list[str] | Unset = UNSET + alert_urgency_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: list[str] | Unset = UNSET + contacts_permissions: Unset | list[str] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: list[str] | Unset = UNSET + escalation_policies_permissions: Unset | list[str] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: list[str] | Unset = UNSET + heartbeats_permissions: Unset | list[str] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: list[str] | Unset = UNSET + live_call_routing_permissions: Unset | list[str] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: list[str] | Unset = UNSET + schedule_override_permissions: Unset | list[str] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: list[str] | Unset = UNSET + schedules_permissions: Unset | list[str] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -348,6 +358,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if system_role is not UNSET: field_dict["system_role"] = system_role if alert_fields_permissions is not UNSET: @@ -406,292 +418,246 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + system_role = d.pop("system_role", UNSET) + alert_fields_permissions = [] _alert_fields_permissions = d.pop("alert_fields_permissions", UNSET) - alert_fields_permissions: list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - if _alert_fields_permissions is not UNSET: - alert_fields_permissions = [] - for alert_fields_permissions_item_data in _alert_fields_permissions: - alert_fields_permissions_item = check_new_on_call_role_data_attributes_alert_fields_permissions_item( - alert_fields_permissions_item_data - ) + for alert_fields_permissions_item_data in _alert_fields_permissions or []: + alert_fields_permissions_item = check_new_on_call_role_data_attributes_alert_fields_permissions_item( + alert_fields_permissions_item_data + ) - alert_fields_permissions.append(alert_fields_permissions_item) + alert_fields_permissions.append(alert_fields_permissions_item) + alert_groups_permissions = [] _alert_groups_permissions = d.pop("alert_groups_permissions", UNSET) - alert_groups_permissions: list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - if _alert_groups_permissions is not UNSET: - alert_groups_permissions = [] - for alert_groups_permissions_item_data in _alert_groups_permissions: - alert_groups_permissions_item = check_new_on_call_role_data_attributes_alert_groups_permissions_item( - alert_groups_permissions_item_data - ) + for alert_groups_permissions_item_data in _alert_groups_permissions or []: + alert_groups_permissions_item = check_new_on_call_role_data_attributes_alert_groups_permissions_item( + alert_groups_permissions_item_data + ) - alert_groups_permissions.append(alert_groups_permissions_item) + alert_groups_permissions.append(alert_groups_permissions_item) + alert_routing_rules_permissions = [] _alert_routing_rules_permissions = d.pop("alert_routing_rules_permissions", UNSET) - alert_routing_rules_permissions: list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset = ( - UNSET - ) - if _alert_routing_rules_permissions is not UNSET: - alert_routing_rules_permissions = [] - for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions: - alert_routing_rules_permissions_item = ( - check_new_on_call_role_data_attributes_alert_routing_rules_permissions_item( - alert_routing_rules_permissions_item_data - ) + for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions or []: + alert_routing_rules_permissions_item = ( + check_new_on_call_role_data_attributes_alert_routing_rules_permissions_item( + alert_routing_rules_permissions_item_data ) + ) - alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + on_call_readiness_report_permissions = [] _on_call_readiness_report_permissions = d.pop("on_call_readiness_report_permissions", UNSET) - on_call_readiness_report_permissions: ( - list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset - ) = UNSET - if _on_call_readiness_report_permissions is not UNSET: - on_call_readiness_report_permissions = [] - for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions: - on_call_readiness_report_permissions_item = ( - check_new_on_call_role_data_attributes_on_call_readiness_report_permissions_item( - on_call_readiness_report_permissions_item_data - ) + for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions or []: + on_call_readiness_report_permissions_item = ( + check_new_on_call_role_data_attributes_on_call_readiness_report_permissions_item( + on_call_readiness_report_permissions_item_data ) + ) - on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_roles_permissions = [] _on_call_roles_permissions = d.pop("on_call_roles_permissions", UNSET) - on_call_roles_permissions: list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - if _on_call_roles_permissions is not UNSET: - on_call_roles_permissions = [] - for on_call_roles_permissions_item_data in _on_call_roles_permissions: - on_call_roles_permissions_item = check_new_on_call_role_data_attributes_on_call_roles_permissions_item( - on_call_roles_permissions_item_data - ) + for on_call_roles_permissions_item_data in _on_call_roles_permissions or []: + on_call_roles_permissions_item = check_new_on_call_role_data_attributes_on_call_roles_permissions_item( + on_call_roles_permissions_item_data + ) - on_call_roles_permissions.append(on_call_roles_permissions_item) + on_call_roles_permissions.append(on_call_roles_permissions_item) + alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - alert_sources_permissions: list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - if _alert_sources_permissions is not UNSET: - alert_sources_permissions = [] - for alert_sources_permissions_item_data in _alert_sources_permissions: - alert_sources_permissions_item = check_new_on_call_role_data_attributes_alert_sources_permissions_item( - alert_sources_permissions_item_data - ) + for alert_sources_permissions_item_data in _alert_sources_permissions or []: + alert_sources_permissions_item = check_new_on_call_role_data_attributes_alert_sources_permissions_item( + alert_sources_permissions_item_data + ) - alert_sources_permissions.append(alert_sources_permissions_item) + alert_sources_permissions.append(alert_sources_permissions_item) + alert_urgency_permissions = [] _alert_urgency_permissions = d.pop("alert_urgency_permissions", UNSET) - alert_urgency_permissions: list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - if _alert_urgency_permissions is not UNSET: - alert_urgency_permissions = [] - for alert_urgency_permissions_item_data in _alert_urgency_permissions: - alert_urgency_permissions_item = check_new_on_call_role_data_attributes_alert_urgency_permissions_item( - alert_urgency_permissions_item_data - ) + for alert_urgency_permissions_item_data in _alert_urgency_permissions or []: + alert_urgency_permissions_item = check_new_on_call_role_data_attributes_alert_urgency_permissions_item( + alert_urgency_permissions_item_data + ) - alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_urgency_permissions.append(alert_urgency_permissions_item) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[NewOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_new_on_call_role_data_attributes_alerts_permissions_item( - alerts_permissions_item_data - ) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_new_on_call_role_data_attributes_alerts_permissions_item( + alerts_permissions_item_data + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_new_on_call_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_new_on_call_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[NewOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_new_on_call_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_new_on_call_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - contacts_permissions: list[NewOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - if _contacts_permissions is not UNSET: - contacts_permissions = [] - for contacts_permissions_item_data in _contacts_permissions: - contacts_permissions_item = check_new_on_call_role_data_attributes_contacts_permissions_item( - contacts_permissions_item_data - ) + for contacts_permissions_item_data in _contacts_permissions or []: + contacts_permissions_item = check_new_on_call_role_data_attributes_contacts_permissions_item( + contacts_permissions_item_data + ) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) + escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - escalation_policies_permissions: list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset = ( - UNSET - ) - if _escalation_policies_permissions is not UNSET: - escalation_policies_permissions = [] - for escalation_policies_permissions_item_data in _escalation_policies_permissions: - escalation_policies_permissions_item = ( - check_new_on_call_role_data_attributes_escalation_policies_permissions_item( - escalation_policies_permissions_item_data - ) + for escalation_policies_permissions_item_data in _escalation_policies_permissions or []: + escalation_policies_permissions_item = ( + check_new_on_call_role_data_attributes_escalation_policies_permissions_item( + escalation_policies_permissions_item_data ) + ) - escalation_policies_permissions.append(escalation_policies_permissions_item) + escalation_policies_permissions.append(escalation_policies_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[NewOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_new_on_call_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_new_on_call_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - heartbeats_permissions: list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - if _heartbeats_permissions is not UNSET: - heartbeats_permissions = [] - for heartbeats_permissions_item_data in _heartbeats_permissions: - heartbeats_permissions_item = check_new_on_call_role_data_attributes_heartbeats_permissions_item( - heartbeats_permissions_item_data - ) + for heartbeats_permissions_item_data in _heartbeats_permissions or []: + heartbeats_permissions_item = check_new_on_call_role_data_attributes_heartbeats_permissions_item( + heartbeats_permissions_item_data + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_new_on_call_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_new_on_call_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_new_on_call_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_new_on_call_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + live_call_routing_permissions = [] _live_call_routing_permissions = d.pop("live_call_routing_permissions", UNSET) - live_call_routing_permissions: list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = UNSET - if _live_call_routing_permissions is not UNSET: - live_call_routing_permissions = [] - for live_call_routing_permissions_item_data in _live_call_routing_permissions: - live_call_routing_permissions_item = ( - check_new_on_call_role_data_attributes_live_call_routing_permissions_item( - live_call_routing_permissions_item_data - ) + for live_call_routing_permissions_item_data in _live_call_routing_permissions or []: + live_call_routing_permissions_item = ( + check_new_on_call_role_data_attributes_live_call_routing_permissions_item( + live_call_routing_permissions_item_data ) + ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - schedule_override_permissions: list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = UNSET - if _schedule_override_permissions is not UNSET: - schedule_override_permissions = [] - for schedule_override_permissions_item_data in _schedule_override_permissions: - schedule_override_permissions_item = ( - check_new_on_call_role_data_attributes_schedule_override_permissions_item( - schedule_override_permissions_item_data - ) + for schedule_override_permissions_item_data in _schedule_override_permissions or []: + schedule_override_permissions_item = ( + check_new_on_call_role_data_attributes_schedule_override_permissions_item( + schedule_override_permissions_item_data ) + ) - schedule_override_permissions.append(schedule_override_permissions_item) + schedule_override_permissions.append(schedule_override_permissions_item) + schedules_permissions = [] _schedules_permissions = d.pop("schedules_permissions", UNSET) - schedules_permissions: list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - if _schedules_permissions is not UNSET: - schedules_permissions = [] - for schedules_permissions_item_data in _schedules_permissions: - schedules_permissions_item = check_new_on_call_role_data_attributes_schedules_permissions_item( - schedules_permissions_item_data - ) + for schedules_permissions_item_data in _schedules_permissions or []: + schedules_permissions_item = check_new_on_call_role_data_attributes_schedules_permissions_item( + schedules_permissions_item_data + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[NewOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_new_on_call_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_new_on_call_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = ( - check_new_on_call_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_new_on_call_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_new_on_call_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_new_on_call_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_new_on_call_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_new_on_call_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_new_on_call_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_new_on_call_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) new_on_call_role_data_attributes = cls( name=name, + slug=slug, system_role=system_role, alert_fields_permissions=alert_fields_permissions, alert_groups_permissions=alert_groups_permissions, diff --git a/rootly_sdk/models/new_on_call_shadow.py b/rootly_sdk/models/new_on_call_shadow.py index a4930c3e..789a48c4 100644 --- a/rootly_sdk/models/new_on_call_shadow.py +++ b/rootly_sdk/models/new_on_call_shadow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOnCallShadow: data (NewOnCallShadowData): """ - data: NewOnCallShadowData + data: "NewOnCallShadowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_on_call_shadow_data.py b/rootly_sdk/models/new_on_call_shadow_data.py index 52139f94..50063cff 100644 --- a/rootly_sdk/models/new_on_call_shadow_data.py +++ b/rootly_sdk/models/new_on_call_shadow_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOnCallShadowData: """ type_: NewOnCallShadowDataType - attributes: NewOnCallShadowDataAttributes + attributes: "NewOnCallShadowDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_on_call_shadow_data_attributes.py b/rootly_sdk/models/new_on_call_shadow_data_attributes.py index f0ea1c0b..038e3f86 100644 --- a/rootly_sdk/models/new_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/new_on_call_shadow_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_override_shift.py b/rootly_sdk/models/new_override_shift.py index b2a8ebc8..6ded75a5 100644 --- a/rootly_sdk/models/new_override_shift.py +++ b/rootly_sdk/models/new_override_shift.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOverrideShift: data (NewOverrideShiftData): """ - data: NewOverrideShiftData + data: "NewOverrideShiftData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_override_shift_data.py b/rootly_sdk/models/new_override_shift_data.py index 8164aa47..725b9463 100644 --- a/rootly_sdk/models/new_override_shift_data.py +++ b/rootly_sdk/models/new_override_shift_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOverrideShiftData: """ type_: NewOverrideShiftDataType - attributes: NewOverrideShiftDataAttributes + attributes: "NewOverrideShiftDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_override_shift_data_attributes.py b/rootly_sdk/models/new_override_shift_data_attributes.py index 028469d7..41ca3559 100644 --- a/rootly_sdk/models/new_override_shift_data_attributes.py +++ b/rootly_sdk/models/new_override_shift_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_playbook.py b/rootly_sdk/models/new_playbook.py index 2877e31f..67ea823c 100644 --- a/rootly_sdk/models/new_playbook.py +++ b/rootly_sdk/models/new_playbook.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPlaybook: data (NewPlaybookData): """ - data: NewPlaybookData + data: "NewPlaybookData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_playbook_data.py b/rootly_sdk/models/new_playbook_data.py index 85e7114a..d1ca1d51 100644 --- a/rootly_sdk/models/new_playbook_data.py +++ b/rootly_sdk/models/new_playbook_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewPlaybookData: """ type_: NewPlaybookDataType - attributes: NewPlaybookDataAttributes + attributes: "NewPlaybookDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_playbook_data_attributes.py b/rootly_sdk/models/new_playbook_data_attributes.py index 5dae9c85..bf242c06 100644 --- a/rootly_sdk/models/new_playbook_data_attributes.py +++ b/rootly_sdk/models/new_playbook_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,42 +13,42 @@ class NewPlaybookDataAttributes: """ Attributes: title (str): The title of the playbook - summary (None | str | Unset): The summary of the playbook - external_url (None | str | Unset): The external url of the playbook - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident + summary (Union[None, Unset, str]): The summary of the playbook + external_url (Union[None, Unset, str]): The external url of the playbook + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ title: str - summary: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + summary: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + severity_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -77,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -86,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -95,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -135,25 +133,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -164,13 +162,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -181,13 +179,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -198,13 +196,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -215,13 +213,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -232,13 +230,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -249,9 +247,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/new_playbook_task.py b/rootly_sdk/models/new_playbook_task.py index 2358ad45..b7f5a3d5 100644 --- a/rootly_sdk/models/new_playbook_task.py +++ b/rootly_sdk/models/new_playbook_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPlaybookTask: data (NewPlaybookTaskData): """ - data: NewPlaybookTaskData + data: "NewPlaybookTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_playbook_task_data.py b/rootly_sdk/models/new_playbook_task_data.py index 68af70e6..e9008bb8 100644 --- a/rootly_sdk/models/new_playbook_task_data.py +++ b/rootly_sdk/models/new_playbook_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewPlaybookTaskData: """ type_: NewPlaybookTaskDataType - attributes: NewPlaybookTaskDataAttributes + attributes: "NewPlaybookTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_playbook_task_data_attributes.py b/rootly_sdk/models/new_playbook_task_data_attributes.py index 7888c99c..b3f89bfd 100644 --- a/rootly_sdk/models/new_playbook_task_data_attributes.py +++ b/rootly_sdk/models/new_playbook_task_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,24 +13,24 @@ class NewPlaybookTaskDataAttributes: """ Attributes: task (str): The task of the task - description (None | str | Unset): The description of the task - position (int | None | Unset): The position of the task + description (Union[None, Unset, str]): The description of the task + position (Union[None, Unset, int]): The position of the task """ task: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -57,21 +55,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_post_mortem_template.py b/rootly_sdk/models/new_post_mortem_template.py index 9e51b0d5..0c6828d4 100644 --- a/rootly_sdk/models/new_post_mortem_template.py +++ b/rootly_sdk/models/new_post_mortem_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPostMortemTemplate: data (NewPostMortemTemplateData): """ - data: NewPostMortemTemplateData + data: "NewPostMortemTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_post_mortem_template_data.py b/rootly_sdk/models/new_post_mortem_template_data.py index 96041417..538680f1 100644 --- a/rootly_sdk/models/new_post_mortem_template_data.py +++ b/rootly_sdk/models/new_post_mortem_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewPostMortemTemplateData: """ type_: NewPostMortemTemplateDataType - attributes: NewPostMortemTemplateDataAttributes + attributes: "NewPostMortemTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_post_mortem_template_data_attributes.py b/rootly_sdk/models/new_post_mortem_template_data_attributes.py index a90a8526..7a2c63dd 100644 --- a/rootly_sdk/models/new_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/new_post_mortem_template_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,21 +17,30 @@ class NewPostMortemTemplateDataAttributes: """ Attributes: name (str): The name of the postmortem template - default (bool | None | Unset): Default selected template when editing a postmortem - content (str | Unset): The postmortem template. Supports TipTap blocks (followup and timeline components), + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + default (Union[None, Unset, bool]): Default selected template when editing a postmortem + content (Union[Unset, str]): The postmortem template. Supports TipTap blocks (followup and timeline components), Liquid syntax, and HTML. Will be sanitized and applied to both content and content_html fields. - format_ (NewPostMortemTemplateDataAttributesFormat | Unset): The format of the input Default: 'html'. + format_ (Union[Unset, NewPostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. """ name: str - default: bool | None | Unset = UNSET - content: str | Unset = UNSET - format_: NewPostMortemTemplateDataAttributesFormat | Unset = "html" + slug: None | Unset | str = UNSET + default: None | Unset | bool = UNSET + content: Unset | str = UNSET + format_: Unset | NewPostMortemTemplateDataAttributesFormat = "html" def to_dict(self) -> dict[str, Any]: name = self.name - default: bool | None | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: @@ -41,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: str | Unset = UNSET + format_: Unset | str = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -52,6 +59,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if default is not UNSET: field_dict["default"] = default if content is not UNSET: @@ -66,19 +75,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_default(data: object) -> bool | None | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: NewPostMortemTemplateDataAttributesFormat | Unset + format_: Unset | NewPostMortemTemplateDataAttributesFormat if isinstance(_format_, Unset): format_ = UNSET else: @@ -86,6 +104,7 @@ def _parse_default(data: object) -> bool | None | Unset: new_post_mortem_template_data_attributes = cls( name=name, + slug=slug, default=default, content=content, format_=format_, diff --git a/rootly_sdk/models/new_pulse.py b/rootly_sdk/models/new_pulse.py index b674db54..0d6e9db2 100644 --- a/rootly_sdk/models/new_pulse.py +++ b/rootly_sdk/models/new_pulse.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPulse: data (NewPulseData): """ - data: NewPulseData + data: "NewPulseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_pulse_data.py b/rootly_sdk/models/new_pulse_data.py index 7e407845..7d35da03 100644 --- a/rootly_sdk/models/new_pulse_data.py +++ b/rootly_sdk/models/new_pulse_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewPulseData: """ type_: NewPulseDataType - attributes: NewPulseDataAttributes + attributes: "NewPulseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_pulse_data_attributes.py b/rootly_sdk/models/new_pulse_data_attributes.py index c16515c8..b230c418 100644 --- a/rootly_sdk/models/new_pulse_data_attributes.py +++ b/rootly_sdk/models/new_pulse_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -23,27 +21,27 @@ class NewPulseDataAttributes: """ Attributes: summary (str): The summary of the pulse - source (None | str | Unset): The source of the pulse (eg: k8s) - service_ids (list[str] | None | Unset): The Service IDs to attach to the pulse - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the pulse - started_at (datetime.datetime | None | Unset): Pulse start datetime - ended_at (datetime.datetime | None | Unset): Pulse end datetime - external_url (None | str | Unset): The external url of the pulse - labels (list[NewPulseDataAttributesLabelsItemType0 | None] | Unset): - refs (list[NewPulseDataAttributesRefsItemType0 | None] | Unset): - data (NewPulseDataAttributesDataType0 | None | Unset): Additional data + source (Union[None, Unset, str]): The source of the pulse (eg: k8s) + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the pulse + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the pulse + started_at (Union[None, Unset, datetime.datetime]): Pulse start datetime + ended_at (Union[None, Unset, datetime.datetime]): Pulse end datetime + external_url (Union[None, Unset, str]): The external url of the pulse + labels (Union[Unset, list[Union['NewPulseDataAttributesLabelsItemType0', None]]]): + refs (Union[Unset, list[Union['NewPulseDataAttributesRefsItemType0', None]]]): + data (Union['NewPulseDataAttributesDataType0', None, Unset]): Additional data """ summary: str - source: None | str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_url: None | str | Unset = UNSET - labels: list[NewPulseDataAttributesLabelsItemType0 | None] | Unset = UNSET - refs: list[NewPulseDataAttributesRefsItemType0 | None] | Unset = UNSET - data: NewPulseDataAttributesDataType0 | None | Unset = UNSET + source: None | Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_url: None | Unset | str = UNSET + labels: Unset | list[Union["NewPulseDataAttributesLabelsItemType0", None]] = UNSET + refs: Unset | list[Union["NewPulseDataAttributesRefsItemType0", None]] = UNSET + data: Union["NewPulseDataAttributesDataType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_pulse_data_attributes_data_type_0 import NewPulseDataAttributesDataType0 @@ -52,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - source: None | str | Unset + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: source = self.source - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -67,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -92,35 +90,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: None | dict[str, Any] if isinstance(labels_item_data, NewPulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: list[dict[str, Any] | None] | Unset = UNSET + refs: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: dict[str, Any] | None + refs_item: None | dict[str, Any] if isinstance(refs_item_data, NewPulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewPulseDataAttributesDataType0): @@ -165,16 +163,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -185,13 +183,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -202,13 +200,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -219,13 +217,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -236,68 +234,64 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[NewPulseDataAttributesLabelsItemType0 | None] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> NewPulseDataAttributesLabelsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = NewPulseDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["NewPulseDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = NewPulseDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewPulseDataAttributesLabelsItemType0 | None, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewPulseDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) + refs = [] _refs = d.pop("refs", UNSET) - refs: list[NewPulseDataAttributesRefsItemType0 | None] | Unset = UNSET - if _refs is not UNSET: - refs = [] - for refs_item_data in _refs: + for refs_item_data in _refs or []: - def _parse_refs_item(data: object) -> NewPulseDataAttributesRefsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - refs_item_type_0 = NewPulseDataAttributesRefsItemType0.from_dict(data) + def _parse_refs_item(data: object) -> Union["NewPulseDataAttributesRefsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + refs_item_type_0 = NewPulseDataAttributesRefsItemType0.from_dict(data) - return refs_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewPulseDataAttributesRefsItemType0 | None, data) + return refs_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewPulseDataAttributesRefsItemType0", None], data) - refs_item = _parse_refs_item(refs_item_data) + refs_item = _parse_refs_item(refs_item_data) - refs.append(refs_item) + refs.append(refs_item) - def _parse_data(data: object) -> NewPulseDataAttributesDataType0 | None | Unset: + def _parse_data(data: object) -> Union["NewPulseDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -308,9 +302,9 @@ def _parse_data(data: object) -> NewPulseDataAttributesDataType0 | None | Unset: data_type_0 = NewPulseDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewPulseDataAttributesDataType0 | None | Unset, data) + return cast(Union["NewPulseDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py index 03734676..cbb26d78 100644 --- a/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py +++ b/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewPulseDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py index b85f9272..66fe8bd4 100644 --- a/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py index dafc0f72..100089af 100644 --- a/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py +++ b/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_retrospective_process.py b/rootly_sdk/models/new_retrospective_process.py index b503747b..b24711b4 100644 --- a/rootly_sdk/models/new_retrospective_process.py +++ b/rootly_sdk/models/new_retrospective_process.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveProcess: data (NewRetrospectiveProcessData): """ - data: NewRetrospectiveProcessData + data: "NewRetrospectiveProcessData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_process_data.py b/rootly_sdk/models/new_retrospective_process_data.py index 0784fceb..d6925f7d 100644 --- a/rootly_sdk/models/new_retrospective_process_data.py +++ b/rootly_sdk/models/new_retrospective_process_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewRetrospectiveProcessData: """ type_: NewRetrospectiveProcessDataType - attributes: NewRetrospectiveProcessDataAttributes + attributes: "NewRetrospectiveProcessDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes.py b/rootly_sdk/models/new_retrospective_process_data_attributes.py index 49bfd3bf..b8865f21 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -29,22 +27,22 @@ class NewRetrospectiveProcessDataAttributes: name (str): The name of the retrospective process copy_from (str): Retrospective process ID from which retrospective steps have to be copied. To use starter template for retrospective steps provide value: 'starter_template' - description (None | str | Unset): The description of the retrospective process + description (Union[None, Unset, str]): The description of the retrospective process retrospective_process_matching_criteria - (NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 | - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 | - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 | Unset): + (Union['NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0', + 'NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1', + 'NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2', Unset]): """ name: str copy_from: str - description: None | str | Unset = UNSET - retrospective_process_matching_criteria: ( - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - | Unset - ) = UNSET + description: None | Unset | str = UNSET + retrospective_process_matching_criteria: Union[ + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0 import ( @@ -58,13 +56,13 @@ def to_dict(self) -> dict[str, Any]: copy_from = self.copy_from - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: dict[str, Any] | Unset + retrospective_process_matching_criteria: Unset | dict[str, Any] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -112,23 +110,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: copy_from = d.pop("copy_from") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) def _parse_retrospective_process_matching_criteria( data: object, - ) -> ( - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - | Unset - ): + ) -> Union[ + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -139,7 +137,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -149,7 +147,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py index bb07129a..e4a84e85 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py index 452c2da5..98eba687 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py index 5645b537..1a35d6a4 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_retrospective_process_group.py b/rootly_sdk/models/new_retrospective_process_group.py index 8af8a734..6aa11d4a 100644 --- a/rootly_sdk/models/new_retrospective_process_group.py +++ b/rootly_sdk/models/new_retrospective_process_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveProcessGroup: data (NewRetrospectiveProcessGroupData): """ - data: NewRetrospectiveProcessGroupData + data: "NewRetrospectiveProcessGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_process_group_data.py b/rootly_sdk/models/new_retrospective_process_group_data.py index 10615645..25dcfe6d 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data.py +++ b/rootly_sdk/models/new_retrospective_process_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewRetrospectiveProcessGroupData: """ type_: NewRetrospectiveProcessGroupDataType - attributes: NewRetrospectiveProcessGroupDataAttributes + attributes: "NewRetrospectiveProcessGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py index a9d822d9..151d9a3e 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,11 +13,11 @@ class NewRetrospectiveProcessGroupDataAttributes: """ Attributes: sub_status_id (str): - position (int | Unset): + position (Union[Unset, int]): """ sub_status_id: str - position: int | Unset = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id diff --git a/rootly_sdk/models/new_retrospective_process_group_step.py b/rootly_sdk/models/new_retrospective_process_group_step.py index b700bfc2..7ab02994 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step.py +++ b/rootly_sdk/models/new_retrospective_process_group_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveProcessGroupStep: data (NewRetrospectiveProcessGroupStepData): """ - data: NewRetrospectiveProcessGroupStepData + data: "NewRetrospectiveProcessGroupStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_process_group_step_data.py b/rootly_sdk/models/new_retrospective_process_group_step_data.py index 7aeeb8b3..ca566165 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewRetrospectiveProcessGroupStepData: """ type_: NewRetrospectiveProcessGroupStepDataType - attributes: NewRetrospectiveProcessGroupStepDataAttributes + attributes: "NewRetrospectiveProcessGroupStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py index 5374e922..c25b7f09 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,11 +13,11 @@ class NewRetrospectiveProcessGroupStepDataAttributes: """ Attributes: retrospective_step_id (str): - position (int | Unset): + position (Union[Unset, int]): """ retrospective_step_id: str - position: int | Unset = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: retrospective_step_id = self.retrospective_step_id diff --git a/rootly_sdk/models/new_retrospective_step.py b/rootly_sdk/models/new_retrospective_step.py index f1f314d6..af77e064 100644 --- a/rootly_sdk/models/new_retrospective_step.py +++ b/rootly_sdk/models/new_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveStep: data (NewRetrospectiveStepData): """ - data: NewRetrospectiveStepData + data: "NewRetrospectiveStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_step_data.py b/rootly_sdk/models/new_retrospective_step_data.py index 940e62ff..d15c1567 100644 --- a/rootly_sdk/models/new_retrospective_step_data.py +++ b/rootly_sdk/models/new_retrospective_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewRetrospectiveStepData: """ type_: NewRetrospectiveStepDataType - attributes: NewRetrospectiveStepDataAttributes + attributes: "NewRetrospectiveStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_step_data_attributes.py b/rootly_sdk/models/new_retrospective_step_data_attributes.py index 3b6079ec..7a87c57d 100644 --- a/rootly_sdk/models/new_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_step_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,43 +13,52 @@ class NewRetrospectiveStepDataAttributes: """ Attributes: title (str): The name of the step - description (None | str | Unset): The description of the step - due_after_days (int | None | Unset): Due date in days - incident_role_id (None | str | Unset): Users assigned to the selected incident role will be the default owners - for this step - position (int | None | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the step + due_after_days (Union[None, Unset, int]): Due date in days + incident_role_id (Union[None, Unset, str]): Users assigned to the selected incident role will be the default + owners for this step + position (Union[None, Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ title: str - description: None | str | Unset = UNSET - due_after_days: int | None | Unset = UNSET - incident_role_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - skippable: bool | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + due_after_days: None | Unset | int = UNSET + incident_role_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + skippable: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_after_days: int | None | Unset + due_after_days: None | Unset | int if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - incident_role_id: None | str | Unset + incident_role_id: None | Unset | str if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -66,6 +73,8 @@ def to_dict(self) -> dict[str, Any]: "title": title, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if due_after_days is not UNSET: @@ -84,39 +93,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_after_days(data: object) -> int | None | Unset: + def _parse_due_after_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_incident_role_id(data: object) -> None | str | Unset: + def _parse_incident_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) @@ -124,6 +142,7 @@ def _parse_position(data: object) -> int | None | Unset: new_retrospective_step_data_attributes = cls( title=title, + slug=slug, description=description, due_after_days=due_after_days, incident_role_id=incident_role_id, diff --git a/rootly_sdk/models/new_role.py b/rootly_sdk/models/new_role.py index ec5324cb..d8bedece 100644 --- a/rootly_sdk/models/new_role.py +++ b/rootly_sdk/models/new_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRole: data (NewRoleData): """ - data: NewRoleData + data: "NewRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_role_data.py b/rootly_sdk/models/new_role_data.py index f591f76f..69f3ba5f 100644 --- a/rootly_sdk/models/new_role_data.py +++ b/rootly_sdk/models/new_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewRoleData: """ type_: NewRoleDataType - attributes: NewRoleDataAttributes + attributes: "NewRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_role_data_attributes.py b/rootly_sdk/models/new_role_data_attributes.py index db2e7aa3..748e90ff 100644 --- a/rootly_sdk/models/new_role_data_attributes.py +++ b/rootly_sdk/models/new_role_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -147,312 +145,323 @@ class NewRoleDataAttributes: """ Attributes: name (str): The role name. - incident_permission_set_id (None | str | Unset): Associated incident permissions set. - alerts_permissions (list[NewRoleDataAttributesAlertsPermissionsItem] | Unset): - api_keys_permissions (list[NewRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[NewRoleDataAttributesAuditsPermissionsItem] | Unset): - billing_permissions (list[NewRoleDataAttributesBillingPermissionsItem] | Unset): - environments_permissions (list[NewRoleDataAttributesEnvironmentsPermissionsItem] | Unset): - form_fields_permissions (list[NewRoleDataAttributesFormFieldsPermissionsItem] | Unset): - functionalities_permissions (list[NewRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - groups_permissions (list[NewRoleDataAttributesGroupsPermissionsItem] | Unset): - incident_causes_permissions (list[NewRoleDataAttributesIncidentCausesPermissionsItem] | Unset): - incident_feedbacks_permissions (list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset): - incident_roles_permissions (list[NewRoleDataAttributesIncidentRolesPermissionsItem] | Unset): - incident_types_permissions (list[NewRoleDataAttributesIncidentTypesPermissionsItem] | Unset): - incidents_permissions (list[NewRoleDataAttributesIncidentsPermissionsItem] | Unset): - integrations_permissions (list[NewRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[NewRoleDataAttributesInvitationsPermissionsItem] | Unset): - playbooks_permissions (list[NewRoleDataAttributesPlaybooksPermissionsItem] | Unset): - private_incidents_permissions (list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset): - pulses_permissions (list[NewRoleDataAttributesPulsesPermissionsItem] | Unset): - retrospective_permissions (list[NewRoleDataAttributesRetrospectivePermissionsItem] | Unset): - roles_permissions (list[NewRoleDataAttributesRolesPermissionsItem] | Unset): - secrets_permissions (list[NewRoleDataAttributesSecretsPermissionsItem] | Unset): - services_permissions (list[NewRoleDataAttributesServicesPermissionsItem] | Unset): - severities_permissions (list[NewRoleDataAttributesSeveritiesPermissionsItem] | Unset): - status_pages_permissions (list[NewRoleDataAttributesStatusPagesPermissionsItem] | Unset): - webhooks_permissions (list[NewRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[NewRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[NewRoleDataAttributesCatalogsPermissionsItem] | Unset): - sub_statuses_permissions (list[NewRoleDataAttributesSubStatusesPermissionsItem] | Unset): - edge_connector_permissions (list[NewRoleDataAttributesEdgeConnectorPermissionsItem] | Unset): - slas_permissions (list[NewRoleDataAttributesSlasPermissionsItem] | Unset): - paging_permissions (list[NewRoleDataAttributesPagingPermissionsItem] | Unset): - incident_communication_permissions (list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset): - communication_permissions (list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. Custom role slugs remain accepted temporarily. Stop setting `slug`; + it will become read-only and be derived from `name` when this property is removed from the request schema in a + future version. + incident_permission_set_id (Union[None, Unset, str]): Associated incident permissions set. + alerts_permissions (Union[Unset, list[NewRoleDataAttributesAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[NewRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[NewRoleDataAttributesAuditsPermissionsItem]]): + billing_permissions (Union[Unset, list[NewRoleDataAttributesBillingPermissionsItem]]): + environments_permissions (Union[Unset, list[NewRoleDataAttributesEnvironmentsPermissionsItem]]): + form_fields_permissions (Union[Unset, list[NewRoleDataAttributesFormFieldsPermissionsItem]]): + functionalities_permissions (Union[Unset, list[NewRoleDataAttributesFunctionalitiesPermissionsItem]]): + groups_permissions (Union[Unset, list[NewRoleDataAttributesGroupsPermissionsItem]]): + incident_causes_permissions (Union[Unset, list[NewRoleDataAttributesIncidentCausesPermissionsItem]]): + incident_feedbacks_permissions (Union[Unset, list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem]]): + incident_roles_permissions (Union[Unset, list[NewRoleDataAttributesIncidentRolesPermissionsItem]]): + incident_types_permissions (Union[Unset, list[NewRoleDataAttributesIncidentTypesPermissionsItem]]): + incidents_permissions (Union[Unset, list[NewRoleDataAttributesIncidentsPermissionsItem]]): + integrations_permissions (Union[Unset, list[NewRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[NewRoleDataAttributesInvitationsPermissionsItem]]): + playbooks_permissions (Union[Unset, list[NewRoleDataAttributesPlaybooksPermissionsItem]]): + private_incidents_permissions (Union[Unset, list[NewRoleDataAttributesPrivateIncidentsPermissionsItem]]): + pulses_permissions (Union[Unset, list[NewRoleDataAttributesPulsesPermissionsItem]]): + retrospective_permissions (Union[Unset, list[NewRoleDataAttributesRetrospectivePermissionsItem]]): + roles_permissions (Union[Unset, list[NewRoleDataAttributesRolesPermissionsItem]]): + secrets_permissions (Union[Unset, list[NewRoleDataAttributesSecretsPermissionsItem]]): + services_permissions (Union[Unset, list[NewRoleDataAttributesServicesPermissionsItem]]): + severities_permissions (Union[Unset, list[NewRoleDataAttributesSeveritiesPermissionsItem]]): + status_pages_permissions (Union[Unset, list[NewRoleDataAttributesStatusPagesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[NewRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[NewRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[NewRoleDataAttributesCatalogsPermissionsItem]]): + sub_statuses_permissions (Union[Unset, list[NewRoleDataAttributesSubStatusesPermissionsItem]]): + edge_connector_permissions (Union[Unset, list[NewRoleDataAttributesEdgeConnectorPermissionsItem]]): + slas_permissions (Union[Unset, list[NewRoleDataAttributesSlasPermissionsItem]]): + paging_permissions (Union[Unset, list[NewRoleDataAttributesPagingPermissionsItem]]): + incident_communication_permissions (Union[Unset, + list[NewRoleDataAttributesIncidentCommunicationPermissionsItem]]): + communication_permissions (Union[Unset, list[NewRoleDataAttributesCommunicationPermissionsItem]]): """ name: str - incident_permission_set_id: None | str | Unset = UNSET - alerts_permissions: list[NewRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[NewRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[NewRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - billing_permissions: list[NewRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - environments_permissions: list[NewRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - form_fields_permissions: list[NewRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - functionalities_permissions: list[NewRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - groups_permissions: list[NewRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - incident_causes_permissions: list[NewRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - incident_feedbacks_permissions: list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - incident_roles_permissions: list[NewRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - incident_types_permissions: list[NewRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - incidents_permissions: list[NewRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - integrations_permissions: list[NewRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[NewRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - playbooks_permissions: list[NewRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - private_incidents_permissions: list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - pulses_permissions: list[NewRoleDataAttributesPulsesPermissionsItem] | Unset = UNSET - retrospective_permissions: list[NewRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - roles_permissions: list[NewRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - secrets_permissions: list[NewRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - services_permissions: list[NewRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - severities_permissions: list[NewRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - status_pages_permissions: list[NewRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[NewRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[NewRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[NewRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - sub_statuses_permissions: list[NewRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - edge_connector_permissions: list[NewRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - slas_permissions: list[NewRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - paging_permissions: list[NewRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - incident_communication_permissions: list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = UNSET - communication_permissions: list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET + slug: None | Unset | str = UNSET + incident_permission_set_id: None | Unset | str = UNSET + alerts_permissions: Unset | list[NewRoleDataAttributesAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[NewRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[NewRoleDataAttributesAuditsPermissionsItem] = UNSET + billing_permissions: Unset | list[NewRoleDataAttributesBillingPermissionsItem] = UNSET + environments_permissions: Unset | list[NewRoleDataAttributesEnvironmentsPermissionsItem] = UNSET + form_fields_permissions: Unset | list[NewRoleDataAttributesFormFieldsPermissionsItem] = UNSET + functionalities_permissions: Unset | list[NewRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + groups_permissions: Unset | list[NewRoleDataAttributesGroupsPermissionsItem] = UNSET + incident_causes_permissions: Unset | list[NewRoleDataAttributesIncidentCausesPermissionsItem] = UNSET + incident_feedbacks_permissions: Unset | list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] = UNSET + incident_roles_permissions: Unset | list[NewRoleDataAttributesIncidentRolesPermissionsItem] = UNSET + incident_types_permissions: Unset | list[NewRoleDataAttributesIncidentTypesPermissionsItem] = UNSET + incidents_permissions: Unset | list[NewRoleDataAttributesIncidentsPermissionsItem] = UNSET + integrations_permissions: Unset | list[NewRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[NewRoleDataAttributesInvitationsPermissionsItem] = UNSET + playbooks_permissions: Unset | list[NewRoleDataAttributesPlaybooksPermissionsItem] = UNSET + private_incidents_permissions: Unset | list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] = UNSET + pulses_permissions: Unset | list[NewRoleDataAttributesPulsesPermissionsItem] = UNSET + retrospective_permissions: Unset | list[NewRoleDataAttributesRetrospectivePermissionsItem] = UNSET + roles_permissions: Unset | list[NewRoleDataAttributesRolesPermissionsItem] = UNSET + secrets_permissions: Unset | list[NewRoleDataAttributesSecretsPermissionsItem] = UNSET + services_permissions: Unset | list[NewRoleDataAttributesServicesPermissionsItem] = UNSET + severities_permissions: Unset | list[NewRoleDataAttributesSeveritiesPermissionsItem] = UNSET + status_pages_permissions: Unset | list[NewRoleDataAttributesStatusPagesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[NewRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[NewRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[NewRoleDataAttributesCatalogsPermissionsItem] = UNSET + sub_statuses_permissions: Unset | list[NewRoleDataAttributesSubStatusesPermissionsItem] = UNSET + edge_connector_permissions: Unset | list[NewRoleDataAttributesEdgeConnectorPermissionsItem] = UNSET + slas_permissions: Unset | list[NewRoleDataAttributesSlasPermissionsItem] = UNSET + paging_permissions: Unset | list[NewRoleDataAttributesPagingPermissionsItem] = UNSET + incident_communication_permissions: Unset | list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] = UNSET + communication_permissions: Unset | list[NewRoleDataAttributesCommunicationPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - incident_permission_set_id: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + incident_permission_set_id: None | Unset | str if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: incident_permission_set_id = self.incident_permission_set_id - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: list[str] | Unset = UNSET + billing_permissions: Unset | list[str] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: list[str] | Unset = UNSET + environments_permissions: Unset | list[str] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: list[str] | Unset = UNSET + form_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: list[str] | Unset = UNSET + incident_causes_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: list[str] | Unset = UNSET + incident_feedbacks_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: list[str] | Unset = UNSET + incident_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: list[str] | Unset = UNSET + incident_types_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: list[str] | Unset = UNSET + incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: list[str] | Unset = UNSET + playbooks_permissions: Unset | list[str] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: list[str] | Unset = UNSET + private_incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - pulses_permissions: list[str] | Unset = UNSET + pulses_permissions: Unset | list[str] = UNSET if not isinstance(self.pulses_permissions, Unset): pulses_permissions = [] for pulses_permissions_item_data in self.pulses_permissions: pulses_permissions_item: str = pulses_permissions_item_data pulses_permissions.append(pulses_permissions_item) - retrospective_permissions: list[str] | Unset = UNSET + retrospective_permissions: Unset | list[str] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: list[str] | Unset = UNSET + roles_permissions: Unset | list[str] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: list[str] | Unset = UNSET + secrets_permissions: Unset | list[str] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: list[str] | Unset = UNSET + severities_permissions: Unset | list[str] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: list[str] | Unset = UNSET + status_pages_permissions: Unset | list[str] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: list[str] | Unset = UNSET + sub_statuses_permissions: Unset | list[str] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: list[str] | Unset = UNSET + edge_connector_permissions: Unset | list[str] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: list[str] | Unset = UNSET + slas_permissions: Unset | list[str] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: list[str] | Unset = UNSET + paging_permissions: Unset | list[str] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: list[str] | Unset = UNSET + incident_communication_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: list[str] | Unset = UNSET + communication_permissions: Unset | list[str] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -466,6 +475,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if incident_permission_set_id is not UNSET: field_dict["incident_permission_set_id"] = incident_permission_set_id if alerts_permissions is not UNSET: @@ -542,384 +553,322 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_incident_permission_set_id(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_incident_permission_set_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[NewRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_new_role_data_attributes_alerts_permissions_item( - alerts_permissions_item_data - ) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_new_role_data_attributes_alerts_permissions_item( + alerts_permissions_item_data + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[NewRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_new_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_new_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[NewRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_new_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_new_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - billing_permissions: list[NewRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - if _billing_permissions is not UNSET: - billing_permissions = [] - for billing_permissions_item_data in _billing_permissions: - billing_permissions_item = check_new_role_data_attributes_billing_permissions_item( - billing_permissions_item_data - ) + for billing_permissions_item_data in _billing_permissions or []: + billing_permissions_item = check_new_role_data_attributes_billing_permissions_item( + billing_permissions_item_data + ) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) + environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - environments_permissions: list[NewRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - if _environments_permissions is not UNSET: - environments_permissions = [] - for environments_permissions_item_data in _environments_permissions: - environments_permissions_item = check_new_role_data_attributes_environments_permissions_item( - environments_permissions_item_data - ) + for environments_permissions_item_data in _environments_permissions or []: + environments_permissions_item = check_new_role_data_attributes_environments_permissions_item( + environments_permissions_item_data + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) + form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - form_fields_permissions: list[NewRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - if _form_fields_permissions is not UNSET: - form_fields_permissions = [] - for form_fields_permissions_item_data in _form_fields_permissions: - form_fields_permissions_item = check_new_role_data_attributes_form_fields_permissions_item( - form_fields_permissions_item_data - ) + for form_fields_permissions_item_data in _form_fields_permissions or []: + form_fields_permissions_item = check_new_role_data_attributes_form_fields_permissions_item( + form_fields_permissions_item_data + ) - form_fields_permissions.append(form_fields_permissions_item) + form_fields_permissions.append(form_fields_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[NewRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_new_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_new_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[NewRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_new_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_new_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - incident_causes_permissions: list[NewRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - if _incident_causes_permissions is not UNSET: - incident_causes_permissions = [] - for incident_causes_permissions_item_data in _incident_causes_permissions: - incident_causes_permissions_item = check_new_role_data_attributes_incident_causes_permissions_item( - incident_causes_permissions_item_data - ) + for incident_causes_permissions_item_data in _incident_causes_permissions or []: + incident_causes_permissions_item = check_new_role_data_attributes_incident_causes_permissions_item( + incident_causes_permissions_item_data + ) - incident_causes_permissions.append(incident_causes_permissions_item) + incident_causes_permissions.append(incident_causes_permissions_item) + incident_feedbacks_permissions = [] _incident_feedbacks_permissions = d.pop("incident_feedbacks_permissions", UNSET) - incident_feedbacks_permissions: list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - if _incident_feedbacks_permissions is not UNSET: - incident_feedbacks_permissions = [] - for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions: - incident_feedbacks_permissions_item = ( - check_new_role_data_attributes_incident_feedbacks_permissions_item( - incident_feedbacks_permissions_item_data - ) - ) + for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions or []: + incident_feedbacks_permissions_item = check_new_role_data_attributes_incident_feedbacks_permissions_item( + incident_feedbacks_permissions_item_data + ) - incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_roles_permissions = [] _incident_roles_permissions = d.pop("incident_roles_permissions", UNSET) - incident_roles_permissions: list[NewRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - if _incident_roles_permissions is not UNSET: - incident_roles_permissions = [] - for incident_roles_permissions_item_data in _incident_roles_permissions: - incident_roles_permissions_item = check_new_role_data_attributes_incident_roles_permissions_item( - incident_roles_permissions_item_data - ) + for incident_roles_permissions_item_data in _incident_roles_permissions or []: + incident_roles_permissions_item = check_new_role_data_attributes_incident_roles_permissions_item( + incident_roles_permissions_item_data + ) - incident_roles_permissions.append(incident_roles_permissions_item) + incident_roles_permissions.append(incident_roles_permissions_item) + incident_types_permissions = [] _incident_types_permissions = d.pop("incident_types_permissions", UNSET) - incident_types_permissions: list[NewRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - if _incident_types_permissions is not UNSET: - incident_types_permissions = [] - for incident_types_permissions_item_data in _incident_types_permissions: - incident_types_permissions_item = check_new_role_data_attributes_incident_types_permissions_item( - incident_types_permissions_item_data - ) + for incident_types_permissions_item_data in _incident_types_permissions or []: + incident_types_permissions_item = check_new_role_data_attributes_incident_types_permissions_item( + incident_types_permissions_item_data + ) - incident_types_permissions.append(incident_types_permissions_item) + incident_types_permissions.append(incident_types_permissions_item) + incidents_permissions = [] _incidents_permissions = d.pop("incidents_permissions", UNSET) - incidents_permissions: list[NewRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - if _incidents_permissions is not UNSET: - incidents_permissions = [] - for incidents_permissions_item_data in _incidents_permissions: - incidents_permissions_item = check_new_role_data_attributes_incidents_permissions_item( - incidents_permissions_item_data - ) + for incidents_permissions_item_data in _incidents_permissions or []: + incidents_permissions_item = check_new_role_data_attributes_incidents_permissions_item( + incidents_permissions_item_data + ) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[NewRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_new_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_new_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[NewRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_new_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_new_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - playbooks_permissions: list[NewRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - if _playbooks_permissions is not UNSET: - playbooks_permissions = [] - for playbooks_permissions_item_data in _playbooks_permissions: - playbooks_permissions_item = check_new_role_data_attributes_playbooks_permissions_item( - playbooks_permissions_item_data - ) + for playbooks_permissions_item_data in _playbooks_permissions or []: + playbooks_permissions_item = check_new_role_data_attributes_playbooks_permissions_item( + playbooks_permissions_item_data + ) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) + private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - private_incidents_permissions: list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - if _private_incidents_permissions is not UNSET: - private_incidents_permissions = [] - for private_incidents_permissions_item_data in _private_incidents_permissions: - private_incidents_permissions_item = check_new_role_data_attributes_private_incidents_permissions_item( - private_incidents_permissions_item_data - ) + for private_incidents_permissions_item_data in _private_incidents_permissions or []: + private_incidents_permissions_item = check_new_role_data_attributes_private_incidents_permissions_item( + private_incidents_permissions_item_data + ) - private_incidents_permissions.append(private_incidents_permissions_item) + private_incidents_permissions.append(private_incidents_permissions_item) + pulses_permissions = [] _pulses_permissions = d.pop("pulses_permissions", UNSET) - pulses_permissions: list[NewRoleDataAttributesPulsesPermissionsItem] | Unset = UNSET - if _pulses_permissions is not UNSET: - pulses_permissions = [] - for pulses_permissions_item_data in _pulses_permissions: - pulses_permissions_item = check_new_role_data_attributes_pulses_permissions_item( - pulses_permissions_item_data - ) + for pulses_permissions_item_data in _pulses_permissions or []: + pulses_permissions_item = check_new_role_data_attributes_pulses_permissions_item( + pulses_permissions_item_data + ) - pulses_permissions.append(pulses_permissions_item) + pulses_permissions.append(pulses_permissions_item) + retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - retrospective_permissions: list[NewRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - if _retrospective_permissions is not UNSET: - retrospective_permissions = [] - for retrospective_permissions_item_data in _retrospective_permissions: - retrospective_permissions_item = check_new_role_data_attributes_retrospective_permissions_item( - retrospective_permissions_item_data - ) + for retrospective_permissions_item_data in _retrospective_permissions or []: + retrospective_permissions_item = check_new_role_data_attributes_retrospective_permissions_item( + retrospective_permissions_item_data + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) + roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - roles_permissions: list[NewRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - if _roles_permissions is not UNSET: - roles_permissions = [] - for roles_permissions_item_data in _roles_permissions: - roles_permissions_item = check_new_role_data_attributes_roles_permissions_item( - roles_permissions_item_data - ) + for roles_permissions_item_data in _roles_permissions or []: + roles_permissions_item = check_new_role_data_attributes_roles_permissions_item(roles_permissions_item_data) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) + secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - secrets_permissions: list[NewRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - if _secrets_permissions is not UNSET: - secrets_permissions = [] - for secrets_permissions_item_data in _secrets_permissions: - secrets_permissions_item = check_new_role_data_attributes_secrets_permissions_item( - secrets_permissions_item_data - ) + for secrets_permissions_item_data in _secrets_permissions or []: + secrets_permissions_item = check_new_role_data_attributes_secrets_permissions_item( + secrets_permissions_item_data + ) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[NewRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_new_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_new_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - severities_permissions: list[NewRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - if _severities_permissions is not UNSET: - severities_permissions = [] - for severities_permissions_item_data in _severities_permissions: - severities_permissions_item = check_new_role_data_attributes_severities_permissions_item( - severities_permissions_item_data - ) + for severities_permissions_item_data in _severities_permissions or []: + severities_permissions_item = check_new_role_data_attributes_severities_permissions_item( + severities_permissions_item_data + ) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) + status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - status_pages_permissions: list[NewRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - if _status_pages_permissions is not UNSET: - status_pages_permissions = [] - for status_pages_permissions_item_data in _status_pages_permissions: - status_pages_permissions_item = check_new_role_data_attributes_status_pages_permissions_item( - status_pages_permissions_item_data - ) + for status_pages_permissions_item_data in _status_pages_permissions or []: + status_pages_permissions_item = check_new_role_data_attributes_status_pages_permissions_item( + status_pages_permissions_item_data + ) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[NewRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_new_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_new_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[NewRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_new_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_new_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[NewRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_new_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_new_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) + sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - sub_statuses_permissions: list[NewRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - if _sub_statuses_permissions is not UNSET: - sub_statuses_permissions = [] - for sub_statuses_permissions_item_data in _sub_statuses_permissions: - sub_statuses_permissions_item = check_new_role_data_attributes_sub_statuses_permissions_item( - sub_statuses_permissions_item_data - ) + for sub_statuses_permissions_item_data in _sub_statuses_permissions or []: + sub_statuses_permissions_item = check_new_role_data_attributes_sub_statuses_permissions_item( + sub_statuses_permissions_item_data + ) - sub_statuses_permissions.append(sub_statuses_permissions_item) + sub_statuses_permissions.append(sub_statuses_permissions_item) + edge_connector_permissions = [] _edge_connector_permissions = d.pop("edge_connector_permissions", UNSET) - edge_connector_permissions: list[NewRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - if _edge_connector_permissions is not UNSET: - edge_connector_permissions = [] - for edge_connector_permissions_item_data in _edge_connector_permissions: - edge_connector_permissions_item = check_new_role_data_attributes_edge_connector_permissions_item( - edge_connector_permissions_item_data - ) + for edge_connector_permissions_item_data in _edge_connector_permissions or []: + edge_connector_permissions_item = check_new_role_data_attributes_edge_connector_permissions_item( + edge_connector_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - slas_permissions: list[NewRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - if _slas_permissions is not UNSET: - slas_permissions = [] - for slas_permissions_item_data in _slas_permissions: - slas_permissions_item = check_new_role_data_attributes_slas_permissions_item(slas_permissions_item_data) + for slas_permissions_item_data in _slas_permissions or []: + slas_permissions_item = check_new_role_data_attributes_slas_permissions_item(slas_permissions_item_data) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) + paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - paging_permissions: list[NewRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - if _paging_permissions is not UNSET: - paging_permissions = [] - for paging_permissions_item_data in _paging_permissions: - paging_permissions_item = check_new_role_data_attributes_paging_permissions_item( - paging_permissions_item_data - ) + for paging_permissions_item_data in _paging_permissions or []: + paging_permissions_item = check_new_role_data_attributes_paging_permissions_item( + paging_permissions_item_data + ) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) + incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - incident_communication_permissions: list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = ( - UNSET - ) - if _incident_communication_permissions is not UNSET: - incident_communication_permissions = [] - for incident_communication_permissions_item_data in _incident_communication_permissions: - incident_communication_permissions_item = ( - check_new_role_data_attributes_incident_communication_permissions_item( - incident_communication_permissions_item_data - ) + for incident_communication_permissions_item_data in _incident_communication_permissions or []: + incident_communication_permissions_item = ( + check_new_role_data_attributes_incident_communication_permissions_item( + incident_communication_permissions_item_data ) + ) - incident_communication_permissions.append(incident_communication_permissions_item) + incident_communication_permissions.append(incident_communication_permissions_item) + communication_permissions = [] _communication_permissions = d.pop("communication_permissions", UNSET) - communication_permissions: list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET - if _communication_permissions is not UNSET: - communication_permissions = [] - for communication_permissions_item_data in _communication_permissions: - communication_permissions_item = check_new_role_data_attributes_communication_permissions_item( - communication_permissions_item_data - ) + for communication_permissions_item_data in _communication_permissions or []: + communication_permissions_item = check_new_role_data_attributes_communication_permissions_item( + communication_permissions_item_data + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) new_role_data_attributes = cls( name=name, + slug=slug, incident_permission_set_id=incident_permission_set_id, alerts_permissions=alerts_permissions, api_keys_permissions=api_keys_permissions, diff --git a/rootly_sdk/models/new_schedule.py b/rootly_sdk/models/new_schedule.py index b82c394e..27b30e61 100644 --- a/rootly_sdk/models/new_schedule.py +++ b/rootly_sdk/models/new_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSchedule: data (NewScheduleData): """ - data: NewScheduleData + data: "NewScheduleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_schedule_data.py b/rootly_sdk/models/new_schedule_data.py index 04b89e20..099fc2e5 100644 --- a/rootly_sdk/models/new_schedule_data.py +++ b/rootly_sdk/models/new_schedule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewScheduleData: """ type_: NewScheduleDataType - attributes: NewScheduleDataAttributes + attributes: "NewScheduleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_schedule_data_attributes.py b/rootly_sdk/models/new_schedule_data_attributes.py index 9495aef6..99d05545 100644 --- a/rootly_sdk/models/new_schedule_data_attributes.py +++ b/rootly_sdk/models/new_schedule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -25,43 +23,43 @@ class NewScheduleDataAttributes: Attributes: name (str): The name of the schedule owner_user_id (int): ID of the owner of the schedule - description (None | str | Unset): The description of the schedule - all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule - slack_user_group (NewScheduleDataAttributesSlackUserGroup | Unset): - slack_channel (NewScheduleDataAttributesSlackChannelType0 | None | Unset): - owner_group_ids (list[str] | Unset): Owning teams. - sync_linear_enabled (bool | None | Unset): Whether the schedule is synced with Linear - include_shadows_in_slack_notifications (bool | None | Unset): Whether shadow users are included in Slack + description (Union[None, Unset, str]): The description of the schedule + all_time_coverage (Union[None, Unset, bool]): 24/7 coverage of the schedule + slack_user_group (Union[Unset, NewScheduleDataAttributesSlackUserGroup]): + slack_channel (Union['NewScheduleDataAttributesSlackChannelType0', None, Unset]): + owner_group_ids (Union[Unset, list[str]]): Owning teams. + sync_linear_enabled (Union[None, Unset, bool]): Whether the schedule is synced with Linear + include_shadows_in_slack_notifications (Union[None, Unset, bool]): Whether shadow users are included in Slack notifications and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_start_notifications_enabled (bool | None | Unset): Whether shift-start notifications are enabled. Requires - `slack_channel` to be set; otherwise this value is forced to false on save. - shift_update_notifications_enabled (bool | None | Unset): Whether shift-update notifications are enabled. + shift_start_notifications_enabled (Union[None, Unset, bool]): Whether shift-start notifications are enabled. + Requires `slack_channel` to be set; otherwise this value is forced to false on save. + shift_update_notifications_enabled (Union[None, Unset, bool]): Whether shift-update notifications are enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (bool | None | Unset): Whether the weekly shift summary report is enabled. Requires + shift_report_enabled (Union[None, Unset, bool]): Whether the weekly shift summary report is enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_day_of_week (NewScheduleDataAttributesShiftReportDayOfWeek | Unset): Day of week the weekly shift - summary is sent - shift_report_time_of_day (None | str | Unset): Time of day the weekly shift summary is sent, in HH:MM 24-hour - format - shift_report_time_zone (None | str | Unset): IANA time zone used for the weekly shift summary + shift_report_day_of_week (Union[Unset, NewScheduleDataAttributesShiftReportDayOfWeek]): Day of week the weekly + shift summary is sent + shift_report_time_of_day (Union[None, Unset, str]): Time of day the weekly shift summary is sent, in HH:MM + 24-hour format + shift_report_time_zone (Union[None, Unset, str]): IANA time zone used for the weekly shift summary """ name: str owner_user_id: int - description: None | str | Unset = UNSET - all_time_coverage: bool | None | Unset = UNSET - slack_user_group: NewScheduleDataAttributesSlackUserGroup | Unset = UNSET - slack_channel: NewScheduleDataAttributesSlackChannelType0 | None | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - sync_linear_enabled: bool | None | Unset = UNSET - include_shadows_in_slack_notifications: bool | None | Unset = UNSET - shift_start_notifications_enabled: bool | None | Unset = UNSET - shift_update_notifications_enabled: bool | None | Unset = UNSET - shift_report_enabled: bool | None | Unset = UNSET - shift_report_day_of_week: NewScheduleDataAttributesShiftReportDayOfWeek | Unset = UNSET - shift_report_time_of_day: None | str | Unset = UNSET - shift_report_time_zone: None | str | Unset = UNSET + description: None | Unset | str = UNSET + all_time_coverage: None | Unset | bool = UNSET + slack_user_group: Union[Unset, "NewScheduleDataAttributesSlackUserGroup"] = UNSET + slack_channel: Union["NewScheduleDataAttributesSlackChannelType0", None, Unset] = UNSET + owner_group_ids: Unset | list[str] = UNSET + sync_linear_enabled: None | Unset | bool = UNSET + include_shadows_in_slack_notifications: None | Unset | bool = UNSET + shift_start_notifications_enabled: None | Unset | bool = UNSET + shift_update_notifications_enabled: None | Unset | bool = UNSET + shift_report_enabled: None | Unset | bool = UNSET + shift_report_day_of_week: Unset | NewScheduleDataAttributesShiftReportDayOfWeek = UNSET + shift_report_time_of_day: None | Unset | str = UNSET + shift_report_time_zone: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_schedule_data_attributes_slack_channel_type_0 import ( @@ -72,23 +70,23 @@ def to_dict(self) -> dict[str, Any]: owner_user_id = self.owner_user_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: bool | None | Unset + all_time_coverage: None | Unset | bool if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: dict[str, Any] | Unset = UNSET + slack_user_group: Unset | dict[str, Any] = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: dict[str, Any] | None | Unset + slack_channel: None | Unset | dict[str, Any] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, NewScheduleDataAttributesSlackChannelType0): @@ -96,51 +94,51 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - sync_linear_enabled: bool | None | Unset + sync_linear_enabled: None | Unset | bool if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: bool | None | Unset + include_shadows_in_slack_notifications: None | Unset | bool if isinstance(self.include_shadows_in_slack_notifications, Unset): include_shadows_in_slack_notifications = UNSET else: include_shadows_in_slack_notifications = self.include_shadows_in_slack_notifications - shift_start_notifications_enabled: bool | None | Unset + shift_start_notifications_enabled: None | Unset | bool if isinstance(self.shift_start_notifications_enabled, Unset): shift_start_notifications_enabled = UNSET else: shift_start_notifications_enabled = self.shift_start_notifications_enabled - shift_update_notifications_enabled: bool | None | Unset + shift_update_notifications_enabled: None | Unset | bool if isinstance(self.shift_update_notifications_enabled, Unset): shift_update_notifications_enabled = UNSET else: shift_update_notifications_enabled = self.shift_update_notifications_enabled - shift_report_enabled: bool | None | Unset + shift_report_enabled: None | Unset | bool if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: str | Unset = UNSET + shift_report_day_of_week: Unset | str = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week - shift_report_time_of_day: None | str | Unset + shift_report_time_of_day: None | Unset | str if isinstance(self.shift_report_time_of_day, Unset): shift_report_time_of_day = UNSET else: shift_report_time_of_day = self.shift_report_time_of_day - shift_report_time_zone: None | str | Unset + shift_report_time_zone: None | Unset | str if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: @@ -195,32 +193,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owner_user_id = d.pop("owner_user_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> bool | None | Unset: + def _parse_all_time_coverage(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: NewScheduleDataAttributesSlackUserGroup | Unset + slack_user_group: Unset | NewScheduleDataAttributesSlackUserGroup if isinstance(_slack_user_group, Unset): slack_user_group = UNSET else: slack_user_group = NewScheduleDataAttributesSlackUserGroup.from_dict(_slack_user_group) - def _parse_slack_channel(data: object) -> NewScheduleDataAttributesSlackChannelType0 | None | Unset: + def _parse_slack_channel(data: object) -> Union["NewScheduleDataAttributesSlackChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -231,67 +229,67 @@ def _parse_slack_channel(data: object) -> NewScheduleDataAttributesSlackChannelT slack_channel_type_0 = NewScheduleDataAttributesSlackChannelType0.from_dict(data) return slack_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewScheduleDataAttributesSlackChannelType0 | None | Unset, data) + return cast(Union["NewScheduleDataAttributesSlackChannelType0", None, Unset], data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_sync_linear_enabled(data: object) -> bool | None | Unset: + def _parse_sync_linear_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> bool | None | Unset: + def _parse_include_shadows_in_slack_notifications(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) include_shadows_in_slack_notifications = _parse_include_shadows_in_slack_notifications( d.pop("include_shadows_in_slack_notifications", UNSET) ) - def _parse_shift_start_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_start_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) shift_start_notifications_enabled = _parse_shift_start_notifications_enabled( d.pop("shift_start_notifications_enabled", UNSET) ) - def _parse_shift_update_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_update_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> bool | None | Unset: + def _parse_shift_report_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) shift_report_enabled = _parse_shift_report_enabled(d.pop("shift_report_enabled", UNSET)) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: NewScheduleDataAttributesShiftReportDayOfWeek | Unset + shift_report_day_of_week: Unset | NewScheduleDataAttributesShiftReportDayOfWeek if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -299,21 +297,21 @@ def _parse_shift_report_enabled(data: object) -> bool | None | Unset: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> None | str | Unset: + def _parse_shift_report_time_of_day(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shift_report_time_of_day = _parse_shift_report_time_of_day(d.pop("shift_report_time_of_day", UNSET)) - def _parse_shift_report_time_zone(data: object) -> None | str | Unset: + def _parse_shift_report_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) diff --git a/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py b/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py index 7ba412f5..88d154f3 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py +++ b/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class NewScheduleDataAttributesSlackChannelType0: """ Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py index 14467737..cf79f8e0 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py +++ b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class NewScheduleDataAttributesSlackUserGroup: """ Attributes: - id (str | Unset): Slack user group ID - name (str | Unset): Slack user group name + id (Union[Unset, str]): Slack user group ID + name (Union[Unset, str]): Slack user group name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation.py b/rootly_sdk/models/new_schedule_rotation.py index 8aee39c4..307e1325 100644 --- a/rootly_sdk/models/new_schedule_rotation.py +++ b/rootly_sdk/models/new_schedule_rotation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewScheduleRotation: data (NewScheduleRotationData): """ - data: NewScheduleRotationData + data: "NewScheduleRotationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_schedule_rotation_active_day.py b/rootly_sdk/models/new_schedule_rotation_active_day.py index 864d684e..d6df5007 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewScheduleRotationActiveDay: data (NewScheduleRotationActiveDayData): """ - data: NewScheduleRotationActiveDayData + data: "NewScheduleRotationActiveDayData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data.py b/rootly_sdk/models/new_schedule_rotation_active_day_data.py index 50b7ea10..1d357cf3 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewScheduleRotationActiveDayData: """ type_: NewScheduleRotationActiveDayDataType - attributes: NewScheduleRotationActiveDayDataAttributes + attributes: "NewScheduleRotationActiveDayDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py index 5c90b1da..80542d68 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,15 +23,14 @@ class NewScheduleRotationActiveDayDataAttributes: Attributes: day_name (NewScheduleRotationActiveDayDataAttributesDayName): Schedule rotation day name for which active times to be created - active_time_attributes (list[NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem]): Schedule + active_time_attributes (list['NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem']): Schedule rotation active times per day """ day_name: NewScheduleRotationActiveDayDataAttributesDayName - active_time_attributes: list[NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] + active_time_attributes: list["NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] def to_dict(self) -> dict[str, Any]: - day_name: str = self.day_name active_time_attributes = [] diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py index de2a9d11..b99cbf6b 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: """ Attributes: - start_time (str | Unset): Start time for schedule rotation active time - end_time (str | Unset): End time for schedule rotation active time + start_time (Union[Unset, str]): Start time for schedule rotation active time + end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_data.py b/rootly_sdk/models/new_schedule_rotation_data.py index 98a6852d..e505b64a 100644 --- a/rootly_sdk/models/new_schedule_rotation_data.py +++ b/rootly_sdk/models/new_schedule_rotation_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewScheduleRotationData: """ type_: NewScheduleRotationDataType - attributes: NewScheduleRotationDataAttributes + attributes: "NewScheduleRotationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_data_attributes.py index 58de8732..726f5b1a 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -47,43 +45,44 @@ class NewScheduleRotationDataAttributes: Attributes: name (str): The name of the schedule rotation schedule_rotationable_type (NewScheduleRotationDataAttributesScheduleRotationableType): Schedule rotation type - schedule_rotationable_attributes (NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 | - NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 | - NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 | - NewScheduleRotationDataAttributesScheduleRotationableAttributesType3): - position (int | Unset): Position of the schedule rotation - active_all_week (bool | Unset): Schedule rotation active all week? Default: True. - active_days (list[NewScheduleRotationDataAttributesActiveDaysItem] | Unset): - active_time_type (str | Unset): - active_time_attributes (list[NewScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset): Schedule - rotation's active times - time_zone (str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be + schedule_rotationable_attributes (Union['NewScheduleRotationDataAttributesScheduleRotationableAttributesType0', + 'NewScheduleRotationDataAttributesScheduleRotationableAttributesType1', + 'NewScheduleRotationDataAttributesScheduleRotationableAttributesType2', + 'NewScheduleRotationDataAttributesScheduleRotationableAttributesType3']): + position (Union[Unset, int]): Position of the schedule rotation + active_all_week (Union[Unset, bool]): Schedule rotation active all week? Default: True. + active_days (Union[Unset, list[NewScheduleRotationDataAttributesActiveDaysItem]]): + active_time_type (Union[Unset, str]): + active_time_attributes (Union[Unset, list['NewScheduleRotationDataAttributesActiveTimeAttributesItem']]): + Schedule rotation's active times + time_zone (Union[Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + start_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation ends. Shifts will only be created - before this time. - schedule_rotation_members (list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | - Unset): You can only add schedule rotation members if your account has schedule nesting feature enabled + end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be + created before this time. + schedule_rotation_members (Union[None, Unset, + list['NewScheduleRotationDataAttributesScheduleRotationMembersType0Item']]): You can only add schedule rotation + members if your account has schedule nesting feature enabled """ name: str schedule_rotationable_type: NewScheduleRotationDataAttributesScheduleRotationableType - schedule_rotationable_attributes: ( - NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ) - position: int | Unset = UNSET - active_all_week: bool | Unset = True - active_days: list[NewScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - active_time_type: str | Unset = UNSET - active_time_attributes: list[NewScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - time_zone: str | Unset = "Etc/UTC" - start_time: datetime.datetime | None | Unset = UNSET - end_time: datetime.datetime | None | Unset = UNSET + schedule_rotationable_attributes: Union[ + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType3", + ] + position: Unset | int = UNSET + active_all_week: Unset | bool = True + active_days: Unset | list[NewScheduleRotationDataAttributesActiveDaysItem] = UNSET + active_time_type: Unset | str = UNSET + active_time_attributes: Unset | list["NewScheduleRotationDataAttributesActiveTimeAttributesItem"] = UNSET + time_zone: Unset | str = "Etc/UTC" + start_time: None | Unset | datetime.datetime = UNSET + end_time: None | Unset | datetime.datetime = UNSET schedule_rotation_members: ( - list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset + None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"] ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -121,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: list[str] | Unset = UNSET + active_days: Unset | list[str] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -130,7 +129,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -139,7 +138,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: None | str | Unset + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -147,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | str | Unset + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -155,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: list[dict[str, Any]] | None | Unset + schedule_rotation_members: None | Unset | list[dict[str, Any]] if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -227,12 +226,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_schedule_rotationable_attributes( data: object, - ) -> ( - NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ): + ) -> Union[ + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType3", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -241,7 +240,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -251,7 +250,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -261,7 +260,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -279,31 +278,27 @@ def _parse_schedule_rotationable_attributes( active_all_week = d.pop("active_all_week", UNSET) + active_days = [] _active_days = d.pop("active_days", UNSET) - active_days: list[NewScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - if _active_days is not UNSET: - active_days = [] - for active_days_item_data in _active_days: - active_days_item = check_new_schedule_rotation_data_attributes_active_days_item(active_days_item_data) + for active_days_item_data in _active_days or []: + active_days_item = check_new_schedule_rotation_data_attributes_active_days_item(active_days_item_data) - active_days.append(active_days_item) + active_days.append(active_days_item) active_time_type = d.pop("active_time_type", UNSET) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[NewScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = NewScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = NewScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) time_zone = d.pop("time_zone", UNSET) - def _parse_start_time(data: object) -> datetime.datetime | None | Unset: + def _parse_start_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -314,13 +309,13 @@ def _parse_start_time(data: object) -> datetime.datetime | None | Unset: start_time_type_0 = isoparse(data) return start_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> datetime.datetime | None | Unset: + def _parse_end_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -331,15 +326,15 @@ def _parse_end_time(data: object) -> datetime.datetime | None | Unset: end_time_type_0 = isoparse(data) return end_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset: + ) -> None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -359,9 +354,9 @@ def _parse_schedule_rotation_members( schedule_rotation_members_type_0.append(schedule_rotation_members_type_0_item) return schedule_rotation_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset, data) + return cast(None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"], data) schedule_rotation_members = _parse_schedule_rotation_members(d.pop("schedule_rotation_members", UNSET)) diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py index ea904017..537d6cc7 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py index a92b1c18..7d563c07 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class NewScheduleRotationDataAttributesScheduleRotationMembersType0Item: Attributes: member_type (NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType): Type of member member_id (str): ID of the member - position (int | Unset): Position of the member in rotation + position (Union[Unset, int]): Position of the member in rotation """ member_type: NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: int | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py index 449f524c..eefc9fec 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py index e9acdcbb..072117a6 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py index 138831b9..a360a993 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py index 2f076f7f..3aeaa7eb 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_user.py b/rootly_sdk/models/new_schedule_rotation_user.py index a6ff2183..70c1f040 100644 --- a/rootly_sdk/models/new_schedule_rotation_user.py +++ b/rootly_sdk/models/new_schedule_rotation_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class NewScheduleRotationUser: """ Attributes: - data (NewScheduleRotationUserData | Unset): + data (Union[Unset, NewScheduleRotationUserData]): """ - data: NewScheduleRotationUserData | Unset = UNSET + data: Union[Unset, "NewScheduleRotationUserData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: NewScheduleRotationUserData | Unset + data: Unset | NewScheduleRotationUserData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/new_schedule_rotation_user_data.py b/rootly_sdk/models/new_schedule_rotation_user_data.py index e7939952..45266c80 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,21 +21,20 @@ class NewScheduleRotationUserData: """ Attributes: - type_ (NewScheduleRotationUserDataType | Unset): - attributes (NewScheduleRotationUserDataAttributes | Unset): + type_ (Union[Unset, NewScheduleRotationUserDataType]): + attributes (Union[Unset, NewScheduleRotationUserDataAttributes]): """ - type_: NewScheduleRotationUserDataType | Unset = UNSET - attributes: NewScheduleRotationUserDataAttributes | Unset = UNSET + type_: Unset | NewScheduleRotationUserDataType = UNSET + attributes: Union[Unset, "NewScheduleRotationUserDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -57,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: NewScheduleRotationUserDataType | Unset + type_: Unset | NewScheduleRotationUserDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_schedule_rotation_user_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: NewScheduleRotationUserDataAttributes | Unset + attributes: Unset | NewScheduleRotationUserDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py index 0c5bb168..ce6d4a42 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,11 +13,11 @@ class NewScheduleRotationUserDataAttributes: """ Attributes: user_id (int): Schedule rotation user - position (int | Unset): Position of the user inside rotation + position (Union[Unset, int]): Position of the user inside rotation """ user_id: int - position: int | Unset = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/new_secret.py b/rootly_sdk/models/new_secret.py index 159467a5..ce538bb4 100644 --- a/rootly_sdk/models/new_secret.py +++ b/rootly_sdk/models/new_secret.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSecret: data (NewSecretData): """ - data: NewSecretData + data: "NewSecretData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_secret_data.py b/rootly_sdk/models/new_secret_data.py index 39ddaac2..8afbb5d3 100644 --- a/rootly_sdk/models/new_secret_data.py +++ b/rootly_sdk/models/new_secret_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSecretData: """ type_: NewSecretDataType - attributes: NewSecretDataAttributes + attributes: "NewSecretDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_secret_data_attributes.py b/rootly_sdk/models/new_secret_data_attributes.py index 53d1dd68..47851d3b 100644 --- a/rootly_sdk/models/new_secret_data_attributes.py +++ b/rootly_sdk/models/new_secret_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,41 +15,41 @@ class NewSecretDataAttributes: Attributes: name (str): The name of the secret secret (str): The secret - kind (NewSecretDataAttributesKind | Unset): The kind of the secret - hashicorp_vault_mount (None | str | Unset): The HashiCorp Vault secret mount path Default: 'secret'. - hashicorp_vault_path (None | str | Unset): The HashiCorp Vault secret path - hashicorp_vault_version (None | str | Unset): The HashiCorp Vault secret version Default: '0'. + kind (Union[Unset, NewSecretDataAttributesKind]): The kind of the secret + hashicorp_vault_mount (Union[None, Unset, str]): The HashiCorp Vault secret mount path Default: 'secret'. + hashicorp_vault_path (Union[None, Unset, str]): The HashiCorp Vault secret path + hashicorp_vault_version (Union[None, Unset, str]): The HashiCorp Vault secret version Default: '0'. """ name: str secret: str - kind: NewSecretDataAttributesKind | Unset = UNSET - hashicorp_vault_mount: None | str | Unset = "secret" - hashicorp_vault_path: None | str | Unset = UNSET - hashicorp_vault_version: None | str | Unset = "0" + kind: Unset | NewSecretDataAttributesKind = UNSET + hashicorp_vault_mount: None | Unset | str = "secret" + hashicorp_vault_path: None | Unset | str = UNSET + hashicorp_vault_version: None | Unset | str = "0" def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - hashicorp_vault_mount: None | str | Unset + hashicorp_vault_mount: None | Unset | str if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | str | Unset + hashicorp_vault_path: None | Unset | str if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: None | str | Unset + hashicorp_vault_version: None | Unset | str if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: @@ -84,36 +82,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret") _kind = d.pop("kind", UNSET) - kind: NewSecretDataAttributesKind | Unset + kind: Unset | NewSecretDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_secret_data_attributes_kind(_kind) - def _parse_hashicorp_vault_mount(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_mount(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_version(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) diff --git a/rootly_sdk/models/new_service.py b/rootly_sdk/models/new_service.py index 85709594..6f97932c 100644 --- a/rootly_sdk/models/new_service.py +++ b/rootly_sdk/models/new_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewService: data (NewServiceData): """ - data: NewServiceData + data: "NewServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_service_data.py b/rootly_sdk/models/new_service_data.py index bfa03fd3..2e7856bd 100644 --- a/rootly_sdk/models/new_service_data.py +++ b/rootly_sdk/models/new_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewServiceData: """ type_: NewServiceDataType - attributes: NewServiceDataAttributes + attributes: "NewServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_service_data_attributes.py b/rootly_sdk/models/new_service_data_attributes.py index 2420ad46..6dda8535 100644 --- a/rootly_sdk/models/new_service_data_attributes.py +++ b/rootly_sdk/models/new_service_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -35,83 +33,90 @@ class NewServiceDataAttributes: """ Attributes: name (str): The name of the service - description (None | str | Unset): The description of the service - public_description (None | str | Unset): The public description of the service - notify_emails (list[str] | None | Unset): Emails to attach to the service - color (None | str | Unset): The hex color of the service - position (int | None | Unset): Position of the service - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (NewServiceDataAttributesShowUptimeLastDays | Unset): Show uptime over x days Default: 60. - backstage_id (None | str | Unset): The Backstage entity id associated to this service. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the service + public_description (Union[None, Unset, str]): The status page description of the service + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the service + color (Union[None, Unset, str]): The hex color of the service + position (Union[None, Unset, int]): Position of the service + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, NewServiceDataAttributesShowUptimeLastDays]): Show uptime over x days + Default: 60. + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this service. eg: :namespace/:kind/:entity_name - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this service - external_id (None | str | Unset): The external id associated to this service - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this service - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this service - cortex_id (None | str | Unset): The Cortex group id associated to this service - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this service - github_repository_name (None | str | Unset): The GitHub repository name associated to this service. eg: + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this service + external_id (Union[None, Unset, str]): The external id associated to this service + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this service + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this service + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this service + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this service + github_repository_name (Union[None, Unset, str]): The GitHub repository name associated to this service. eg: rootlyhq/my-service - github_repository_branch (None | str | Unset): The GitHub repository branch associated to this service. eg: main - gitlab_repository_name (None | str | Unset): The GitLab repository name associated to this service. eg: + github_repository_branch (Union[None, Unset, str]): The GitHub repository branch associated to this service. eg: + main + gitlab_repository_name (Union[None, Unset, str]): The GitLab repository name associated to this service. eg: rootlyhq/my-service - gitlab_repository_branch (None | str | Unset): The GitLab repository branch associated to this service. eg: main - environment_ids (list[str] | None | Unset): Environments associated with this service - service_ids (list[str] | None | Unset): Services dependent on this service - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this service - owner_user_ids (list[int] | None | Unset): Owner Users associated with this service - kubernetes_deployment_name (None | str | Unset): The Kubernetes deployment name associated to this service. eg: - namespace/deployment-name - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the service - escalation_policy_id (None | str | Unset): The escalation policy id of the service - slack_channels (list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated - with this service - slack_aliases (list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this service - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset): Slack channel - to broadcast incidents to - properties (list[NewServiceDataAttributesPropertiesItem] | Unset): Array of property values for this service. + gitlab_repository_branch (Union[None, Unset, str]): The GitLab repository branch associated to this service. eg: + main + environment_ids (Union[None, Unset, list[str]]): Environments associated with this service + service_ids (Union[None, Unset, list[str]]): Services dependent on this service + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this service + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this service + kubernetes_deployment_name (Union[None, Unset, str]): The Kubernetes deployment name associated to this service. + eg: namespace/deployment-name + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the service + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the service + slack_channels (Union[None, Unset, list['NewServiceDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this service + slack_aliases (Union[None, Unset, list['NewServiceDataAttributesSlackAliasesType0Item']]): Slack Aliases + associated with this service + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['NewServiceDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack + channel to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['NewServiceDataAttributesIncidentBroadcastChannelType0', None, Unset]): Slack + channel to broadcast incidents to + properties (Union[Unset, list['NewServiceDataAttributesPropertiesItem']]): Array of property values for this + service. """ name: str - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: NewServiceDataAttributesShowUptimeLastDays | Unset = 60 - backstage_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset = UNSET - properties: list[NewServiceDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | NewServiceDataAttributesShowUptimeLastDays = 60 + backstage_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET + alert_broadcast_channel: Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET + incident_broadcast_channel: Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + properties: Unset | list["NewServiceDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -123,19 +128,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -144,95 +155,95 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: None | str | Unset + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -241,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -250,7 +261,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -259,7 +270,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -268,31 +279,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | str | Unset + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -304,7 +315,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -316,13 +327,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewServiceDataAttributesAlertBroadcastChannelType0): @@ -330,13 +341,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewServiceDataAttributesIncidentBroadcastChannelType0): @@ -344,7 +355,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -358,6 +369,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if public_description is not UNSET: @@ -446,25 +459,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -475,146 +497,146 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: NewServiceDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Unset | NewServiceDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_new_service_data_attributes_show_uptime_last_days(_show_uptime_last_days) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -625,13 +647,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -642,13 +664,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -659,13 +681,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -676,49 +698,51 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels(data: object) -> list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -736,13 +760,15 @@ def _parse_slack_channels(data: object) -> list[NewServiceDataAttributesSlackCha slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -760,24 +786,24 @@ def _parse_slack_aliases(data: object) -> list[NewServiceDataAttributesSlackAlia slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset: + ) -> Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -788,24 +814,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = NewServiceDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset: + ) -> Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -818,23 +844,22 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewServiceDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewServiceDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewServiceDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_service_data_attributes = cls( name=name, + slug=slug, description=description, public_description=public_description, notify_emails=notify_emails, diff --git a/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py index 43dd3797..f7eeb8cc 100644 --- a/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class NewServiceDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py index 52b0f470..e28f2d61 100644 --- a/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class NewServiceDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_service_data_attributes_properties_item.py b/rootly_sdk/models/new_service_data_attributes_properties_item.py index 3110be0d..571f9034 100644 --- a/rootly_sdk/models/new_service_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_service_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py index 279bbaa6..02f2f04f 100644 --- a/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py index f7b9709a..b5522a5b 100644 --- a/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_severity.py b/rootly_sdk/models/new_severity.py index 261efd5e..8d22df8c 100644 --- a/rootly_sdk/models/new_severity.py +++ b/rootly_sdk/models/new_severity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSeverity: data (NewSeverityData): """ - data: NewSeverityData + data: "NewSeverityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_severity_data.py b/rootly_sdk/models/new_severity_data.py index b34b5cd8..6e2b73b3 100644 --- a/rootly_sdk/models/new_severity_data.py +++ b/rootly_sdk/models/new_severity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSeverityData: """ type_: NewSeverityDataType - attributes: NewSeverityDataAttributes + attributes: "NewSeverityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_severity_data_attributes.py b/rootly_sdk/models/new_severity_data_attributes.py index f90fa798..5a95537e 100644 --- a/rootly_sdk/models/new_severity_data_attributes.py +++ b/rootly_sdk/models/new_severity_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -28,53 +26,61 @@ class NewSeverityDataAttributes: """ Attributes: name (str): The name of the severity - description (None | str | Unset): The description of the severity - severity (NewSeverityDataAttributesSeverity | Unset): The severity of the severity - color (None | str | Unset): The hex color of the severity - position (int | None | Unset): Position of the severity - notify_emails (list[str] | None | Unset): Emails to attach to the severity - slack_channels (list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated - with this severity - slack_aliases (list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this severity + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the severity + severity (Union[Unset, NewSeverityDataAttributesSeverity]): The severity of the severity + color (Union[None, Unset, str]): The hex color of the severity + position (Union[None, Unset, int]): Position of the severity + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the severity + slack_channels (Union[None, Unset, list['NewSeverityDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this severity + slack_aliases (Union[None, Unset, list['NewSeverityDataAttributesSlackAliasesType0Item']]): Slack Aliases + associated with this severity """ name: str - description: None | str | Unset = UNSET - severity: NewSeverityDataAttributesSeverity | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + severity: Unset | NewSeverityDataAttributesSeverity = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: str | Unset = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -83,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -95,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -114,6 +120,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if severity is not UNSET: @@ -143,41 +151,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: NewSeverityDataAttributesSeverity | Unset + severity: Unset | NewSeverityDataAttributesSeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_new_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -188,13 +205,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -212,13 +231,15 @@ def _parse_slack_channels(data: object) -> list[NewSeverityDataAttributesSlackCh slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -236,14 +257,15 @@ def _parse_slack_aliases(data: object) -> list[NewSeverityDataAttributesSlackAli slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) new_severity_data_attributes = cls( name=name, + slug=slug, description=description, severity=severity, color=color, diff --git a/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py index 67bf462e..67bd7916 100644 --- a/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py index eed8d124..430f8c3e 100644 --- a/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_shift_coverage_request.py b/rootly_sdk/models/new_shift_coverage_request.py index 310e914f..ce18a9a2 100644 --- a/rootly_sdk/models/new_shift_coverage_request.py +++ b/rootly_sdk/models/new_shift_coverage_request.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewShiftCoverageRequest: data (NewShiftCoverageRequestData): """ - data: NewShiftCoverageRequestData + data: "NewShiftCoverageRequestData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_shift_coverage_request_data.py b/rootly_sdk/models/new_shift_coverage_request_data.py index d5a821e9..7ddbed15 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data.py +++ b/rootly_sdk/models/new_shift_coverage_request_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewShiftCoverageRequestData: """ type_: NewShiftCoverageRequestDataType - attributes: NewShiftCoverageRequestDataAttributes + attributes: "NewShiftCoverageRequestDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py index f709df3b..ecaedf6f 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py +++ b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -18,13 +16,13 @@ class NewShiftCoverageRequestDataAttributes: Attributes: starts_at (datetime.datetime): Start datetime of the time range to request coverage for ends_at (datetime.datetime): End datetime of the time range to request coverage for - user_id (int | Unset): Optional. Restrict coverage to shifts assigned to this user. When omitted, every shift - overlapping the time range is covered. + user_id (Union[Unset, int]): Optional. Restrict coverage to shifts assigned to this user. When omitted, every + shift overlapping the time range is covered. """ starts_at: datetime.datetime ends_at: datetime.datetime - user_id: int | Unset = UNSET + user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: starts_at = self.starts_at.isoformat() diff --git a/rootly_sdk/models/new_sla.py b/rootly_sdk/models/new_sla.py index d7e331d4..acdabbdb 100644 --- a/rootly_sdk/models/new_sla.py +++ b/rootly_sdk/models/new_sla.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSla: data (NewSlaData): """ - data: NewSlaData + data: "NewSlaData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_sla_data.py b/rootly_sdk/models/new_sla_data.py index c1b1c15d..7b338eed 100644 --- a/rootly_sdk/models/new_sla_data.py +++ b/rootly_sdk/models/new_sla_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSlaData: """ type_: NewSlaDataType - attributes: NewSlaDataAttributes + attributes: "NewSlaDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_sla_data_attributes.py b/rootly_sdk/models/new_sla_data_attributes.py index ad31ed6d..75e8ca2d 100644 --- a/rootly_sdk/models/new_sla_data_attributes.py +++ b/rootly_sdk/models/new_sla_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -51,23 +49,26 @@ class NewSlaDataAttributes: deadline completion_deadline_parent_status (NewSlaDataAttributesCompletionDeadlineParentStatus): The incident parent status that triggers the completion deadline - description (None | str | Unset): A description of the SLA - position (int | None | Unset): Position of the SLA for ordering - condition_match_type (NewSlaDataAttributesConditionMatchType | Unset): Whether all or any conditions must match - manager_role_id (None | Unset | UUID): The ID of the incident role responsible for this SLA. Must provide either - manager_role_id or manager_user_id. - manager_user_id (int | None | Unset): The ID of the user responsible for this SLA. Must provide either + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): A description of the SLA + position (Union[None, Unset, int]): Position of the SLA for ordering + condition_match_type (Union[Unset, NewSlaDataAttributesConditionMatchType]): Whether all or any conditions must + match + manager_role_id (Union[None, UUID, Unset]): The ID of the incident role responsible for this SLA. Must provide + either manager_role_id or manager_user_id. + manager_user_id (Union[None, Unset, int]): The ID of the user responsible for this SLA. Must provide either manager_role_id or manager_user_id. - assignment_deadline_sub_status_id (None | Unset | UUID): Sub-status for the assignment deadline. Required when - custom lifecycle statuses are enabled on the team. - assignment_skip_weekends (bool | Unset): Whether to skip weekends when calculating the assignment deadline - completion_deadline_sub_status_id (None | Unset | UUID): Sub-status for the completion deadline. Required when - custom lifecycle statuses are enabled on the team. - completion_skip_weekends (bool | Unset): Whether to skip weekends when calculating the completion deadline - conditions (list[NewSlaDataAttributesConditionsItem] | Unset): Conditions that determine which incidents this - SLA applies to. Maximum 20. - notification_configurations (list[NewSlaDataAttributesNotificationConfigurationsItem] | Unset): Notification - timing configurations. Maximum 20. + assignment_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the assignment deadline. Required + when custom lifecycle statuses are enabled on the team. + assignment_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the assignment deadline + completion_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the completion deadline. Required + when custom lifecycle statuses are enabled on the team. + completion_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the completion deadline + conditions (Union[Unset, list['NewSlaDataAttributesConditionsItem']]): Conditions that determine which incidents + this SLA applies to. Maximum 20. + notification_configurations (Union[Unset, list['NewSlaDataAttributesNotificationConfigurationsItem']]): + Notification timing configurations. Maximum 20. """ name: str @@ -75,20 +76,20 @@ class NewSlaDataAttributes: assignment_deadline_parent_status: NewSlaDataAttributesAssignmentDeadlineParentStatus completion_deadline_days: NewSlaDataAttributesCompletionDeadlineDays completion_deadline_parent_status: NewSlaDataAttributesCompletionDeadlineParentStatus - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - condition_match_type: NewSlaDataAttributesConditionMatchType | Unset = UNSET - manager_role_id: None | Unset | UUID = UNSET - manager_user_id: int | None | Unset = UNSET - assignment_deadline_sub_status_id: None | Unset | UUID = UNSET - assignment_skip_weekends: bool | Unset = UNSET - completion_deadline_sub_status_id: None | Unset | UUID = UNSET - completion_skip_weekends: bool | Unset = UNSET - conditions: list[NewSlaDataAttributesConditionsItem] | Unset = UNSET - notification_configurations: list[NewSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + condition_match_type: Unset | NewSlaDataAttributesConditionMatchType = UNSET + manager_role_id: None | UUID | Unset = UNSET + manager_user_id: None | Unset | int = UNSET + assignment_deadline_sub_status_id: None | UUID | Unset = UNSET + assignment_skip_weekends: Unset | bool = UNSET + completion_deadline_sub_status_id: None | UUID | Unset = UNSET + completion_skip_weekends: Unset | bool = UNSET + conditions: Unset | list["NewSlaDataAttributesConditionsItem"] = UNSET + notification_configurations: Unset | list["NewSlaDataAttributesNotificationConfigurationsItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name assignment_deadline_days: int = self.assignment_deadline_days @@ -99,23 +100,29 @@ def to_dict(self) -> dict[str, Any]: completion_deadline_parent_status: str = self.completion_deadline_parent_status - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: str | Unset = UNSET + condition_match_type: Unset | str = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: None | str | Unset + manager_role_id: None | Unset | str if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -123,13 +130,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: int | None | Unset + manager_user_id: None | Unset | int if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_sub_status_id: None | str | Unset + assignment_deadline_sub_status_id: None | Unset | str if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -139,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: None | str | Unset + completion_deadline_sub_status_id: None | Unset | str if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -149,14 +156,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: list[dict[str, Any]] | Unset = UNSET + notification_configurations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -174,6 +181,8 @@ def to_dict(self) -> dict[str, Any]: "completion_deadline_parent_status": completion_deadline_parent_status, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -225,32 +234,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("completion_deadline_parent_status") ) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: NewSlaDataAttributesConditionMatchType | Unset + condition_match_type: Unset | NewSlaDataAttributesConditionMatchType if isinstance(_condition_match_type, Unset): condition_match_type = UNSET else: condition_match_type = check_new_sla_data_attributes_condition_match_type(_condition_match_type) - def _parse_manager_role_id(data: object) -> None | Unset | UUID: + def _parse_manager_role_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -261,22 +279,22 @@ def _parse_manager_role_id(data: object) -> None | Unset | UUID: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> int | None | Unset: + def _parse_manager_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -287,9 +305,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -297,7 +315,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -308,9 +326,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -318,25 +336,21 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[NewSlaDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = NewSlaDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = NewSlaDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) + notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - notification_configurations: list[NewSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET - if _notification_configurations is not UNSET: - notification_configurations = [] - for notification_configurations_item_data in _notification_configurations: - notification_configurations_item = NewSlaDataAttributesNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + for notification_configurations_item_data in _notification_configurations or []: + notification_configurations_item = NewSlaDataAttributesNotificationConfigurationsItem.from_dict( + notification_configurations_item_data + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) new_sla_data_attributes = cls( name=name, @@ -344,6 +358,7 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_parent_status=assignment_deadline_parent_status, completion_deadline_days=completion_deadline_days, completion_deadline_parent_status=completion_deadline_parent_status, + slug=slug, description=description, position=position, condition_match_type=condition_match_type, diff --git a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py index 12795ef1..25e9f894 100644 --- a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -26,21 +24,21 @@ class NewSlaDataAttributesConditionsItem: Attributes: conditionable_type (NewSlaDataAttributesConditionsItemConditionableType): The type of condition operator (str): The comparison operator - property_ (NewSlaDataAttributesConditionsItemProperty | Unset): The property to evaluate (for built-in field - conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as + property_ (Union[Unset, NewSlaDataAttributesConditionsItemProperty]): The property to evaluate (for built-in + field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. - values (list[str] | None | Unset): The values to compare against - form_field_id (None | Unset | UUID): The ID of the form field (for custom field conditions) - position (int | Unset): The position of the condition for ordering + values (Union[None, Unset, list[str]]): The values to compare against + form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) + position (Union[Unset, int]): The position of the condition for ordering """ conditionable_type: NewSlaDataAttributesConditionsItemConditionableType operator: str - property_: NewSlaDataAttributesConditionsItemProperty | Unset = UNSET - values: list[str] | None | Unset = UNSET - form_field_id: None | Unset | UUID = UNSET - position: int | Unset = UNSET + property_: Unset | NewSlaDataAttributesConditionsItemProperty = UNSET + values: None | Unset | list[str] = UNSET + form_field_id: None | UUID | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,11 +46,11 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - property_: str | Unset = UNSET + property_: Unset | str = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: list[str] | None | Unset + values: None | Unset | list[str] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -61,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | str | Unset + form_field_id: None | Unset | str if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -100,13 +98,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = d.pop("operator") _property_ = d.pop("property", UNSET) - property_: NewSlaDataAttributesConditionsItemProperty | Unset + property_: Unset | NewSlaDataAttributesConditionsItemProperty if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_new_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> list[str] | None | Unset: + def _parse_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -117,13 +115,13 @@ def _parse_values(data: object) -> list[str] | None | Unset: values_type_0 = cast(list[str], data) return values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | Unset | UUID: + def _parse_form_field_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -134,9 +132,9 @@ def _parse_form_field_id(data: object) -> None | Unset | UUID: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py b/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py index 33589513..9a632e5d 100644 --- a/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py +++ b/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_status_page.py b/rootly_sdk/models/new_status_page.py index f3db92c7..330e306b 100644 --- a/rootly_sdk/models/new_status_page.py +++ b/rootly_sdk/models/new_status_page.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewStatusPage: data (NewStatusPageData): """ - data: NewStatusPageData + data: "NewStatusPageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_status_page_announcement.py b/rootly_sdk/models/new_status_page_announcement.py new file mode 100644 index 00000000..18bf2235 --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_status_page_announcement_data import NewStatusPageAnnouncementData + + +T = TypeVar("T", bound="NewStatusPageAnnouncement") + + +@_attrs_define +class NewStatusPageAnnouncement: + """ + Attributes: + data (NewStatusPageAnnouncementData): + """ + + data: "NewStatusPageAnnouncementData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_announcement_data import NewStatusPageAnnouncementData + + d = dict(src_dict) + data = NewStatusPageAnnouncementData.from_dict(d.pop("data")) + + new_status_page_announcement = cls( + data=data, + ) + + new_status_page_announcement.additional_properties = d + return new_status_page_announcement + + @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/rootly_sdk/models/new_status_page_announcement_data.py b/rootly_sdk/models/new_status_page_announcement_data.py new file mode 100644 index 00000000..643c78f1 --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_status_page_announcement_data_type import ( + NewStatusPageAnnouncementDataType, + check_new_status_page_announcement_data_type, +) + +if TYPE_CHECKING: + from ..models.new_status_page_announcement_data_attributes import NewStatusPageAnnouncementDataAttributes + + +T = TypeVar("T", bound="NewStatusPageAnnouncementData") + + +@_attrs_define +class NewStatusPageAnnouncementData: + """ + Attributes: + type_ (NewStatusPageAnnouncementDataType): + attributes (NewStatusPageAnnouncementDataAttributes): + """ + + type_: NewStatusPageAnnouncementDataType + attributes: "NewStatusPageAnnouncementDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_announcement_data_attributes import NewStatusPageAnnouncementDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_announcement_data_type(d.pop("type")) + + attributes = NewStatusPageAnnouncementDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_announcement_data = cls( + type_=type_, + attributes=attributes, + ) + + new_status_page_announcement_data.additional_properties = d + return new_status_page_announcement_data + + @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/rootly_sdk/models/new_status_page_announcement_data_attributes.py b/rootly_sdk/models/new_status_page_announcement_data_attributes.py new file mode 100644 index 00000000..424a5690 --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement_data_attributes.py @@ -0,0 +1,60 @@ +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="NewStatusPageAnnouncementDataAttributes") + + +@_attrs_define +class NewStatusPageAnnouncementDataAttributes: + """ + Attributes: + title (str): Title of the announcement + body (str): Body of the announcement + notify_subscribers (Union[Unset, bool]): Controls if status page subscribers should be notified. Defaults to + true + """ + + title: str + body: str + notify_subscribers: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + title = self.title + + body = self.body + + notify_subscribers = self.notify_subscribers + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "title": title, + "body": body, + } + ) + if notify_subscribers is not UNSET: + field_dict["notify_subscribers"] = notify_subscribers + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + title = d.pop("title") + + body = d.pop("body") + + notify_subscribers = d.pop("notify_subscribers", UNSET) + + new_status_page_announcement_data_attributes = cls( + title=title, + body=body, + notify_subscribers=notify_subscribers, + ) + + return new_status_page_announcement_data_attributes diff --git a/rootly_sdk/models/new_status_page_announcement_data_type.py b/rootly_sdk/models/new_status_page_announcement_data_type.py new file mode 100644 index 00000000..224ad0ca --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewStatusPageAnnouncementDataType = Literal["status_page_announcements"] + +NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: set[NewStatusPageAnnouncementDataType] = { + "status_page_announcements", +} + + +def check_new_status_page_announcement_data_type(value: str | None) -> NewStatusPageAnnouncementDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: + return cast(NewStatusPageAnnouncementDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_component.py b/rootly_sdk/models/new_status_page_component.py new file mode 100644 index 00000000..f2b146f0 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_status_page_component_data import NewStatusPageComponentData + + +T = TypeVar("T", bound="NewStatusPageComponent") + + +@_attrs_define +class NewStatusPageComponent: + """ + Attributes: + data (NewStatusPageComponentData): + """ + + data: "NewStatusPageComponentData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_data import NewStatusPageComponentData + + d = dict(src_dict) + data = NewStatusPageComponentData.from_dict(d.pop("data")) + + new_status_page_component = cls( + data=data, + ) + + new_status_page_component.additional_properties = d + return new_status_page_component + + @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/rootly_sdk/models/new_status_page_component_data.py b/rootly_sdk/models/new_status_page_component_data.py new file mode 100644 index 00000000..6729f0b0 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_status_page_component_data_type import ( + NewStatusPageComponentDataType, + check_new_status_page_component_data_type, +) + +if TYPE_CHECKING: + from ..models.new_status_page_component_data_attributes import NewStatusPageComponentDataAttributes + + +T = TypeVar("T", bound="NewStatusPageComponentData") + + +@_attrs_define +class NewStatusPageComponentData: + """ + Attributes: + type_ (NewStatusPageComponentDataType): + attributes (NewStatusPageComponentDataAttributes): + """ + + type_: NewStatusPageComponentDataType + attributes: "NewStatusPageComponentDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_data_attributes import NewStatusPageComponentDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_component_data_type(d.pop("type")) + + attributes = NewStatusPageComponentDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_component_data = cls( + type_=type_, + attributes=attributes, + ) + + new_status_page_component_data.additional_properties = d + return new_status_page_component_data + + @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/rootly_sdk/models/new_status_page_component_data_attributes.py b/rootly_sdk/models/new_status_page_component_data_attributes.py new file mode 100644 index 00000000..858cf79b --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data_attributes.py @@ -0,0 +1,146 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.new_status_page_component_data_attributes_source_type import ( + NewStatusPageComponentDataAttributesSourceType, + check_new_status_page_component_data_attributes_source_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewStatusPageComponentDataAttributes") + + +@_attrs_define +class NewStatusPageComponentDataAttributes: + """ + Attributes: + name (Union[None, Unset, str]): Name of the component (required for ad-hoc components; derived from the source + for catalog-backed ones) + description (Union[None, Unset, str]): Description of the component (ad-hoc components only) + status_page_component_group_id (Union[None, Unset, str]): ID of the component group on the same status page + position (Union[Unset, int]): Position of the component (within its group, or on the page's top-level list when + ungrouped) + source_type (Union[Unset, NewStatusPageComponentDataAttributesSourceType]): Catalog source type backing the + component + source_id (Union[None, Unset, str]): ID of the catalog source backing the component + """ + + name: None | Unset | str = UNSET + description: None | Unset | str = UNSET + status_page_component_group_id: None | Unset | str = UNSET + position: Unset | int = UNSET + source_type: Unset | NewStatusPageComponentDataAttributesSourceType = UNSET + source_id: None | Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + name: None | Unset | str + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: None | Unset | str + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + status_page_component_group_id: None | Unset | str + if isinstance(self.status_page_component_group_id, Unset): + status_page_component_group_id = UNSET + else: + status_page_component_group_id = self.status_page_component_group_id + + position = self.position + + source_type: Unset | str = UNSET + if not isinstance(self.source_type, Unset): + source_type = self.source_type + + source_id: None | Unset | str + if isinstance(self.source_id, Unset): + source_id = UNSET + else: + source_id = self.source_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if status_page_component_group_id is not UNSET: + field_dict["status_page_component_group_id"] = status_page_component_group_id + if position is not UNSET: + field_dict["position"] = position + if source_type is not UNSET: + field_dict["source_type"] = source_type + if source_id is not UNSET: + field_dict["source_id"] = source_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_name(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_status_page_component_group_id(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + status_page_component_group_id = _parse_status_page_component_group_id( + d.pop("status_page_component_group_id", UNSET) + ) + + position = d.pop("position", UNSET) + + _source_type = d.pop("source_type", UNSET) + source_type: Unset | NewStatusPageComponentDataAttributesSourceType + if isinstance(_source_type, Unset): + source_type = UNSET + else: + source_type = check_new_status_page_component_data_attributes_source_type(_source_type) + + def _parse_source_id(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + source_id = _parse_source_id(d.pop("source_id", UNSET)) + + new_status_page_component_data_attributes = cls( + name=name, + description=description, + status_page_component_group_id=status_page_component_group_id, + position=position, + source_type=source_type, + source_id=source_id, + ) + + return new_status_page_component_data_attributes diff --git a/rootly_sdk/models/new_status_page_component_data_attributes_source_type.py b/rootly_sdk/models/new_status_page_component_data_attributes_source_type.py new file mode 100644 index 00000000..fbe2cc82 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data_attributes_source_type.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +NewStatusPageComponentDataAttributesSourceType = Literal["Functionality", "Service"] + +NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: set[NewStatusPageComponentDataAttributesSourceType] = { + "Functionality", + "Service", +} + + +def check_new_status_page_component_data_attributes_source_type( + value: str | None, +) -> NewStatusPageComponentDataAttributesSourceType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: + return cast(NewStatusPageComponentDataAttributesSourceType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_status_page_component_data_type.py b/rootly_sdk/models/new_status_page_component_data_type.py new file mode 100644 index 00000000..ce92419e --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewStatusPageComponentDataType = Literal["status_page_components"] + +NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: set[NewStatusPageComponentDataType] = { + "status_page_components", +} + + +def check_new_status_page_component_data_type(value: str | None) -> NewStatusPageComponentDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: + return cast(NewStatusPageComponentDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_component_group.py b/rootly_sdk/models/new_status_page_component_group.py new file mode 100644 index 00000000..a5e094f5 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_status_page_component_group_data import NewStatusPageComponentGroupData + + +T = TypeVar("T", bound="NewStatusPageComponentGroup") + + +@_attrs_define +class NewStatusPageComponentGroup: + """ + Attributes: + data (NewStatusPageComponentGroupData): + """ + + data: "NewStatusPageComponentGroupData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_group_data import NewStatusPageComponentGroupData + + d = dict(src_dict) + data = NewStatusPageComponentGroupData.from_dict(d.pop("data")) + + new_status_page_component_group = cls( + data=data, + ) + + new_status_page_component_group.additional_properties = d + return new_status_page_component_group + + @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/rootly_sdk/models/new_status_page_component_group_data.py b/rootly_sdk/models/new_status_page_component_group_data.py new file mode 100644 index 00000000..75a9d81a --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_status_page_component_group_data_type import ( + NewStatusPageComponentGroupDataType, + check_new_status_page_component_group_data_type, +) + +if TYPE_CHECKING: + from ..models.new_status_page_component_group_data_attributes import NewStatusPageComponentGroupDataAttributes + + +T = TypeVar("T", bound="NewStatusPageComponentGroupData") + + +@_attrs_define +class NewStatusPageComponentGroupData: + """ + Attributes: + type_ (NewStatusPageComponentGroupDataType): + attributes (NewStatusPageComponentGroupDataAttributes): + """ + + type_: NewStatusPageComponentGroupDataType + attributes: "NewStatusPageComponentGroupDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_group_data_attributes import NewStatusPageComponentGroupDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_component_group_data_type(d.pop("type")) + + attributes = NewStatusPageComponentGroupDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_component_group_data = cls( + type_=type_, + attributes=attributes, + ) + + new_status_page_component_group_data.additional_properties = d + return new_status_page_component_group_data + + @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/rootly_sdk/models/new_status_page_component_group_data_attributes.py b/rootly_sdk/models/new_status_page_component_group_data_attributes.py new file mode 100644 index 00000000..e5bb5855 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group_data_attributes.py @@ -0,0 +1,92 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewStatusPageComponentGroupDataAttributes") + + +@_attrs_define +class NewStatusPageComponentGroupDataAttributes: + """ + Attributes: + name (str): Name of the component group + description (Union[None, Unset, str]): Description of the component group + position (Union[Unset, int]): Position of the group on the status page's top-level list (shared with ungrouped + components) + collapsed_by_default (Union[None, Unset, bool]): Whether the group renders collapsed on the public page + """ + + name: str + description: None | Unset | str = UNSET + position: Unset | int = UNSET + collapsed_by_default: None | Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description: None | Unset | str + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + position = self.position + + collapsed_by_default: None | Unset | bool + if isinstance(self.collapsed_by_default, Unset): + collapsed_by_default = UNSET + else: + collapsed_by_default = self.collapsed_by_default + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if description is not UNSET: + field_dict["description"] = description + if position is not UNSET: + field_dict["position"] = position + if collapsed_by_default is not UNSET: + field_dict["collapsed_by_default"] = collapsed_by_default + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + description = _parse_description(d.pop("description", UNSET)) + + position = d.pop("position", UNSET) + + def _parse_collapsed_by_default(data: object) -> None | Unset | bool: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | bool, data) + + collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) + + new_status_page_component_group_data_attributes = cls( + name=name, + description=description, + position=position, + collapsed_by_default=collapsed_by_default, + ) + + return new_status_page_component_group_data_attributes diff --git a/rootly_sdk/models/new_status_page_component_group_data_type.py b/rootly_sdk/models/new_status_page_component_group_data_type.py new file mode 100644 index 00000000..08c006f1 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewStatusPageComponentGroupDataType = Literal["status_page_component_groups"] + +NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: set[NewStatusPageComponentGroupDataType] = { + "status_page_component_groups", +} + + +def check_new_status_page_component_group_data_type(value: str | None) -> NewStatusPageComponentGroupDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: + return cast(NewStatusPageComponentGroupDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_data.py b/rootly_sdk/models/new_status_page_data.py index 5d400e07..42e919f0 100644 --- a/rootly_sdk/models/new_status_page_data.py +++ b/rootly_sdk/models/new_status_page_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewStatusPageData: """ type_: NewStatusPageDataType - attributes: NewStatusPageDataAttributes + attributes: "NewStatusPageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_status_page_data_attributes.py b/rootly_sdk/models/new_status_page_data_attributes.py index a19825e4..079589e8 100644 --- a/rootly_sdk/models/new_status_page_data_attributes.py +++ b/rootly_sdk/models/new_status_page_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -31,171 +29,180 @@ class NewStatusPageDataAttributes: """ Attributes: title (str): The title of the status page - public_title (None | str | Unset): The public title of the status page - description (None | str | Unset): The description of the status page - public_description (None | str | Unset): The public description of the status page - header_color (None | str | Unset): The color of the header. Eg. "#0061F2" - footer_color (None | str | Unset): The color of the footer. Eg. "#1F2F41" - allow_search_engine_index (bool | None | Unset): Allow search engines to include your public status page in + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + public_title (Union[None, Unset, str]): The public title of the status page + description (Union[None, Unset, str]): The description of the status page + public_description (Union[None, Unset, str]): The public description of the status page + header_color (Union[None, Unset, str]): The color of the header. Eg. "#0061F2" + footer_color (Union[None, Unset, str]): The color of the footer. Eg. "#1F2F41" + allow_search_engine_index (Union[None, Unset, bool]): Allow search engines to include your public status page in search results - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (NewStatusPageDataAttributesShowUptimeLastDays | Unset): Show uptime over x days - success_message (None | str | Unset): Message showing when all components are operational - failure_message (None | str | Unset): Message showing when at least one component is not operational - authentication_method (NewStatusPageDataAttributesAuthenticationMethod | Unset): Authentication method Default: - 'none'. - authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, NewStatusPageDataAttributesShowUptimeLastDays]): Show uptime over x days + success_message (Union[None, Unset, str]): Message showing when all components are operational + failure_message (Union[None, Unset, str]): Message showing when at least one component is not operational + authentication_method (Union[Unset, NewStatusPageDataAttributesAuthenticationMethod]): Authentication method + Default: 'none'. + authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method instead) Default: False. - authentication_password (None | str | Unset): Authentication password - saml_idp_sso_service_url (None | str | Unset): SAML IdP SSO service URL - saml_idp_slo_service_url (None | str | Unset): SAML IdP SLO service URL - saml_idp_cert (None | str | Unset): SAML IdP certificate - saml_name_identifier_format (NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset): SAML name identifier - format - section_order (list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset): Order of sections on the - status page - external_domain_names (list[str] | None | Unset): External domain names attached to the status page - website_url (None | str | Unset): Website URL - website_privacy_url (None | str | Unset): Website Privacy URL - website_support_url (None | str | Unset): Website Support URL - ga_tracking_id (None | str | Unset): Google Analytics tracking ID - time_zone (None | str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - public (bool | None | Unset): Make the status page accessible to the public - service_ids (list[str] | Unset): Services attached to the status page - functionality_ids (list[str] | Unset): Functionalities attached to the status page - enabled (bool | None | Unset): Enabled / Disable the status page + authentication_password (Union[None, Unset, str]): Authentication password + saml_idp_sso_service_url (Union[None, Unset, str]): SAML IdP SSO service URL + saml_idp_slo_service_url (Union[None, Unset, str]): SAML IdP SLO service URL + saml_idp_cert (Union[None, Unset, str]): SAML IdP certificate + saml_name_identifier_format (Union[Unset, NewStatusPageDataAttributesSamlNameIdentifierFormat]): SAML name + identifier format + section_order (Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]]): Order of sections on + the status page + external_domain_names (Union[None, Unset, list[str]]): External domain names attached to the status page + website_url (Union[None, Unset, str]): Website URL + website_privacy_url (Union[None, Unset, str]): Website Privacy URL + website_support_url (Union[None, Unset, str]): Website Support URL + ga_tracking_id (Union[None, Unset, str]): Google Analytics tracking ID + time_zone (Union[None, Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + public (Union[None, Unset, bool]): Make the status page accessible to the public + service_ids (Union[Unset, list[str]]): Services attached to the status page + functionality_ids (Union[Unset, list[str]]): Functionalities attached to the status page + enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ title: str - public_title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - header_color: None | str | Unset = UNSET - footer_color: None | str | Unset = UNSET - allow_search_engine_index: bool | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: NewStatusPageDataAttributesShowUptimeLastDays | Unset = UNSET - success_message: None | str | Unset = UNSET - failure_message: None | str | Unset = UNSET - authentication_method: NewStatusPageDataAttributesAuthenticationMethod | Unset = "none" - authentication_enabled: bool | None | Unset = False - authentication_password: None | str | Unset = UNSET - saml_idp_sso_service_url: None | str | Unset = UNSET - saml_idp_slo_service_url: None | str | Unset = UNSET - saml_idp_cert: None | str | Unset = UNSET - saml_name_identifier_format: NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset = UNSET - section_order: list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset = UNSET - external_domain_names: list[str] | None | Unset = UNSET - website_url: None | str | Unset = UNSET - website_privacy_url: None | str | Unset = UNSET - website_support_url: None | str | Unset = UNSET - ga_tracking_id: None | str | Unset = UNSET - time_zone: None | str | Unset = "Etc/UTC" - public: bool | None | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - enabled: bool | None | Unset = UNSET + slug: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + header_color: None | Unset | str = UNSET + footer_color: None | Unset | str = UNSET + allow_search_engine_index: None | Unset | bool = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | NewStatusPageDataAttributesShowUptimeLastDays = UNSET + success_message: None | Unset | str = UNSET + failure_message: None | Unset | str = UNSET + authentication_method: Unset | NewStatusPageDataAttributesAuthenticationMethod = "none" + authentication_enabled: None | Unset | bool = False + authentication_password: None | Unset | str = UNSET + saml_idp_sso_service_url: None | Unset | str = UNSET + saml_idp_slo_service_url: None | Unset | str = UNSET + saml_idp_cert: None | Unset | str = UNSET + saml_name_identifier_format: Unset | NewStatusPageDataAttributesSamlNameIdentifierFormat = UNSET + section_order: None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item] = UNSET + external_domain_names: None | Unset | list[str] = UNSET + website_url: None | Unset | str = UNSET + website_privacy_url: None | Unset | str = UNSET + website_support_url: None | Unset | str = UNSET + ga_tracking_id: None | Unset | str = UNSET + time_zone: None | Unset | str = "Etc/UTC" + public: None | Unset | bool = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - public_title: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | str | Unset + header_color: None | Unset | str if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | str | Unset + footer_color: None | Unset | str if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: bool | None | Unset + allow_search_engine_index: None | Unset | bool if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | str | Unset + success_message: None | Unset | str if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | str | Unset + failure_message: None | Unset | str if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: str | Unset = UNSET + authentication_method: Unset | str = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: bool | None | Unset + authentication_enabled: None | Unset | bool if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | str | Unset + authentication_password: None | Unset | str if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | str | Unset + saml_idp_sso_service_url: None | Unset | str if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: None | str | Unset + saml_idp_slo_service_url: None | Unset | str if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: None | str | Unset + saml_idp_cert: None | Unset | str if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: str | Unset = UNSET + saml_name_identifier_format: Unset | str = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: list[str] | None | Unset + section_order: None | Unset | list[str] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -207,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: list[str] | None | Unset + external_domain_names: None | Unset | list[str] if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -216,51 +223,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: None | str | Unset + website_url: None | Unset | str if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | str | Unset + website_privacy_url: None | Unset | str if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | str | Unset + website_support_url: None | Unset | str if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | str | Unset + ga_tracking_id: None | Unset | str if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: bool | None | Unset + public: None | Unset | bool if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: bool | None | Unset + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -273,6 +280,8 @@ def to_dict(self) -> dict[str, Any]: "title": title, } ) + if slug is not UNSET: + field_dict["slug"] = slug if public_title is not UNSET: field_dict["public_title"] = public_title if description is not UNSET: @@ -337,148 +346,157 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | str | Unset: + def _parse_header_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | str | Unset: + def _parse_footer_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: + def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: NewStatusPageDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Unset | NewStatusPageDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_new_status_page_data_attributes_show_uptime_last_days(_show_uptime_last_days) - def _parse_success_message(data: object) -> None | str | Unset: + def _parse_success_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | str | Unset: + def _parse_failure_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: NewStatusPageDataAttributesAuthenticationMethod | Unset + authentication_method: Unset | NewStatusPageDataAttributesAuthenticationMethod if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_new_status_page_data_attributes_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> bool | None | Unset: + def _parse_authentication_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | str | Unset: + def _parse_authentication_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_slo_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> None | str | Unset: + def _parse_saml_idp_cert(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset + saml_name_identifier_format: Unset | NewStatusPageDataAttributesSamlNameIdentifierFormat if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -486,7 +504,9 @@ def _parse_saml_idp_cert(data: object) -> None | str | Unset: _saml_name_identifier_format ) - def _parse_section_order(data: object) -> list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset: + def _parse_section_order( + data: object, + ) -> None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item]: if data is None: return data if isinstance(data, Unset): @@ -504,13 +524,13 @@ def _parse_section_order(data: object) -> list[NewStatusPageDataAttributesSectio section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset, data) + return cast(None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> list[str] | None | Unset: + def _parse_external_domain_names(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -521,63 +541,63 @@ def _parse_external_domain_names(data: object) -> list[str] | None | Unset: external_domain_names_type_0 = cast(list[str], data) return external_domain_names_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> None | str | Unset: + def _parse_website_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | str | Unset: + def _parse_website_privacy_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | str | Unset: + def _parse_website_support_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | str | Unset: + def _parse_ga_tracking_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> bool | None | Unset: + def _parse_public(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) public = _parse_public(d.pop("public", UNSET)) @@ -585,17 +605,18 @@ def _parse_public(data: object) -> bool | None | Unset: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) new_status_page_data_attributes = cls( title=title, + slug=slug, public_title=public_title, description=description, public_description=public_description, diff --git a/rootly_sdk/models/new_status_page_template.py b/rootly_sdk/models/new_status_page_template.py index be295a5d..2a888f80 100644 --- a/rootly_sdk/models/new_status_page_template.py +++ b/rootly_sdk/models/new_status_page_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewStatusPageTemplate: data (NewStatusPageTemplateData): """ - data: NewStatusPageTemplateData + data: "NewStatusPageTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_status_page_template_data.py b/rootly_sdk/models/new_status_page_template_data.py index a5f25d1c..fc999006 100644 --- a/rootly_sdk/models/new_status_page_template_data.py +++ b/rootly_sdk/models/new_status_page_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewStatusPageTemplateData: """ type_: NewStatusPageTemplateDataType - attributes: NewStatusPageTemplateDataAttributes + attributes: "NewStatusPageTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_status_page_template_data_attributes.py b/rootly_sdk/models/new_status_page_template_data_attributes.py index c6d188d0..b1927d4e 100644 --- a/rootly_sdk/models/new_status_page_template_data_attributes.py +++ b/rootly_sdk/models/new_status_page_template_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,25 +22,25 @@ class NewStatusPageTemplateDataAttributes: Attributes: title (str): Title of the template body (str): Description of the event the template will populate - status_page_id (str | Unset): - update_title (None | str | Unset): Title that will be used for the status page update - update_status (NewStatusPageTemplateDataAttributesUpdateStatus | Unset): Status of the event the template will - populate - kind (NewStatusPageTemplateDataAttributesKind | Unset): The kind of the status page template - should_notify_subscribers (bool | None | Unset): Controls if incident subscribers should be notified - position (int | Unset): Position of the status page template - enabled (bool | None | Unset): Enable / Disable the status page template + status_page_id (Union[Unset, str]): + update_title (Union[None, Unset, str]): Title that will be used for the status page update + update_status (Union[Unset, NewStatusPageTemplateDataAttributesUpdateStatus]): Status of the event the template + will populate + kind (Union[Unset, NewStatusPageTemplateDataAttributesKind]): The kind of the status page template + should_notify_subscribers (Union[None, Unset, bool]): Controls if incident subscribers should be notified + position (Union[Unset, int]): Position of the status page template + enabled (Union[None, Unset, bool]): Enable / Disable the status page template """ title: str body: str - status_page_id: str | Unset = UNSET - update_title: None | str | Unset = UNSET - update_status: NewStatusPageTemplateDataAttributesUpdateStatus | Unset = UNSET - kind: NewStatusPageTemplateDataAttributesKind | Unset = UNSET - should_notify_subscribers: bool | None | Unset = UNSET - position: int | Unset = UNSET - enabled: bool | None | Unset = UNSET + status_page_id: Unset | str = UNSET + update_title: None | Unset | str = UNSET + update_status: Unset | NewStatusPageTemplateDataAttributesUpdateStatus = UNSET + kind: Unset | NewStatusPageTemplateDataAttributesKind = UNSET + should_notify_subscribers: None | Unset | bool = UNSET + position: Unset | int = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title @@ -51,21 +49,21 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - update_title: None | str | Unset + update_title: None | Unset | str if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: str | Unset = UNSET + update_status: Unset | str = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: bool | None | Unset + should_notify_subscribers: None | Unset | bool if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -73,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: bool | None | Unset + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -113,46 +111,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) - def _parse_update_title(data: object) -> None | str | Unset: + def _parse_update_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: NewStatusPageTemplateDataAttributesUpdateStatus | Unset + update_status: Unset | NewStatusPageTemplateDataAttributesUpdateStatus if isinstance(_update_status, Unset): update_status = UNSET else: update_status = check_new_status_page_template_data_attributes_update_status(_update_status) _kind = d.pop("kind", UNSET) - kind: NewStatusPageTemplateDataAttributesKind | Unset + kind: Unset | NewStatusPageTemplateDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/new_sub_status.py b/rootly_sdk/models/new_sub_status.py index 02753d5a..6baa6d72 100644 --- a/rootly_sdk/models/new_sub_status.py +++ b/rootly_sdk/models/new_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSubStatus: data (NewSubStatusData): """ - data: NewSubStatusData + data: "NewSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_sub_status_data.py b/rootly_sdk/models/new_sub_status_data.py index fb4d42e9..b987a434 100644 --- a/rootly_sdk/models/new_sub_status_data.py +++ b/rootly_sdk/models/new_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSubStatusData: """ type_: NewSubStatusDataType - attributes: NewSubStatusDataAttributes + attributes: "NewSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_sub_status_data_attributes.py b/rootly_sdk/models/new_sub_status_data_attributes.py index c228516b..08b4e3bb 100644 --- a/rootly_sdk/models/new_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_sub_status_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,27 +18,36 @@ class NewSubStatusDataAttributes: Attributes: name (str): parent_status (NewSubStatusDataAttributesParentStatus): - description (None | str | Unset): - position (int | None | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + position (Union[None, Unset, int]): """ name: str parent_status: NewSubStatusDataAttributesParentStatus - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name parent_status: str = self.parent_status - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -54,6 +61,8 @@ def to_dict(self) -> dict[str, Any]: "parent_status": parent_status, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -68,27 +77,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parent_status = check_new_sub_status_data_attributes_parent_status(d.pop("parent_status")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) new_sub_status_data_attributes = cls( name=name, parent_status=parent_status, + slug=slug, description=description, position=position, ) diff --git a/rootly_sdk/models/new_team.py b/rootly_sdk/models/new_team.py index cf16853b..5035166c 100644 --- a/rootly_sdk/models/new_team.py +++ b/rootly_sdk/models/new_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewTeam: data (NewTeamData): """ - data: NewTeamData + data: "NewTeamData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_team_data.py b/rootly_sdk/models/new_team_data.py index 91f45014..1d6c1900 100644 --- a/rootly_sdk/models/new_team_data.py +++ b/rootly_sdk/models/new_team_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewTeamData: """ type_: NewTeamDataType - attributes: NewTeamDataAttributes + attributes: "NewTeamDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_team_data_attributes.py b/rootly_sdk/models/new_team_data_attributes.py index a05a78f5..19f2852b 100644 --- a/rootly_sdk/models/new_team_data_attributes.py +++ b/rootly_sdk/models/new_team_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -31,71 +29,77 @@ class NewTeamDataAttributes: """ Attributes: name (str): The name of the team - description (None | str | Unset): The description of the team - notify_emails (list[str] | None | Unset): Emails to attach to the team - color (None | str | Unset): The hex color of the team - position (int | None | Unset): Position of the team - backstage_id (None | str | Unset): The Backstage entity id associated to this team. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the team + public_description (Union[None, Unset, str]): The status page description of the team + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the team + color (Union[None, Unset, str]): The hex color of the team + position (Union[None, Unset, int]): Position of the team + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this team. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this team - pagerduty_id (None | str | Unset): The PagerDuty group id associated to this team - pagerduty_service_id (None | str | Unset): The PagerDuty service id associated to this team - opsgenie_id (None | str | Unset): The Opsgenie group id associated to this team - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this team - victor_ops_id (None | str | Unset): The VictorOps group id associated to this team - pagertree_id (None | str | Unset): The PagerTree group id associated to this team - cortex_id (None | str | Unset): The Cortex group id associated to this team - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this team - user_ids (list[int] | None | Unset): The user ids of the members of this team. - admin_ids (list[int] | None | Unset): The user ids of the admins of this team. These users must also be present - in user_ids attribute. - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the team - slack_channels (list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated + external_id (Union[None, Unset, str]): The external id associated to this team + pagerduty_id (Union[None, Unset, str]): The PagerDuty group id associated to this team + pagerduty_service_id (Union[None, Unset, str]): The PagerDuty service id associated to this team + opsgenie_id (Union[None, Unset, str]): The Opsgenie group id associated to this team + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this team + victor_ops_id (Union[None, Unset, str]): The VictorOps group id associated to this team + pagertree_id (Union[None, Unset, str]): The PagerTree group id associated to this team + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this team + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this team + user_ids (Union[None, Unset, list[int]]): The user ids of the members of this team. + admin_ids (Union[None, Unset, list[int]]): The user ids of the admins of this team. These users must also be + present in user_ids attribute. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the team + slack_channels (Union[None, Unset, list['NewTeamDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this team + slack_aliases (Union[None, Unset, list['NewTeamDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this team - slack_aliases (list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated with - this team - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset): Slack channel to - broadcast incidents to - auto_add_members_when_attached (bool | None | Unset): Auto add members to incident channel when team is attached - auto_add_members_scope (NewTeamDataAttributesAutoAddMembersScope | Unset): Visibility-scoped auto-add behavior. - Only present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When - set, it overrides `auto_add_members_when_attached`. - properties (list[NewTeamDataAttributesPropertiesItem] | Unset): Array of property values for this team. + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['NewTeamDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack channel + to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['NewTeamDataAttributesIncidentBroadcastChannelType0', None, Unset]): Slack + channel to broadcast incidents to + auto_add_members_when_attached (Union[None, Unset, bool]): Auto add members to incident channel when team is + attached + auto_add_members_scope (Union[Unset, NewTeamDataAttributesAutoAddMembersScope]): Visibility-scoped auto-add + behavior. Only present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the + organization. When set, it overrides `auto_add_members_when_attached`. + properties (Union[Unset, list['NewTeamDataAttributesPropertiesItem']]): Array of property values for this team. """ name: str - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - user_ids: list[int] | None | Unset = UNSET - admin_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - slack_channels: list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset = UNSET - auto_add_members_when_attached: bool | None | Unset = UNSET - auto_add_members_scope: NewTeamDataAttributesAutoAddMembersScope | Unset = UNSET - properties: list[NewTeamDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + user_ids: None | Unset | list[int] = UNSET + admin_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET + alert_broadcast_channel: Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET + incident_broadcast_channel: Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + auto_add_members_when_attached: None | Unset | bool = UNSET + auto_add_members_scope: Unset | NewTeamDataAttributesAutoAddMembersScope = UNSET + properties: Unset | list["NewTeamDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -107,13 +111,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -122,79 +138,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - victor_ops_id: None | str | Unset + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: list[int] | None | Unset + user_ids: None | Unset | list[int] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -203,7 +219,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: list[int] | None | Unset + admin_ids: None | Unset | list[int] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -212,19 +228,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -236,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -248,13 +264,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewTeamDataAttributesAlertBroadcastChannelType0): @@ -262,13 +278,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewTeamDataAttributesIncidentBroadcastChannelType0): @@ -276,17 +292,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: bool | None | Unset + auto_add_members_when_attached: None | Unset | bool if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: str | Unset = UNSET + auto_add_members_scope: Unset | str = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -300,8 +316,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -376,16 +396,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -396,121 +434,121 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> list[int] | None | Unset: + def _parse_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -521,13 +559,13 @@ def _parse_user_ids(data: object) -> list[int] | None | Unset: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> list[int] | None | Unset: + def _parse_admin_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -538,31 +576,33 @@ def _parse_admin_ids(data: object) -> list[int] | None | Unset: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -580,13 +620,15 @@ def _parse_slack_channels(data: object) -> list[NewTeamDataAttributesSlackChanne slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -604,24 +646,24 @@ def _parse_slack_aliases(data: object) -> list[NewTeamDataAttributesSlackAliases slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset: + ) -> Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -632,24 +674,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = NewTeamDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset: + ) -> Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -660,42 +702,42 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel_type_0 = NewTeamDataAttributesIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: + def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: NewTeamDataAttributesAutoAddMembersScope | Unset + auto_add_members_scope: Unset | NewTeamDataAttributesAutoAddMembersScope if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_new_team_data_attributes_auto_add_members_scope(_auto_add_members_scope) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewTeamDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewTeamDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewTeamDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_team_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py index 1450dc9d..d896ddc6 100644 --- a/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class NewTeamDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py index 6521da45..5ed832f1 100644 --- a/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class NewTeamDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_team_data_attributes_properties_item.py b/rootly_sdk/models/new_team_data_attributes_properties_item.py index ec6700ba..65b76439 100644 --- a/rootly_sdk/models/new_team_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_team_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py index 716b07cb..7ed25ecd 100644 --- a/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py index 4d03a45f..0560b467 100644 --- a/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_user_email_address.py b/rootly_sdk/models/new_user_email_address.py index 44365818..4b1dfcd4 100644 --- a/rootly_sdk/models/new_user_email_address.py +++ b/rootly_sdk/models/new_user_email_address.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewUserEmailAddress: data (NewUserEmailAddressData): """ - data: NewUserEmailAddressData + data: "NewUserEmailAddressData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_user_email_address_data.py b/rootly_sdk/models/new_user_email_address_data.py index 39826d81..a05d8ba5 100644 --- a/rootly_sdk/models/new_user_email_address_data.py +++ b/rootly_sdk/models/new_user_email_address_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewUserEmailAddressData: """ type_: NewUserEmailAddressDataType - attributes: NewUserEmailAddressDataAttributes + attributes: "NewUserEmailAddressDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_user_email_address_data_attributes.py b/rootly_sdk/models/new_user_email_address_data_attributes.py index 8ff3d016..7e191759 100644 --- a/rootly_sdk/models/new_user_email_address_data_attributes.py +++ b/rootly_sdk/models/new_user_email_address_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_user_notification_rule.py b/rootly_sdk/models/new_user_notification_rule.py index 87bbb9bb..4e14b5ae 100644 --- a/rootly_sdk/models/new_user_notification_rule.py +++ b/rootly_sdk/models/new_user_notification_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewUserNotificationRule: data (NewUserNotificationRuleData): """ - data: NewUserNotificationRuleData + data: "NewUserNotificationRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_user_notification_rule_data.py b/rootly_sdk/models/new_user_notification_rule_data.py index 0fd914eb..67502591 100644 --- a/rootly_sdk/models/new_user_notification_rule_data.py +++ b/rootly_sdk/models/new_user_notification_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewUserNotificationRuleData: """ type_: NewUserNotificationRuleDataType - attributes: NewUserNotificationRuleDataAttributes + attributes: "NewUserNotificationRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_user_notification_rule_data_attributes.py b/rootly_sdk/models/new_user_notification_rule_data_attributes.py index 1139cb20..b5846f02 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/new_user_notification_rule_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,21 +18,21 @@ class NewUserNotificationRuleDataAttributes: Attributes: enabled_contact_types (list[NewUserNotificationRuleDataAttributesEnabledContactTypesItem]): Contact types for which notification needs to be enabled - delay (int | None | Unset): Delay after which rule gets triggered - position (int | None | Unset): Position of the rule - user_email_address_id (None | str | Unset): User email address to which notification to be sent - user_call_number_id (None | str | Unset): User phone number to which notification to be sent - user_sms_number_id (None | str | Unset): User sms number to which notification to be sent - user_device_id (None | str | Unset): User device to which notification to be sent + delay (Union[None, Unset, int]): Delay after which rule gets triggered + position (Union[None, Unset, int]): Position of the rule + user_email_address_id (Union[None, Unset, str]): User email address to which notification to be sent + user_call_number_id (Union[None, Unset, str]): User phone number to which notification to be sent + user_sms_number_id (Union[None, Unset, str]): User sms number to which notification to be sent + user_device_id (Union[None, Unset, str]): User device to which notification to be sent """ enabled_contact_types: list[NewUserNotificationRuleDataAttributesEnabledContactTypesItem] - delay: int | None | Unset = UNSET - position: int | None | Unset = UNSET - user_email_address_id: None | str | Unset = UNSET - user_call_number_id: None | str | Unset = UNSET - user_sms_number_id: None | str | Unset = UNSET - user_device_id: None | str | Unset = UNSET + delay: None | Unset | int = UNSET + position: None | Unset | int = UNSET + user_email_address_id: None | Unset | str = UNSET + user_call_number_id: None | Unset | str = UNSET + user_sms_number_id: None | Unset | str = UNSET + user_device_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: enabled_contact_types = [] @@ -42,37 +40,37 @@ def to_dict(self) -> dict[str, Any]: enabled_contact_types_item: str = enabled_contact_types_item_data enabled_contact_types.append(enabled_contact_types_item) - delay: int | None | Unset + delay: None | Unset | int if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | str | Unset + user_email_address_id: None | Unset | str if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: None | str | Unset + user_call_number_id: None | Unset | str if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: None | str | Unset + user_sms_number_id: None | Unset | str if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: None | str | Unset + user_device_id: None | Unset | str if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: @@ -112,57 +110,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled_contact_types.append(enabled_contact_types_item) - def _parse_delay(data: object) -> int | None | Unset: + def _parse_delay(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | str | Unset: + def _parse_user_email_address_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> None | str | Unset: + def _parse_user_call_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> None | str | Unset: + def _parse_user_sms_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> None | str | Unset: + def _parse_user_device_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) diff --git a/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py b/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py index fe523a7e..2083cdae 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py +++ b/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py @@ -1,7 +1,7 @@ from typing import Literal, cast NewUserNotificationRuleDataAttributesEnabledContactTypesItem = Literal[ - "call", "device", "email", "google_chat", "non_critical_device", "slack", "sms" + "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" ] NEW_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES: set[ @@ -11,6 +11,7 @@ "device", "email", "google_chat", + "microsoft_teams", "non_critical_device", "slack", "sms", diff --git a/rootly_sdk/models/new_user_phone_number.py b/rootly_sdk/models/new_user_phone_number.py index 77d68eb2..807f540a 100644 --- a/rootly_sdk/models/new_user_phone_number.py +++ b/rootly_sdk/models/new_user_phone_number.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewUserPhoneNumber: data (NewUserPhoneNumberData): """ - data: NewUserPhoneNumberData + data: "NewUserPhoneNumberData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_user_phone_number_data.py b/rootly_sdk/models/new_user_phone_number_data.py index e5bb6a12..84f944ed 100644 --- a/rootly_sdk/models/new_user_phone_number_data.py +++ b/rootly_sdk/models/new_user_phone_number_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewUserPhoneNumberData: """ type_: NewUserPhoneNumberDataType - attributes: NewUserPhoneNumberDataAttributes + attributes: "NewUserPhoneNumberDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_user_phone_number_data_attributes.py b/rootly_sdk/models/new_user_phone_number_data_attributes.py index 6e977204..b2c4f4c0 100644 --- a/rootly_sdk/models/new_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/new_user_phone_number_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_verified_domain.py b/rootly_sdk/models/new_verified_domain.py new file mode 100644 index 00000000..a3a224e7 --- /dev/null +++ b/rootly_sdk/models/new_verified_domain.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_verified_domain_data import NewVerifiedDomainData + + +T = TypeVar("T", bound="NewVerifiedDomain") + + +@_attrs_define +class NewVerifiedDomain: + """ + Attributes: + data (NewVerifiedDomainData): + """ + + data: "NewVerifiedDomainData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_verified_domain_data import NewVerifiedDomainData + + d = dict(src_dict) + data = NewVerifiedDomainData.from_dict(d.pop("data")) + + new_verified_domain = cls( + data=data, + ) + + new_verified_domain.additional_properties = d + return new_verified_domain + + @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/rootly_sdk/models/new_verified_domain_data.py b/rootly_sdk/models/new_verified_domain_data.py new file mode 100644 index 00000000..13bcf456 --- /dev/null +++ b/rootly_sdk/models/new_verified_domain_data.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_verified_domain_data_type import NewVerifiedDomainDataType, check_new_verified_domain_data_type + +if TYPE_CHECKING: + from ..models.new_verified_domain_data_attributes import NewVerifiedDomainDataAttributes + + +T = TypeVar("T", bound="NewVerifiedDomainData") + + +@_attrs_define +class NewVerifiedDomainData: + """ + Attributes: + type_ (NewVerifiedDomainDataType): + attributes (NewVerifiedDomainDataAttributes): + """ + + type_: NewVerifiedDomainDataType + attributes: "NewVerifiedDomainDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_verified_domain_data_attributes import NewVerifiedDomainDataAttributes + + d = dict(src_dict) + type_ = check_new_verified_domain_data_type(d.pop("type")) + + attributes = NewVerifiedDomainDataAttributes.from_dict(d.pop("attributes")) + + new_verified_domain_data = cls( + type_=type_, + attributes=attributes, + ) + + new_verified_domain_data.additional_properties = d + return new_verified_domain_data + + @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/rootly_sdk/models/new_verified_domain_data_attributes.py b/rootly_sdk/models/new_verified_domain_data_attributes.py new file mode 100644 index 00000000..f5432ffa --- /dev/null +++ b/rootly_sdk/models/new_verified_domain_data_attributes.py @@ -0,0 +1,40 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewVerifiedDomainDataAttributes") + + +@_attrs_define +class NewVerifiedDomainDataAttributes: + """ + Attributes: + domain (str): The domain to verify (e.g. acme.com) + """ + + domain: str + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "domain": domain, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain") + + new_verified_domain_data_attributes = cls( + domain=domain, + ) + + return new_verified_domain_data_attributes diff --git a/rootly_sdk/models/new_verified_domain_data_type.py b/rootly_sdk/models/new_verified_domain_data_type.py new file mode 100644 index 00000000..9e43541d --- /dev/null +++ b/rootly_sdk/models/new_verified_domain_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewVerifiedDomainDataType = Literal["verified_domains"] + +NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES: set[NewVerifiedDomainDataType] = { + "verified_domains", +} + + +def check_new_verified_domain_data_type(value: str | None) -> NewVerifiedDomainDataType | None: + if value is None: + return None + if value in NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES: + return cast(NewVerifiedDomainDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_webhooks_endpoint.py b/rootly_sdk/models/new_webhooks_endpoint.py index 086d10ce..8be7c839 100644 --- a/rootly_sdk/models/new_webhooks_endpoint.py +++ b/rootly_sdk/models/new_webhooks_endpoint.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWebhooksEndpoint: data (NewWebhooksEndpointData): """ - data: NewWebhooksEndpointData + data: "NewWebhooksEndpointData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_webhooks_endpoint_data.py b/rootly_sdk/models/new_webhooks_endpoint_data.py index 08c54004..8022924d 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewWebhooksEndpointData: """ type_: NewWebhooksEndpointDataType - attributes: NewWebhooksEndpointDataAttributes + attributes: "NewWebhooksEndpointDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py index ee615dde..f67b14a6 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,29 +24,37 @@ class NewWebhooksEndpointDataAttributes: Attributes: name (str): The name of the endpoint url (str): The URL of the endpoint. - secret (str | Unset): The webhook signing secret used to verify webhook requests. - event_types (list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset): - enabled (bool | Unset): - custom_headers (list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset): Custom HTTP headers sent with - each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + secret (Union[Unset, str]): The webhook signing secret used to verify webhook requests. + event_types (Union[Unset, list[NewWebhooksEndpointDataAttributesEventTypesItem]]): + enabled (Union[Unset, bool]): + custom_headers (Union[Unset, list['NewWebhooksEndpointDataAttributesCustomHeadersItem']]): Custom HTTP headers + sent with each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. """ name: str url: str - secret: str | Unset = UNSET - event_types: list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - enabled: bool | Unset = UNSET - custom_headers: list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET + slug: None | Unset | str = UNSET + secret: Unset | str = UNSET + event_types: Unset | list[NewWebhooksEndpointDataAttributesEventTypesItem] = UNSET + enabled: Unset | bool = UNSET + custom_headers: Unset | list["NewWebhooksEndpointDataAttributesCustomHeadersItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name url = self.url + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + secret = self.secret - event_types: list[str] | Unset = UNSET + event_types: Unset | list[str] = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -57,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: list[dict[str, Any]] | Unset = UNSET + custom_headers: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -72,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: "url": url, } ) + if slug is not UNSET: + field_dict["slug"] = slug if secret is not UNSET: field_dict["secret"] = secret if event_types is not UNSET: @@ -94,33 +102,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: url = d.pop("url") + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + secret = d.pop("secret", UNSET) + event_types = [] _event_types = d.pop("event_types", UNSET) - event_types: list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - if _event_types is not UNSET: - event_types = [] - for event_types_item_data in _event_types: - event_types_item = check_new_webhooks_endpoint_data_attributes_event_types_item(event_types_item_data) + for event_types_item_data in _event_types or []: + event_types_item = check_new_webhooks_endpoint_data_attributes_event_types_item(event_types_item_data) - event_types.append(event_types_item) + event_types.append(event_types_item) enabled = d.pop("enabled", UNSET) + custom_headers = [] _custom_headers = d.pop("custom_headers", UNSET) - custom_headers: list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET - if _custom_headers is not UNSET: - custom_headers = [] - for custom_headers_item_data in _custom_headers: - custom_headers_item = NewWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( - custom_headers_item_data - ) + for custom_headers_item_data in _custom_headers or []: + custom_headers_item = NewWebhooksEndpointDataAttributesCustomHeadersItem.from_dict(custom_headers_item_data) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) new_webhooks_endpoint_data_attributes = cls( name=name, url=url, + slug=slug, secret=secret, event_types=event_types, enabled=enabled, diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py index 3ffe6bda..cd0fc746 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py index 0ba141cc..a0833ca6 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py @@ -2,6 +2,7 @@ NewWebhooksEndpointDataAttributesEventTypesItem = Literal[ "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", @@ -36,6 +37,7 @@ NEW_WEBHOOKS_ENDPOINT_DATA_ATTRIBUTES_EVENT_TYPES_ITEM_VALUES: set[NewWebhooksEndpointDataAttributesEventTypesItem] = { "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", diff --git a/rootly_sdk/models/new_workflow.py b/rootly_sdk/models/new_workflow.py index e499f14c..a81bad47 100644 --- a/rootly_sdk/models/new_workflow.py +++ b/rootly_sdk/models/new_workflow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflow: data (NewWorkflowData): """ - data: NewWorkflowData + data: "NewWorkflowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition.py index 9033a121..a7923dba 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowActionItemFormFieldCondition: data (NewWorkflowActionItemFormFieldConditionData): """ - data: NewWorkflowActionItemFormFieldConditionData + data: "NewWorkflowActionItemFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py index 5fc82e95..22ae4c1a 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewWorkflowActionItemFormFieldConditionData: """ type_: NewWorkflowActionItemFormFieldConditionDataType - attributes: NewWorkflowActionItemFormFieldConditionDataAttributes + attributes: "NewWorkflowActionItemFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py index 9e6b01df..fa2a2968 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,73 +19,73 @@ class NewWorkflowActionItemFormFieldConditionDataAttributes: form_field_id (str): The custom field for this condition action_item_condition (NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition): The trigger condition Default: 'ANY'. - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ form_field_id: str action_item_condition: NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = "ANY" - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id action_item_condition: str = self.action_item_condition - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/new_workflow_custom_field_selection.py b/rootly_sdk/models/new_workflow_custom_field_selection.py index 975e1d93..cd9250c3 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowCustomFieldSelection: data (NewWorkflowCustomFieldSelectionData): """ - data: NewWorkflowCustomFieldSelectionData + data: "NewWorkflowCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data.py b/rootly_sdk/models/new_workflow_custom_field_selection_data.py index 7a299699..6c4e4d0b 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewWorkflowCustomFieldSelectionData: """ type_: NewWorkflowCustomFieldSelectionDataType - attributes: NewWorkflowCustomFieldSelectionDataAttributes + attributes: "NewWorkflowCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py index fecb492e..00110ee1 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,16 +19,16 @@ class NewWorkflowCustomFieldSelectionDataAttributes: custom_field_id (int): The custom field for this selection incident_condition (NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition): The trigger condition Default: 'ANY'. - workflow_id (str | Unset): The workflow for this selection - values (list[str] | Unset): - selected_option_ids (list[int] | Unset): + workflow_id (Union[Unset, str]): The workflow for this selection + values (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[int]]): """ custom_field_id: int incident_condition: NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" - workflow_id: str | Unset = UNSET - values: list[str] | Unset = UNSET - selected_option_ids: list[int] | Unset = UNSET + workflow_id: Unset | str = UNSET + values: Unset | list[str] = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id @@ -39,11 +37,11 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids diff --git a/rootly_sdk/models/new_workflow_data.py b/rootly_sdk/models/new_workflow_data.py index 3cf1a8d0..e3514997 100644 --- a/rootly_sdk/models/new_workflow_data.py +++ b/rootly_sdk/models/new_workflow_data.py @@ -1,10 +1,7 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_workflow_data_type import NewWorkflowDataType, check_new_workflow_data_type @@ -24,17 +21,15 @@ class NewWorkflowData: """ type_: NewWorkflowDataType - attributes: NewWorkflowDataAttributes - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: "NewWorkflowDataAttributes" def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +53,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_data.additional_properties = d return new_workflow_data - - @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/rootly_sdk/models/new_workflow_data_attributes.py b/rootly_sdk/models/new_workflow_data_attributes.py index 8badb4d0..9224ab83 100644 --- a/rootly_sdk/models/new_workflow_data_attributes.py +++ b/rootly_sdk/models/new_workflow_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -31,69 +29,72 @@ class NewWorkflowDataAttributes: """ Attributes: name (str): The title of the workflow - description (None | str | Unset): The description of the workflow - command (None | str | Unset): Workflow command - command_feedback_enabled (bool | None | Unset): This will notify you back when the workflow is starting - wait (None | str | Unset): Wait this duration before executing - priority (NewWorkflowDataAttributesPriority | Unset): Priority - repeat_every_duration (None | str | Unset): Repeat workflow every duration - repeat_condition_duration_since_first_run (None | str | Unset): The workflow will stop repeating if its runtime - since it's first workflow run exceeds the duration set in this field - repeat_condition_number_of_repeats (int | Unset): The workflow will stop repeating if the number of repeats - exceeds the value set in this field - continuously_repeat (bool | Unset): When continuously repeat is true, repeat workflows aren't automatically - stopped when conditions aren't met. This setting won't override your conditions set by + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the workflow + command (Union[None, Unset, str]): Workflow command + command_feedback_enabled (Union[None, Unset, bool]): This will notify you back when the workflow is starting + wait (Union[None, Unset, str]): Wait this duration before executing + priority (Union[Unset, NewWorkflowDataAttributesPriority]): Priority + repeat_every_duration (Union[None, Unset, str]): Repeat workflow every duration + repeat_condition_duration_since_first_run (Union[None, Unset, str]): The workflow will stop repeating if its + runtime since it's first workflow run exceeds the duration set in this field + repeat_condition_number_of_repeats (Union[Unset, int]): The workflow will stop repeating if the number of + repeats exceeds the value set in this field + continuously_repeat (Union[Unset, bool]): When continuously repeat is true, repeat workflows aren't + automatically stopped when conditions aren't met. This setting won't override your conditions set by repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - repeat_on (list[NewWorkflowDataAttributesRepeatOnItem] | Unset): - enabled (bool | Unset): - locked (bool | Unset): Restricts workflow edits to admins when turned on. Only admins can set this field. - position (int | Unset): The order which the workflow should run with other workflows. - workflow_group_id (None | str | Unset): The group this workflow belongs to. - trigger_params (ActionItemTriggerParams | AlertTriggerParams | IncidentTriggerParams | PulseTriggerParams | - SimpleTriggerParams | Unset): - environment_ids (list[str] | Unset): - severity_ids (list[str] | Unset): - incident_type_ids (list[str] | Unset): - incident_role_ids (list[str] | Unset): - service_ids (list[str] | Unset): - functionality_ids (list[str] | Unset): - group_ids (list[str] | Unset): - cause_ids (list[str] | Unset): - sub_status_ids (list[str] | Unset): + repeat_on (Union[Unset, list[NewWorkflowDataAttributesRepeatOnItem]]): + enabled (Union[Unset, bool]): + locked (Union[Unset, bool]): Restricts workflow edits to admins when turned on. Only admins can set this field. + position (Union[Unset, int]): The order which the workflow should run with other workflows. + workflow_group_id (Union[None, Unset, str]): The group this workflow belongs to. + trigger_params (Union['ActionItemTriggerParams', 'AlertTriggerParams', 'IncidentTriggerParams', + 'PulseTriggerParams', 'SimpleTriggerParams', Unset]): + environment_ids (Union[Unset, list[str]]): + severity_ids (Union[Unset, list[str]]): + incident_type_ids (Union[Unset, list[str]]): + incident_role_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): + functionality_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): + cause_ids (Union[Unset, list[str]]): + sub_status_ids (Union[Unset, list[str]]): """ name: str - description: None | str | Unset = UNSET - command: None | str | Unset = UNSET - command_feedback_enabled: bool | None | Unset = UNSET - wait: None | str | Unset = UNSET - priority: NewWorkflowDataAttributesPriority | Unset = UNSET - repeat_every_duration: None | str | Unset = UNSET - repeat_condition_duration_since_first_run: None | str | Unset = UNSET - repeat_condition_number_of_repeats: int | Unset = UNSET - continuously_repeat: bool | Unset = UNSET - repeat_on: list[NewWorkflowDataAttributesRepeatOnItem] | Unset = UNSET - enabled: bool | Unset = UNSET - locked: bool | Unset = UNSET - position: int | Unset = UNSET - workflow_group_id: None | str | Unset = UNSET - trigger_params: ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ) = UNSET - environment_ids: list[str] | Unset = UNSET - severity_ids: list[str] | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - incident_role_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - cause_ids: list[str] | Unset = UNSET - sub_status_ids: list[str] | Unset = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + command: None | Unset | str = UNSET + command_feedback_enabled: None | Unset | bool = UNSET + wait: None | Unset | str = UNSET + priority: Unset | NewWorkflowDataAttributesPriority = UNSET + repeat_every_duration: None | Unset | str = UNSET + repeat_condition_duration_since_first_run: None | Unset | str = UNSET + repeat_condition_number_of_repeats: Unset | int = UNSET + continuously_repeat: Unset | bool = UNSET + repeat_on: Unset | list[NewWorkflowDataAttributesRepeatOnItem] = UNSET + enabled: Unset | bool = UNSET + locked: Unset | bool = UNSET + position: Unset | int = UNSET + workflow_group_id: None | Unset | str = UNSET + trigger_params: Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ] = UNSET + environment_ids: Unset | list[str] = UNSET + severity_ids: Unset | list[str] = UNSET + incident_type_ids: Unset | list[str] = UNSET + incident_role_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + cause_ids: Unset | list[str] = UNSET + sub_status_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -103,41 +104,47 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | str | Unset + command: None | Unset | str if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: bool | None | Unset + command_feedback_enabled: None | Unset | bool if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | str | Unset + wait: None | Unset | str if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - repeat_every_duration: None | str | Unset + repeat_every_duration: None | Unset | str if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: None | str | Unset + repeat_condition_duration_since_first_run: None | Unset | str if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -147,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: list[str] | Unset = UNSET + repeat_on: Unset | list[str] = UNSET if not isinstance(self.repeat_on, Unset): repeat_on = [] for repeat_on_item_data in self.repeat_on: @@ -160,13 +167,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | str | Unset + workflow_group_id: None | Unset | str if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: dict[str, Any] | Unset + trigger_params: Unset | dict[str, Any] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -180,39 +187,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: list[str] | Unset = UNSET + severity_ids: Unset | list[str] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: list[str] | Unset = UNSET + incident_role_ids: Unset | list[str] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: list[str] | Unset = UNSET + cause_ids: Unset | list[str] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: list[str] | Unset = UNSET + sub_status_ids: Unset | list[str] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -223,6 +230,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if command is not UNSET: @@ -285,64 +294,73 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | str | Unset: + def _parse_command(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: + def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | str | Unset: + def _parse_wait(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) wait = _parse_wait(d.pop("wait", UNSET)) _priority = d.pop("priority", UNSET) - priority: NewWorkflowDataAttributesPriority | Unset + priority: Unset | NewWorkflowDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_workflow_data_attributes_priority(_priority) - def _parse_repeat_every_duration(data: object) -> None | str | Unset: + def _parse_repeat_every_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -352,14 +370,12 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str continuously_repeat = d.pop("continuously_repeat", UNSET) + repeat_on = [] _repeat_on = d.pop("repeat_on", UNSET) - repeat_on: list[NewWorkflowDataAttributesRepeatOnItem] | Unset = UNSET - if _repeat_on is not UNSET: - repeat_on = [] - for repeat_on_item_data in _repeat_on: - repeat_on_item = check_new_workflow_data_attributes_repeat_on_item(repeat_on_item_data) + for repeat_on_item_data in _repeat_on or []: + repeat_on_item = check_new_workflow_data_attributes_repeat_on_item(repeat_on_item_data) - repeat_on.append(repeat_on_item) + repeat_on.append(repeat_on_item) enabled = d.pop("enabled", UNSET) @@ -367,25 +383,25 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | str | Unset: + def _parse_workflow_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ): + ) -> Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -394,7 +410,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -402,7 +418,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -410,7 +426,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -418,7 +434,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -448,6 +464,7 @@ def _parse_trigger_params( new_workflow_data_attributes = cls( name=name, + slug=slug, description=description, command=command, command_feedback_enabled=command_feedback_enabled, diff --git a/rootly_sdk/models/new_workflow_form_field_condition.py b/rootly_sdk/models/new_workflow_form_field_condition.py index ac32f11d..37f162dc 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition.py +++ b/rootly_sdk/models/new_workflow_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowFormFieldCondition: data (NewWorkflowFormFieldConditionData): """ - data: NewWorkflowFormFieldConditionData + data: "NewWorkflowFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_form_field_condition_data.py b/rootly_sdk/models/new_workflow_form_field_condition_data.py index ccbc5b02..f5fef4a1 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewWorkflowFormFieldConditionData: """ type_: NewWorkflowFormFieldConditionDataType - attributes: NewWorkflowFormFieldConditionDataAttributes + attributes: "NewWorkflowFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py index 5c662698..b07a145f 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,32 +19,32 @@ class NewWorkflowFormFieldConditionDataAttributes: form_field_id (str): The custom field for this condition incident_condition (NewWorkflowFormFieldConditionDataAttributesIncidentCondition): The trigger condition Default: 'ANY'. - workflow_id (str | Unset): The workflow for this condition - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + workflow_id (Union[Unset, str]): The workflow for this condition + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ form_field_id: str incident_condition: NewWorkflowFormFieldConditionDataAttributesIncidentCondition = "ANY" - workflow_id: str | Unset = UNSET - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + workflow_id: Unset | str = UNSET + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id @@ -55,43 +53,43 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/new_workflow_group.py b/rootly_sdk/models/new_workflow_group.py index cbe30f10..bbfbb047 100644 --- a/rootly_sdk/models/new_workflow_group.py +++ b/rootly_sdk/models/new_workflow_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowGroup: data (NewWorkflowGroupData): """ - data: NewWorkflowGroupData + data: "NewWorkflowGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_group_data.py b/rootly_sdk/models/new_workflow_group_data.py index 00fab324..5f6b9600 100644 --- a/rootly_sdk/models/new_workflow_group_data.py +++ b/rootly_sdk/models/new_workflow_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewWorkflowGroupData: """ type_: NewWorkflowGroupDataType - attributes: NewWorkflowGroupDataAttributes + attributes: "NewWorkflowGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_group_data_attributes.py b/rootly_sdk/models/new_workflow_group_data_attributes.py index 29d5a22d..2ca72540 100644 --- a/rootly_sdk/models/new_workflow_group_data_attributes.py +++ b/rootly_sdk/models/new_workflow_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,29 +18,38 @@ class NewWorkflowGroupDataAttributes: """ Attributes: name (str): The name of the workflow group. - kind (NewWorkflowGroupDataAttributesKind | Unset): The kind of the workflow group - description (None | str | Unset): A description of the workflow group. - icon (str | Unset): An emoji icon displayed next to the workflow group. - expanded (bool | Unset): Whether the group is expanded or collapsed. - position (int | Unset): The position of the workflow group + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name` and `kind`; any submitted value is + ignored. This property will be removed from the request schema in a future version. + kind (Union[Unset, NewWorkflowGroupDataAttributesKind]): The kind of the workflow group + description (Union[None, Unset, str]): A description of the workflow group. + icon (Union[Unset, str]): An emoji icon displayed next to the workflow group. + expanded (Union[Unset, bool]): Whether the group is expanded or collapsed. + position (Union[Unset, int]): The position of the workflow group """ name: str - kind: NewWorkflowGroupDataAttributesKind | Unset = UNSET - description: None | str | Unset = UNSET - icon: str | Unset = UNSET - expanded: bool | Unset = UNSET - position: int | Unset = UNSET + slug: None | Unset | str = UNSET + kind: Unset | NewWorkflowGroupDataAttributesKind = UNSET + description: None | Unset | str = UNSET + icon: Unset | str = UNSET + expanded: Unset | bool = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - kind: str | Unset = UNSET + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -61,6 +68,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if kind is not UNSET: field_dict["kind"] = kind if description is not UNSET: @@ -79,19 +88,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _kind = d.pop("kind", UNSET) - kind: NewWorkflowGroupDataAttributesKind | Unset + kind: Unset | NewWorkflowGroupDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_workflow_group_data_attributes_kind(_kind) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -103,6 +121,7 @@ def _parse_description(data: object) -> None | str | Unset: new_workflow_group_data_attributes = cls( name=name, + slug=slug, kind=kind, description=description, icon=icon, diff --git a/rootly_sdk/models/new_workflow_run.py b/rootly_sdk/models/new_workflow_run.py index 489e4c89..877a070c 100644 --- a/rootly_sdk/models/new_workflow_run.py +++ b/rootly_sdk/models/new_workflow_run.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowRun: data (NewWorkflowRunData): """ - data: NewWorkflowRunData + data: "NewWorkflowRunData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_run_data.py b/rootly_sdk/models/new_workflow_run_data.py index 6f30cb5c..3d35b9ab 100644 --- a/rootly_sdk/models/new_workflow_run_data.py +++ b/rootly_sdk/models/new_workflow_run_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,20 +23,20 @@ class NewWorkflowRunData: """ Attributes: type_ (NewWorkflowRunDataType): - attributes (NewWorkflowRunDataAttributesType0 | NewWorkflowRunDataAttributesType1 | - NewWorkflowRunDataAttributesType2 | NewWorkflowRunDataAttributesType3 | NewWorkflowRunDataAttributesType4 | - NewWorkflowRunDataAttributesType5): + attributes (Union['NewWorkflowRunDataAttributesType0', 'NewWorkflowRunDataAttributesType1', + 'NewWorkflowRunDataAttributesType2', 'NewWorkflowRunDataAttributesType3', 'NewWorkflowRunDataAttributesType4', + 'NewWorkflowRunDataAttributesType5']): """ type_: NewWorkflowRunDataType - attributes: ( - NewWorkflowRunDataAttributesType0 - | NewWorkflowRunDataAttributesType1 - | NewWorkflowRunDataAttributesType2 - | NewWorkflowRunDataAttributesType3 - | NewWorkflowRunDataAttributesType4 - | NewWorkflowRunDataAttributesType5 - ) + attributes: Union[ + "NewWorkflowRunDataAttributesType0", + "NewWorkflowRunDataAttributesType1", + "NewWorkflowRunDataAttributesType2", + "NewWorkflowRunDataAttributesType3", + "NewWorkflowRunDataAttributesType4", + "NewWorkflowRunDataAttributesType5", + ] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -89,21 +87,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_attributes( data: object, - ) -> ( - NewWorkflowRunDataAttributesType0 - | NewWorkflowRunDataAttributesType1 - | NewWorkflowRunDataAttributesType2 - | NewWorkflowRunDataAttributesType3 - | NewWorkflowRunDataAttributesType4 - | NewWorkflowRunDataAttributesType5 - ): + ) -> Union[ + "NewWorkflowRunDataAttributesType0", + "NewWorkflowRunDataAttributesType1", + "NewWorkflowRunDataAttributesType2", + "NewWorkflowRunDataAttributesType3", + "NewWorkflowRunDataAttributesType4", + "NewWorkflowRunDataAttributesType5", + ]: try: if not isinstance(data, dict): raise TypeError() attributes_type_0 = NewWorkflowRunDataAttributesType0.from_dict(data) return attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -111,7 +109,7 @@ def _parse_attributes( attributes_type_1 = NewWorkflowRunDataAttributesType1.from_dict(data) return attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -119,7 +117,7 @@ def _parse_attributes( attributes_type_2 = NewWorkflowRunDataAttributesType2.from_dict(data) return attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -127,7 +125,7 @@ def _parse_attributes( attributes_type_3 = NewWorkflowRunDataAttributesType3.from_dict(data) return attributes_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -135,7 +133,7 @@ def _parse_attributes( attributes_type_4 = NewWorkflowRunDataAttributesType4.from_dict(data) return attributes_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py index 75346b25..ae4f183a 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,33 +17,32 @@ class NewWorkflowRunDataAttributesType0: """ Attributes: - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow. Default: + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow. Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created. Default: False. - context (NewWorkflowRunDataAttributesType0Context | Unset): + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created. Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType0Context]): """ - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType0Context | Unset = UNSET + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False + context: Union[Unset, "NewWorkflowRunDataAttributesType0Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - immediate: bool | None | Unset + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -67,26 +64,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType0Context | Unset + context: Unset | NewWorkflowRunDataAttributesType0Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py index 9bce16b4..14da9532 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType0Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py index 9bc7f2a1..6c0a8724 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType1: """ Attributes: incident_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType1Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType1Context]): """ incident_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType1Context | Unset = UNSET + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False + context: Union[Unset, "NewWorkflowRunDataAttributesType1Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_id = self.incident_id - immediate: bool | None | Unset + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) incident_id = d.pop("incident_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType1Context | Unset + context: Unset | NewWorkflowRunDataAttributesType1Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py index 20304b26..eaaac054 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType1Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py index 7e8c4507..eaefbd9c 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType2: """ Attributes: post_mortem_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType2Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType2Context]): """ post_mortem_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType2Context | Unset = UNSET + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False + context: Union[Unset, "NewWorkflowRunDataAttributesType2Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - post_mortem_id = self.post_mortem_id - immediate: bool | None | Unset + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) post_mortem_id = d.pop("post_mortem_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType2Context | Unset + context: Unset | NewWorkflowRunDataAttributesType2Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py index 739fa7bc..70834bdd 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType2Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py index 4b82e605..42aa6168 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType3: """ Attributes: action_item_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType3Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType3Context]): """ action_item_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType3Context | Unset = UNSET + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False + context: Union[Unset, "NewWorkflowRunDataAttributesType3Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action_item_id = self.action_item_id - immediate: bool | None | Unset + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) action_item_id = d.pop("action_item_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType3Context | Unset + context: Unset | NewWorkflowRunDataAttributesType3Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py index 25eabc0f..dd12425a 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType3Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py index b55b35af..7fecfc0a 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType4: """ Attributes: alert_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType4Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType4Context]): """ alert_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType4Context | Unset = UNSET + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False + context: Union[Unset, "NewWorkflowRunDataAttributesType4Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - alert_id = self.alert_id - immediate: bool | None | Unset + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_id = d.pop("alert_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType4Context | Unset + context: Unset | NewWorkflowRunDataAttributesType4Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py index 8c969b82..c29a13ef 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType4Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py index 797c45f2..047f5885 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType5: """ Attributes: pulse_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType5Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType5Context]): """ pulse_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType5Context | Unset = UNSET + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False + context: Union[Unset, "NewWorkflowRunDataAttributesType5Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - pulse_id = self.pulse_id - immediate: bool | None | Unset + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) pulse_id = d.pop("pulse_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType5Context | Unset + context: Unset | NewWorkflowRunDataAttributesType5Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py index 02e65077..d0be7a1e 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType5Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_task.py b/rootly_sdk/models/new_workflow_task.py index 0e065727..0d7f4bf9 100644 --- a/rootly_sdk/models/new_workflow_task.py +++ b/rootly_sdk/models/new_workflow_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowTask: data (NewWorkflowTaskData): """ - data: NewWorkflowTaskData + data: "NewWorkflowTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_task_data.py b/rootly_sdk/models/new_workflow_task_data.py index eab5be62..ac4a7123 100644 --- a/rootly_sdk/models/new_workflow_task_data.py +++ b/rootly_sdk/models/new_workflow_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewWorkflowTaskData: """ type_: NewWorkflowTaskDataType - attributes: NewWorkflowTaskDataAttributes + attributes: "NewWorkflowTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_task_data_attributes.py b/rootly_sdk/models/new_workflow_task_data_attributes.py index a38f85cc..9e7fb4b3 100644 --- a/rootly_sdk/models/new_workflow_task_data_attributes.py +++ b/rootly_sdk/models/new_workflow_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -21,11 +19,18 @@ from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -188,236 +193,247 @@ class NewWorkflowTaskDataAttributes: """ Attributes: - task_params (AddActionItemTaskParams | AddMicrosoftTeamsChatTabTaskParams | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 | AddRoleTaskParams | AddSlackBookmarkTaskParamsType0 | - AddSlackBookmarkTaskParamsType1 | AddTeamTaskParams | AddToTimelineTaskParams | - ArchiveGoogleChatSpacesTaskParams | ArchiveMicrosoftTeamsChannelsTaskParams | ArchiveSlackChannelsTaskParams | - AttachDatadogDashboardsTaskParams | AttachRetrospectivePdfToJiraIssueTaskParams | - AutoAssignRoleOpsgenieTaskParams | AutoAssignRolePagerdutyTaskParamsType0 | - AutoAssignRolePagerdutyTaskParamsType1 | AutoAssignRoleRootlyTaskParams | AutoAssignRoleVictorOpsTaskParams | - CallPeopleTaskParams | ChangeGoogleChatSpacePrivacyTaskParams | ChangeSlackChannelPrivacyTaskParams | - CreateAirtableTableRecordTaskParams | CreateAnthropicChatCompletionTaskParams | CreateAsanaSubtaskTaskParams | - CreateAsanaTaskTaskParams | CreateClickupTaskTaskParams | CreateCodaPageTaskParams | - CreateConfluencePageTaskParams | CreateDatadogNotebookTaskParams | CreateDropboxPaperPageTaskParams | - CreateGithubIssueTaskParams | CreateGitlabIssueTaskParams | CreateGoogleCalendarEventTaskParams | - CreateGoogleChatSpaceTaskParams | CreateGoogleDocsPageTaskParams | CreateGoogleDocsPermissionsTaskParams | - CreateGoogleGeminiChatCompletionTaskParams | CreateGoogleMeetingTaskParams | CreateGoToMeetingTaskParams | - CreateIncidentPostmortemTaskParams | CreateIncidentTaskParams | CreateJiraIssueTaskParams | - CreateJiraSubtaskTaskParams | CreateJsmopsAlertTaskParams | CreateLinearIssueCommentTaskParams | - CreateLinearIssueTaskParams | CreateLinearSubtaskIssueTaskParams | CreateMicrosoftTeamsChannelTaskParams | - CreateMicrosoftTeamsChatTaskParams | CreateMicrosoftTeamsMeetingTaskParams | - CreateMistralChatCompletionTaskParams | CreateMotionTaskTaskParams | CreateNotionPageTaskParams | - CreateOpenaiChatCompletionTaskParams | CreateOpsgenieAlertTaskParams | CreateOutlookEventTaskParams | - CreatePagerdutyStatusUpdateTaskParams | CreatePagertreeAlertTaskParams | CreateQuipPageTaskParams | - CreateServiceNowIncidentTaskParams | CreateSharepointPageTaskParams | CreateShortcutStoryTaskParamsType0 | - CreateShortcutStoryTaskParamsType1 | CreateShortcutTaskTaskParams | CreateSlackChannelTaskParams | - CreateSubIncidentTaskParams | CreateTrelloCardTaskParams | CreateWatsonxChatCompletionTaskParams | - CreateWebexMeetingTaskParams | CreateZendeskJiraLinkTaskParams | CreateZendeskTicketTaskParams | - CreateZoomMeetingTaskParams | GetAlertsTaskParams | GetGithubCommitsTaskParamsType0 | - GetGithubCommitsTaskParamsType1 | GetGitlabCommitsTaskParamsType0 | GetGitlabCommitsTaskParamsType1 | - GetPulsesTaskParams | HttpClientTaskParams | InviteToGoogleChatSpaceTaskParams | - InviteToMicrosoftTeamsChannelRootlyTaskParams | InviteToMicrosoftTeamsChannelTaskParams | - InviteToSlackChannelOpsgenieTaskParams | InviteToSlackChannelPagerdutyTaskParamsType0 | - InviteToSlackChannelPagerdutyTaskParamsType1 | InviteToSlackChannelRootlyTaskParams | - InviteToSlackChannelTaskParamsType0 | InviteToSlackChannelTaskParamsType1 | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams | PageJsmopsOnCallRespondersTaskParams | - PageOpsgenieOnCallRespondersTaskParams | PagePagerdutyOnCallRespondersTaskParams | - PageRootlyOnCallRespondersTaskParams | PageVictorOpsOnCallRespondersTaskParamsType0 | - PageVictorOpsOnCallRespondersTaskParamsType1 | PrintTaskParams | PublishIncidentTaskParams | - RedisClientTaskParams | RemoveGoogleDocsPermissionsTaskParams | RenameGoogleChatSpaceTaskParams | - RenameMicrosoftTeamsChannelTaskParams | RenameSlackChannelTaskParams | RunCommandHerokuTaskParams | - SendDashboardReportTaskParams | SendEmailTaskParams | SendGoogleChatAttachmentsTaskParams | - SendGoogleChatMessageTaskParams | SendMicrosoftTeamsBlocksTaskParamsType0 | - SendMicrosoftTeamsChatMessageTaskParams | SendMicrosoftTeamsMessageTaskParamsType0 | - SendSlackBlocksTaskParamsType0 | SendSlackBlocksTaskParamsType1 | SendSlackBlocksTaskParamsType2 | - SendSlackMessageTaskParamsType0 | SendSlackMessageTaskParamsType1 | SendSlackMessageTaskParamsType2 | - SendSmsTaskParams | SendWhatsappMessageTaskParams | SnapshotDatadogGraphTaskParams | - SnapshotGrafanaDashboardTaskParams | SnapshotLookerLookTaskParams | SnapshotNewRelicGraphTaskParams | - TriggerWorkflowTaskParams | TweetTwitterMessageTaskParams | UpdateActionItemTaskParams | - UpdateAirtableTableRecordTaskParams | UpdateAsanaTaskTaskParams | UpdateAttachedAlertsTaskParams | - UpdateClickupTaskTaskParams | UpdateCodaPageTaskParams | UpdateConfluencePageTaskParams | - UpdateDatadogNotebookTaskParams | UpdateDropboxPaperPageTaskParams | UpdateGithubIssueTaskParams | - UpdateGitlabIssueTaskParams | UpdateGoogleCalendarEventTaskParams | UpdateGoogleChatSpaceDescriptionTaskParams | - UpdateGoogleDocsPageTaskParams | UpdateIncidentPostmortemTaskParams | UpdateIncidentStatusTimestampTaskParams | - UpdateIncidentTaskParams | UpdateJiraIssueTaskParams | UpdateLinearIssueTaskParams | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams | UpdateOpsgenieAlertTaskParams | UpdateOpsgenieIncidentTaskParams | - UpdatePagerdutyIncidentTaskParams | UpdatePagertreeAlertTaskParams | UpdateQuipPageTaskParams | - UpdateServiceNowIncidentTaskParams | UpdateSharepointPageTaskParams | UpdateShortcutStoryTaskParams | - UpdateShortcutTaskTaskParams | UpdateSlackChannelTopicTaskParams | UpdateStatusTaskParams | - UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | UpdateZendeskTicketTaskParams): - name (str | Unset): Name of the workflow task - position (int | Unset): The position of the workflow task - skip_on_failure (bool | Unset): Skip workflow task if any failures - enabled (bool | Unset): Enable/disable workflow task Default: True. + task_params (Union['AddActionItemTaskParams', 'AddMicrosoftTeamsChatTabTaskParams', + 'AddMicrosoftTeamsTabTaskParamsType0', 'AddMicrosoftTeamsTabTaskParamsType1', 'AddRoleTaskParams', + 'AddSlackBookmarkTaskParamsType0', 'AddSlackBookmarkTaskParamsType1', 'AddTeamTaskParams', + 'AddToTimelineTaskParams', 'ArchiveGoogleChatSpacesTaskParams', 'ArchiveMicrosoftTeamsChannelsTaskParams', + 'ArchiveSlackChannelsTaskParams', 'AttachDatadogDashboardsTaskParams', + 'AttachRetrospectivePdfToFreshserviceTicketTaskParams', 'AttachRetrospectivePdfToJiraIssueTaskParams', + 'AutoAssignRoleOpsgenieTaskParams', 'AutoAssignRolePagerdutyTaskParamsType0', + 'AutoAssignRolePagerdutyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType0', + 'AutoAssignRoleRootlyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType2', + 'AutoAssignRoleRootlyTaskParamsType3', 'AutoAssignRoleRootlyTaskParamsType4', + 'AutoAssignRoleVictorOpsTaskParams', 'CallPeopleTaskParams', 'ChangeGoogleChatSpacePrivacyTaskParams', + 'ChangeSlackChannelPrivacyTaskParams', 'CreateAirtableTableRecordTaskParams', + 'CreateAnthropicChatCompletionTaskParams', 'CreateAsanaSubtaskTaskParams', 'CreateAsanaTaskTaskParams', + 'CreateClickupTaskTaskParams', 'CreateCodaPageTaskParams', 'CreateConfluencePageTaskParams', + 'CreateDatadogNotebookTaskParams', 'CreateDropboxPaperPageTaskParams', 'CreateGithubIssueTaskParams', + 'CreateGitlabIssueTaskParams', 'CreateGoToMeetingTaskParams', 'CreateGoogleCalendarEventTaskParams', + 'CreateGoogleChatSpaceTaskParams', 'CreateGoogleDocsPageTaskParams', 'CreateGoogleDocsPermissionsTaskParams', + 'CreateGoogleGeminiChatCompletionTaskParams', 'CreateGoogleMeetingTaskParams', + 'CreateIncidentPostmortemTaskParams', 'CreateIncidentTaskParams', 'CreateJiraIssueTaskParams', + 'CreateJiraSubtaskTaskParams', 'CreateJsmopsAlertTaskParams', 'CreateLinearIssueCommentTaskParams', + 'CreateLinearIssueTaskParams', 'CreateLinearSubtaskIssueTaskParams', 'CreateMicrosoftTeamsChannelTaskParams', + 'CreateMicrosoftTeamsChatTaskParams', 'CreateMicrosoftTeamsMeetingTaskParams', + 'CreateMistralChatCompletionTaskParams', 'CreateMotionTaskTaskParams', 'CreateNotionPageTaskParams', + 'CreateOpenaiChatCompletionTaskParams', 'CreateOpsgenieAlertTaskParams', 'CreateOutlookEventTaskParams', + 'CreatePagerdutyStatusUpdateTaskParams', 'CreatePagertreeAlertTaskParams', 'CreateQuipPageTaskParams', + 'CreateServiceNowIncidentTaskParams', 'CreateSharepointPageTaskParams', 'CreateShortcutStoryTaskParamsType0', + 'CreateShortcutStoryTaskParamsType1', 'CreateShortcutTaskTaskParams', 'CreateSlackChannelTaskParams', + 'CreateSubIncidentTaskParams', 'CreateTrelloCardTaskParams', 'CreateWatsonxChatCompletionTaskParams', + 'CreateWebexMeetingTaskParams', 'CreateZendeskJiraLinkTaskParams', 'CreateZendeskTicketTaskParams', + 'CreateZoomMeetingTaskParams', 'GetAlertsTaskParams', 'GetGithubCommitsTaskParamsType0', + 'GetGithubCommitsTaskParamsType1', 'GetGitlabCommitsTaskParamsType0', 'GetGitlabCommitsTaskParamsType1', + 'GetPulsesTaskParams', 'HttpClientTaskParams', 'InviteToGoogleChatSpaceTaskParams', + 'InviteToMicrosoftTeamsChannelRootlyTaskParams', 'InviteToMicrosoftTeamsChannelTaskParams', + 'InviteToSlackChannelOpsgenieTaskParams', 'InviteToSlackChannelPagerdutyTaskParamsType0', + 'InviteToSlackChannelPagerdutyTaskParamsType1', 'InviteToSlackChannelRootlyTaskParams', + 'InviteToSlackChannelTaskParamsType0', 'InviteToSlackChannelTaskParamsType1', + 'InviteToSlackChannelTaskParamsType2', 'InviteToSlackChannelVictorOpsTaskParams', + 'PageJsmopsOnCallRespondersTaskParams', 'PageOpsgenieOnCallRespondersTaskParams', + 'PagePagerdutyOnCallRespondersTaskParams', 'PageRootlyOnCallRespondersTaskParams', + 'PageVictorOpsOnCallRespondersTaskParamsType0', 'PageVictorOpsOnCallRespondersTaskParamsType1', + 'PrintTaskParams', 'PublishIncidentTaskParams', 'RedisClientTaskParams', + 'RemoveGoogleDocsPermissionsTaskParams', 'RenameGoogleChatSpaceTaskParams', + 'RenameMicrosoftTeamsChannelTaskParams', 'RenameSlackChannelTaskParams', 'RunCommandHerokuTaskParams', + 'SendDashboardReportTaskParams', 'SendEmailTaskParams', 'SendGoogleChatAttachmentsTaskParams', + 'SendGoogleChatMessageTaskParams', 'SendMicrosoftTeamsBlocksTaskParamsType0', + 'SendMicrosoftTeamsChatMessageTaskParams', 'SendMicrosoftTeamsMessageTaskParamsType0', + 'SendSlackBlocksTaskParamsType0', 'SendSlackBlocksTaskParamsType1', 'SendSlackBlocksTaskParamsType2', + 'SendSlackMessageTaskParamsType0', 'SendSlackMessageTaskParamsType1', 'SendSlackMessageTaskParamsType2', + 'SendSmsTaskParams', 'SendWhatsappMessageTaskParams', 'SnapshotDatadogGraphTaskParams', + 'SnapshotGrafanaDashboardTaskParams', 'SnapshotLookerLookTaskParams', 'SnapshotNewRelicGraphTaskParams', + 'TriggerWorkflowTaskParams', 'TweetTwitterMessageTaskParams', 'UpdateActionItemTaskParams', + 'UpdateAirtableTableRecordTaskParams', 'UpdateAsanaTaskTaskParams', 'UpdateAttachedAlertsTaskParams', + 'UpdateClickupTaskTaskParams', 'UpdateCodaPageTaskParams', 'UpdateConfluencePageTaskParams', + 'UpdateDatadogNotebookTaskParams', 'UpdateDropboxPaperPageTaskParams', 'UpdateGithubIssueTaskParams', + 'UpdateGitlabIssueTaskParams', 'UpdateGoogleCalendarEventTaskParams', + 'UpdateGoogleChatSpaceDescriptionTaskParams', 'UpdateGoogleDocsPageTaskParams', + 'UpdateIncidentPostmortemTaskParams', 'UpdateIncidentStatusTimestampTaskParams', 'UpdateIncidentTaskParams', + 'UpdateJiraIssueTaskParams', 'UpdateLinearIssueTaskParams', 'UpdateMotionTaskTaskParams', + 'UpdateNotionPageTaskParams', 'UpdateOpsgenieAlertTaskParams', 'UpdateOpsgenieIncidentTaskParams', + 'UpdatePagerdutyIncidentTaskParams', 'UpdatePagertreeAlertTaskParams', 'UpdateQuipPageTaskParams', + 'UpdateServiceNowIncidentTaskParams', 'UpdateSharepointPageTaskParams', 'UpdateShortcutStoryTaskParams', + 'UpdateShortcutTaskTaskParams', 'UpdateSlackChannelTopicTaskParams', 'UpdateStatusTaskParams', + 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams']): + name (Union[Unset, str]): Name of the workflow task + position (Union[Unset, int]): The position of the workflow task + skip_on_failure (Union[Unset, bool]): Skip workflow task if any failures + enabled (Union[Unset, bool]): Enable/disable workflow task Default: True. """ - task_params: ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ) - name: str | Unset = UNSET - position: int | Unset = UNSET - skip_on_failure: bool | Unset = UNSET - enabled: bool | Unset = True + task_params: Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ] + name: Unset | str = UNSET + position: Unset | int = UNSET + skip_on_failure: Unset | bool = UNSET + enabled: Unset | bool = True def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams @@ -433,13 +449,20 @@ def to_dict(self) -> dict[str, Any]: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -614,7 +637,15 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRoleOpsgenieTaskParams): task_params = self.task_params.to_dict() - elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParams): + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType0): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType1): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType2): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType3): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType4): task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRolePagerdutyTaskParamsType0): task_params = self.task_params.to_dict() @@ -686,6 +717,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AttachRetrospectivePdfToJiraIssueTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AttachRetrospectivePdfToFreshserviceTicketTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearIssueTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearSubtaskIssueTaskParams): @@ -958,13 +991,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -1123,176 +1163,181 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ): + ) -> Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ]: try: if not isinstance(data, dict): raise TypeError() task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1300,7 +1345,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1308,7 +1353,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1316,7 +1361,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_0 = AddSlackBookmarkTaskParamsType0.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1324,7 +1369,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_1 = AddSlackBookmarkTaskParamsType1.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1332,7 +1377,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1340,7 +1385,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1348,7 +1393,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1356,7 +1401,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1364,15 +1409,57 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_0 = ( + AutoAssignRoleRootlyTaskParamsType0.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_1 = ( + AutoAssignRoleRootlyTaskParamsType1.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_2 = ( + AutoAssignRoleRootlyTaskParamsType2.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_3 = ( + AutoAssignRoleRootlyTaskParamsType3.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_3 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_9 = AutoAssignRoleRootlyTaskParams.from_dict(data) + componentsschemasauto_assign_role_rootly_task_params_type_4 = ( + AutoAssignRoleRootlyTaskParamsType4.from_dict(data) + ) - return task_params_type_9 - except (TypeError, ValueError, AttributeError, KeyError): + return componentsschemasauto_assign_role_rootly_task_params_type_4 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1382,7 +1469,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1392,7 +1479,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1400,7 +1487,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1408,7 +1495,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1416,7 +1503,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1424,7 +1511,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1432,7 +1519,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1440,7 +1527,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1448,7 +1535,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1456,7 +1543,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1464,7 +1551,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1472,7 +1559,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1480,7 +1567,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1488,7 +1575,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1496,7 +1583,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1504,7 +1591,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1512,7 +1599,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1520,7 +1607,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1528,7 +1615,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1536,7 +1623,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1544,7 +1631,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1552,7 +1639,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1560,7 +1647,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1568,7 +1655,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1576,7 +1663,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1584,7 +1671,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1592,7 +1679,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1600,7 +1687,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1608,7 +1695,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1616,7 +1703,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1624,7 +1711,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1632,7 +1719,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1640,7 +1727,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1648,7 +1735,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1656,55 +1743,63 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_44 = CreateLinearIssueTaskParams.from_dict(data) + task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_45 = CreateLinearSubtaskIssueTaskParams.from_dict(data) + task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_46 = CreateLinearIssueCommentTaskParams.from_dict(data) + task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_47 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) + task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_48 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_49 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + + return task_params_type_50 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1714,7 +1809,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1724,111 +1819,111 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_51 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) - - return task_params_type_51 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_52 = CreateGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_53 = SendGoogleChatMessageTaskParams.from_dict(data) + task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_54 = SendGoogleChatAttachmentsTaskParams.from_dict(data) + task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_55 = InviteToGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_56 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) + task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_57 = RenameGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_58 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) + task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_59 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) + task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_60 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) + task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_61 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_62 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_63 = CreateNotionPageTaskParams.from_dict(data) + task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) + + return task_params_type_64 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1838,15 +1933,15 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_65 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) + task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) - return task_params_type_65 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_66 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1856,63 +1951,63 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_67 = UpdateNotionPageTaskParams.from_dict(data) - - return task_params_type_67 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_68 = UpdateQuipPageTaskParams.from_dict(data) + task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_69 = UpdateConfluencePageTaskParams.from_dict(data) + task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_70 = UpdateSharepointPageTaskParams.from_dict(data) + task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_71 = UpdateDropboxPaperPageTaskParams.from_dict(data) + task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_72 = UpdateDatadogNotebookTaskParams.from_dict(data) + task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_73 = CreateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) + + return task_params_type_74 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1922,7 +2017,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1932,71 +2027,71 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_75 = CreateShortcutTaskTaskParams.from_dict(data) - - return task_params_type_75 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_76 = CreateTrelloCardTaskParams.from_dict(data) + task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_77 = CreateWebexMeetingTaskParams.from_dict(data) + task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_78 = CreateZendeskTicketTaskParams.from_dict(data) + task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_79 = CreateZendeskJiraLinkTaskParams.from_dict(data) + task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_80 = CreateClickupTaskTaskParams.from_dict(data) + task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_81 = CreateMotionTaskTaskParams.from_dict(data) + task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_82 = CreateZoomMeetingTaskParams.from_dict(data) + task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) + + return task_params_type_83 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2004,7 +2099,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_0 = GetGithubCommitsTaskParamsType0.from_dict(data) return componentsschemasget_github_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2012,7 +2107,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_1 = GetGithubCommitsTaskParamsType1.from_dict(data) return componentsschemasget_github_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2020,7 +2115,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_0 = GetGitlabCommitsTaskParamsType0.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2028,55 +2123,55 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_85 = GetPulsesTaskParams.from_dict(data) - - return task_params_type_85 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_86 = GetAlertsTaskParams.from_dict(data) + task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_87 = HttpClientTaskParams.from_dict(data) + task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_88 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) + task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_89 = InviteToSlackChannelRootlyTaskParams.from_dict(data) + task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_90 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + + return task_params_type_91 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2086,7 +2181,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2096,7 +2191,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2106,7 +2201,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2116,7 +2211,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2126,79 +2221,79 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_93 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) - - return task_params_type_93 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_94 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) + task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_95 = CreateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_96 = CreateJsmopsAlertTaskParams.from_dict(data) + task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_97 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) + task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_98 = UpdateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_99 = UpdateOpsgenieIncidentTaskParams.from_dict(data) + task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_100 = PageRootlyOnCallRespondersTaskParams.from_dict(data) + task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_101 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + + return task_params_type_102 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2208,7 +2303,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2218,87 +2313,87 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_103 = UpdateVictorOpsIncidentTaskParams.from_dict(data) - - return task_params_type_103 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_104 = PrintTaskParams.from_dict(data) + task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_105 = PublishIncidentTaskParams.from_dict(data) + task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_106 = RedisClientTaskParams.from_dict(data) + task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_107 = RenameSlackChannelTaskParams.from_dict(data) + task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_108 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_109 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = SendEmailTaskParams.from_dict(data) + task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_110 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_111 = SendEmailTaskParams.from_dict(data) return task_params_type_111 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_112 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + + return task_params_type_113 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2306,7 +2401,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) return componentsschemassend_slack_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2314,7 +2409,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) return componentsschemassend_slack_message_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2322,223 +2417,223 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) return componentsschemassend_slack_message_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_114 = SendSmsTaskParams.from_dict(data) - - return task_params_type_114 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_115 = SendWhatsappMessageTaskParams.from_dict(data) + task_params_type_115 = SendSmsTaskParams.from_dict(data) return task_params_type_115 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_116 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_117 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_117 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_117 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_118 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_119 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_120 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_121 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_122 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_123 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_124 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_125 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_126 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_127 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_128 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_129 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_130 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_131 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_132 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateStatusTaskParams.from_dict(data) + task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_133 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_134 = UpdateStatusTaskParams.from_dict(data) return task_params_type_134 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_135 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_136 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_137 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_138 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) return task_params_type_139 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) return task_params_type_140 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_141 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2546,7 +2641,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_0 = SendSlackBlocksTaskParamsType0.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2554,7 +2649,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_1 = SendSlackBlocksTaskParamsType1.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2562,45 +2657,45 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_2 = SendSlackBlocksTaskParamsType2.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_142 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_142 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_143 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_144 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_145 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_146 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_146 + return task_params_type_147 task_params = _parse_task_params(d.pop("task_params")) diff --git a/rootly_sdk/models/on_call_pay_report.py b/rootly_sdk/models/on_call_pay_report.py index dad69a6f..f3c8c775 100644 --- a/rootly_sdk/models/on_call_pay_report.py +++ b/rootly_sdk/models/on_call_pay_report.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,25 +22,25 @@ class OnCallPayReport: end_date (datetime.date): The end date of the report period. created_at (datetime.datetime): updated_at (datetime.datetime): - total_duration (int | Unset): Total on-call duration in seconds. - users_count (int | Unset): Number of users included in the report. - currency (str | Unset): The currency code for monetary values. - pay_type (OnCallPayReportPayType | Unset): The pay calculation type. - hourly_rate_cents (int | Unset): Hourly pay rate in cents. - daily_rate_cents (int | Unset): Daily pay rate in cents. - total_pay_cents (int | Unset): Total pay amount in cents. - include_shadow (bool | Unset): Whether shadow shifts are included. - show_individual_shift_data (bool | Unset): Whether individual shift data is shown. - has_single_rate (bool | Unset): Whether a single rate is applied to all users. - enabled_granular_time_breakdown (bool | Unset): Whether granular time breakdown is enabled. - last_generated_at (datetime.datetime | None | Unset): When the report was last generated. - time_zone (None | str | Unset): The IANA timezone used to compute day and weekend boundaries for this report. - Defaults to the team's timezone. - use_responders_time_zone (bool | Unset): When true, each responder's personal timezone is used for their pay - calculation; otherwise the report-wide time_zone is used. - csv_file_url (None | str | Unset): Download URL for the generated CSV report. Null until the report is + total_duration (Union[Unset, int]): Total on-call duration in seconds. + users_count (Union[Unset, int]): Number of users included in the report. + currency (Union[Unset, str]): The currency code for monetary values. + pay_type (Union[Unset, OnCallPayReportPayType]): The pay calculation type. + hourly_rate_cents (Union[Unset, int]): Hourly pay rate in cents. + daily_rate_cents (Union[Unset, int]): Daily pay rate in cents. + total_pay_cents (Union[Unset, int]): Total pay amount in cents. + include_shadow (Union[Unset, bool]): Whether shadow shifts are included. + show_individual_shift_data (Union[Unset, bool]): Whether individual shift data is shown. + has_single_rate (Union[Unset, bool]): Whether a single rate is applied to all users. + enabled_granular_time_breakdown (Union[Unset, bool]): Whether granular time breakdown is enabled. + last_generated_at (Union[None, Unset, datetime.datetime]): When the report was last generated. + time_zone (Union[None, Unset, str]): The IANA timezone used to compute day and weekend boundaries for this + report. Defaults to the team's timezone. + use_responders_time_zone (Union[Unset, bool]): When true, each responder's personal timezone is used for their + pay calculation; otherwise the report-wide time_zone is used. + csv_file_url (Union[None, Unset, str]): Download URL for the generated CSV report. Null until the report is generated. - xlsx_file_url (None | str | Unset): Download URL for the generated XLSX report. Null until the report is + xlsx_file_url (Union[None, Unset, str]): Download URL for the generated XLSX report. Null until the report is generated. """ @@ -51,22 +49,22 @@ class OnCallPayReport: end_date: datetime.date created_at: datetime.datetime updated_at: datetime.datetime - total_duration: int | Unset = UNSET - users_count: int | Unset = UNSET - currency: str | Unset = UNSET - pay_type: OnCallPayReportPayType | Unset = UNSET - hourly_rate_cents: int | Unset = UNSET - daily_rate_cents: int | Unset = UNSET - total_pay_cents: int | Unset = UNSET - include_shadow: bool | Unset = UNSET - show_individual_shift_data: bool | Unset = UNSET - has_single_rate: bool | Unset = UNSET - enabled_granular_time_breakdown: bool | Unset = UNSET - last_generated_at: datetime.datetime | None | Unset = UNSET - time_zone: None | str | Unset = UNSET - use_responders_time_zone: bool | Unset = UNSET - csv_file_url: None | str | Unset = UNSET - xlsx_file_url: None | str | Unset = UNSET + total_duration: Unset | int = UNSET + users_count: Unset | int = UNSET + currency: Unset | str = UNSET + pay_type: Unset | OnCallPayReportPayType = UNSET + hourly_rate_cents: Unset | int = UNSET + daily_rate_cents: Unset | int = UNSET + total_pay_cents: Unset | int = UNSET + include_shadow: Unset | bool = UNSET + show_individual_shift_data: Unset | bool = UNSET + has_single_rate: Unset | bool = UNSET + enabled_granular_time_breakdown: Unset | bool = UNSET + last_generated_at: None | Unset | datetime.datetime = UNSET + time_zone: None | Unset | str = UNSET + use_responders_time_zone: Unset | bool = UNSET + csv_file_url: None | Unset | str = UNSET + xlsx_file_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -86,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: currency = self.currency - pay_type: str | Unset = UNSET + pay_type: Unset | str = UNSET if not isinstance(self.pay_type, Unset): pay_type = self.pay_type @@ -104,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: enabled_granular_time_breakdown = self.enabled_granular_time_breakdown - last_generated_at: None | str | Unset + last_generated_at: None | Unset | str if isinstance(self.last_generated_at, Unset): last_generated_at = UNSET elif isinstance(self.last_generated_at, datetime.datetime): @@ -112,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: last_generated_at = self.last_generated_at - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -120,13 +118,13 @@ def to_dict(self) -> dict[str, Any]: use_responders_time_zone = self.use_responders_time_zone - csv_file_url: None | str | Unset + csv_file_url: None | Unset | str if isinstance(self.csv_file_url, Unset): csv_file_url = UNSET else: csv_file_url = self.csv_file_url - xlsx_file_url: None | str | Unset + xlsx_file_url: None | Unset | str if isinstance(self.xlsx_file_url, Unset): xlsx_file_url = UNSET else: @@ -198,7 +196,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: currency = d.pop("currency", UNSET) _pay_type = d.pop("pay_type", UNSET) - pay_type: OnCallPayReportPayType | Unset + pay_type: Unset | OnCallPayReportPayType if isinstance(_pay_type, Unset): pay_type = UNSET else: @@ -218,7 +216,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled_granular_time_breakdown = d.pop("enabled_granular_time_breakdown", UNSET) - def _parse_last_generated_at(data: object) -> datetime.datetime | None | Unset: + def _parse_last_generated_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -229,38 +227,38 @@ def _parse_last_generated_at(data: object) -> datetime.datetime | None | Unset: last_generated_at_type_0 = isoparse(data) return last_generated_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) last_generated_at = _parse_last_generated_at(d.pop("last_generated_at", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) use_responders_time_zone = d.pop("use_responders_time_zone", UNSET) - def _parse_csv_file_url(data: object) -> None | str | Unset: + def _parse_csv_file_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) csv_file_url = _parse_csv_file_url(d.pop("csv_file_url", UNSET)) - def _parse_xlsx_file_url(data: object) -> None | str | Unset: + def _parse_xlsx_file_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) xlsx_file_url = _parse_xlsx_file_url(d.pop("xlsx_file_url", UNSET)) diff --git a/rootly_sdk/models/on_call_pay_report_list.py b/rootly_sdk/models/on_call_pay_report_list.py index 8bf6f298..352a865d 100644 --- a/rootly_sdk/models/on_call_pay_report_list.py +++ b/rootly_sdk/models/on_call_pay_report_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class OnCallPayReportList: """ Attributes: - data (list[OnCallPayReportListDataItem]): + data (list['OnCallPayReportListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OnCallPayReportListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OnCallPayReportListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_pay_report_list = cls( data=data, diff --git a/rootly_sdk/models/on_call_pay_report_list_data_item.py b/rootly_sdk/models/on_call_pay_report_list_data_item.py index 4de3e80b..69a34c09 100644 --- a/rootly_sdk/models/on_call_pay_report_list_data_item.py +++ b/rootly_sdk/models/on_call_pay_report_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallPayReportListDataItem: id: str type_: OnCallPayReportListDataItemType - attributes: OnCallPayReport + attributes: "OnCallPayReport" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_pay_report_response.py b/rootly_sdk/models/on_call_pay_report_response.py index 4094814e..31a0f1f0 100644 --- a/rootly_sdk/models/on_call_pay_report_response.py +++ b/rootly_sdk/models/on_call_pay_report_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class OnCallPayReportResponse: """ Attributes: data (OnCallPayReportResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OnCallPayReportResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OnCallPayReportResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OnCallPayReportResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_pay_report_response = cls( data=data, diff --git a/rootly_sdk/models/on_call_pay_report_response_data.py b/rootly_sdk/models/on_call_pay_report_response_data.py index c072c414..292fb0ab 100644 --- a/rootly_sdk/models/on_call_pay_report_response_data.py +++ b/rootly_sdk/models/on_call_pay_report_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallPayReportResponseData: id: str type_: OnCallPayReportResponseDataType - attributes: OnCallPayReport + attributes: "OnCallPayReport" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_role.py b/rootly_sdk/models/on_call_role.py index 6f9fbc29..b5117f44 100644 --- a/rootly_sdk/models/on_call_role.py +++ b/rootly_sdk/models/on_call_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -114,63 +112,63 @@ class OnCallRole: name (str): The role name. created_at (str): updated_at (str): - slug (str | Unset): The role slug. - system_role (str | Unset): The kind of role Default: 'custom'. - alert_sources_permissions (list[OnCallRoleAlertSourcesPermissionsItem] | Unset): - alert_urgency_permissions (list[OnCallRoleAlertUrgencyPermissionsItem] | Unset): - alert_fields_permissions (list[OnCallRoleAlertFieldsPermissionsItem] | Unset): - alert_groups_permissions (list[OnCallRoleAlertGroupsPermissionsItem] | Unset): - alert_routing_rules_permissions (list[OnCallRoleAlertRoutingRulesPermissionsItem] | Unset): - on_call_readiness_report_permissions (list[OnCallRoleOnCallReadinessReportPermissionsItem] | Unset): - on_call_roles_permissions (list[OnCallRoleOnCallRolesPermissionsItem] | Unset): - alerts_permissions (list[OnCallRoleAlertsPermissionsItem] | Unset): - api_keys_permissions (list[OnCallRoleApiKeysPermissionsItem] | Unset): - audits_permissions (list[OnCallRoleAuditsPermissionsItem] | Unset): - contacts_permissions (list[OnCallRoleContactsPermissionsItem] | Unset): - escalation_policies_permissions (list[OnCallRoleEscalationPoliciesPermissionsItem] | Unset): - groups_permissions (list[OnCallRoleGroupsPermissionsItem] | Unset): - heartbeats_permissions (list[OnCallRoleHeartbeatsPermissionsItem] | Unset): - integrations_permissions (list[OnCallRoleIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[OnCallRoleInvitationsPermissionsItem] | Unset): - live_call_routing_permissions (list[OnCallRoleLiveCallRoutingPermissionsItem] | Unset): - schedule_override_permissions (list[OnCallRoleScheduleOverridePermissionsItem] | Unset): - schedules_permissions (list[OnCallRoleSchedulesPermissionsItem] | Unset): - services_permissions (list[OnCallRoleServicesPermissionsItem] | Unset): - functionalities_permissions (list[OnCallRoleFunctionalitiesPermissionsItem] | Unset): - webhooks_permissions (list[OnCallRoleWebhooksPermissionsItem] | Unset): - workflows_permissions (list[OnCallRoleWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[OnCallRoleCatalogsPermissionsItem] | Unset): + slug (Union[Unset, str]): The role slug. + system_role (Union[Unset, str]): The kind of role Default: 'custom'. + alert_sources_permissions (Union[Unset, list[OnCallRoleAlertSourcesPermissionsItem]]): + alert_urgency_permissions (Union[Unset, list[OnCallRoleAlertUrgencyPermissionsItem]]): + alert_fields_permissions (Union[Unset, list[OnCallRoleAlertFieldsPermissionsItem]]): + alert_groups_permissions (Union[Unset, list[OnCallRoleAlertGroupsPermissionsItem]]): + alert_routing_rules_permissions (Union[Unset, list[OnCallRoleAlertRoutingRulesPermissionsItem]]): + on_call_readiness_report_permissions (Union[Unset, list[OnCallRoleOnCallReadinessReportPermissionsItem]]): + on_call_roles_permissions (Union[Unset, list[OnCallRoleOnCallRolesPermissionsItem]]): + alerts_permissions (Union[Unset, list[OnCallRoleAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[OnCallRoleApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[OnCallRoleAuditsPermissionsItem]]): + contacts_permissions (Union[Unset, list[OnCallRoleContactsPermissionsItem]]): + escalation_policies_permissions (Union[Unset, list[OnCallRoleEscalationPoliciesPermissionsItem]]): + groups_permissions (Union[Unset, list[OnCallRoleGroupsPermissionsItem]]): + heartbeats_permissions (Union[Unset, list[OnCallRoleHeartbeatsPermissionsItem]]): + integrations_permissions (Union[Unset, list[OnCallRoleIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[OnCallRoleInvitationsPermissionsItem]]): + live_call_routing_permissions (Union[Unset, list[OnCallRoleLiveCallRoutingPermissionsItem]]): + schedule_override_permissions (Union[Unset, list[OnCallRoleScheduleOverridePermissionsItem]]): + schedules_permissions (Union[Unset, list[OnCallRoleSchedulesPermissionsItem]]): + services_permissions (Union[Unset, list[OnCallRoleServicesPermissionsItem]]): + functionalities_permissions (Union[Unset, list[OnCallRoleFunctionalitiesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[OnCallRoleWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[OnCallRoleWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[OnCallRoleCatalogsPermissionsItem]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - system_role: str | Unset = "custom" - alert_sources_permissions: list[OnCallRoleAlertSourcesPermissionsItem] | Unset = UNSET - alert_urgency_permissions: list[OnCallRoleAlertUrgencyPermissionsItem] | Unset = UNSET - alert_fields_permissions: list[OnCallRoleAlertFieldsPermissionsItem] | Unset = UNSET - alert_groups_permissions: list[OnCallRoleAlertGroupsPermissionsItem] | Unset = UNSET - alert_routing_rules_permissions: list[OnCallRoleAlertRoutingRulesPermissionsItem] | Unset = UNSET - on_call_readiness_report_permissions: list[OnCallRoleOnCallReadinessReportPermissionsItem] | Unset = UNSET - on_call_roles_permissions: list[OnCallRoleOnCallRolesPermissionsItem] | Unset = UNSET - alerts_permissions: list[OnCallRoleAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[OnCallRoleApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[OnCallRoleAuditsPermissionsItem] | Unset = UNSET - contacts_permissions: list[OnCallRoleContactsPermissionsItem] | Unset = UNSET - escalation_policies_permissions: list[OnCallRoleEscalationPoliciesPermissionsItem] | Unset = UNSET - groups_permissions: list[OnCallRoleGroupsPermissionsItem] | Unset = UNSET - heartbeats_permissions: list[OnCallRoleHeartbeatsPermissionsItem] | Unset = UNSET - integrations_permissions: list[OnCallRoleIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[OnCallRoleInvitationsPermissionsItem] | Unset = UNSET - live_call_routing_permissions: list[OnCallRoleLiveCallRoutingPermissionsItem] | Unset = UNSET - schedule_override_permissions: list[OnCallRoleScheduleOverridePermissionsItem] | Unset = UNSET - schedules_permissions: list[OnCallRoleSchedulesPermissionsItem] | Unset = UNSET - services_permissions: list[OnCallRoleServicesPermissionsItem] | Unset = UNSET - functionalities_permissions: list[OnCallRoleFunctionalitiesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[OnCallRoleWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[OnCallRoleWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[OnCallRoleCatalogsPermissionsItem] | Unset = UNSET + slug: Unset | str = UNSET + system_role: Unset | str = "custom" + alert_sources_permissions: Unset | list[OnCallRoleAlertSourcesPermissionsItem] = UNSET + alert_urgency_permissions: Unset | list[OnCallRoleAlertUrgencyPermissionsItem] = UNSET + alert_fields_permissions: Unset | list[OnCallRoleAlertFieldsPermissionsItem] = UNSET + alert_groups_permissions: Unset | list[OnCallRoleAlertGroupsPermissionsItem] = UNSET + alert_routing_rules_permissions: Unset | list[OnCallRoleAlertRoutingRulesPermissionsItem] = UNSET + on_call_readiness_report_permissions: Unset | list[OnCallRoleOnCallReadinessReportPermissionsItem] = UNSET + on_call_roles_permissions: Unset | list[OnCallRoleOnCallRolesPermissionsItem] = UNSET + alerts_permissions: Unset | list[OnCallRoleAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[OnCallRoleApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[OnCallRoleAuditsPermissionsItem] = UNSET + contacts_permissions: Unset | list[OnCallRoleContactsPermissionsItem] = UNSET + escalation_policies_permissions: Unset | list[OnCallRoleEscalationPoliciesPermissionsItem] = UNSET + groups_permissions: Unset | list[OnCallRoleGroupsPermissionsItem] = UNSET + heartbeats_permissions: Unset | list[OnCallRoleHeartbeatsPermissionsItem] = UNSET + integrations_permissions: Unset | list[OnCallRoleIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[OnCallRoleInvitationsPermissionsItem] = UNSET + live_call_routing_permissions: Unset | list[OnCallRoleLiveCallRoutingPermissionsItem] = UNSET + schedule_override_permissions: Unset | list[OnCallRoleScheduleOverridePermissionsItem] = UNSET + schedules_permissions: Unset | list[OnCallRoleSchedulesPermissionsItem] = UNSET + services_permissions: Unset | list[OnCallRoleServicesPermissionsItem] = UNSET + functionalities_permissions: Unset | list[OnCallRoleFunctionalitiesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[OnCallRoleWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[OnCallRoleWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[OnCallRoleCatalogsPermissionsItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -184,168 +182,168 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_sources_permissions: list[str] | Unset = UNSET + alert_sources_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: list[str] | Unset = UNSET + alert_urgency_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alert_fields_permissions: list[str] | Unset = UNSET + alert_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: list[str] | Unset = UNSET + alert_groups_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: list[str] | Unset = UNSET + alert_routing_rules_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: list[str] | Unset = UNSET + on_call_readiness_report_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: list[str] | Unset = UNSET + on_call_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: list[str] | Unset = UNSET + contacts_permissions: Unset | list[str] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: list[str] | Unset = UNSET + escalation_policies_permissions: Unset | list[str] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: list[str] | Unset = UNSET + heartbeats_permissions: Unset | list[str] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: list[str] | Unset = UNSET + live_call_routing_permissions: Unset | list[str] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: list[str] | Unset = UNSET + schedule_override_permissions: Unset | list[str] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: list[str] | Unset = UNSET + schedules_permissions: Unset | list[str] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -429,255 +427,201 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: system_role = d.pop("system_role", UNSET) + alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - alert_sources_permissions: list[OnCallRoleAlertSourcesPermissionsItem] | Unset = UNSET - if _alert_sources_permissions is not UNSET: - alert_sources_permissions = [] - for alert_sources_permissions_item_data in _alert_sources_permissions: - alert_sources_permissions_item = check_on_call_role_alert_sources_permissions_item( - alert_sources_permissions_item_data - ) + for alert_sources_permissions_item_data in _alert_sources_permissions or []: + alert_sources_permissions_item = check_on_call_role_alert_sources_permissions_item( + alert_sources_permissions_item_data + ) - alert_sources_permissions.append(alert_sources_permissions_item) + alert_sources_permissions.append(alert_sources_permissions_item) + alert_urgency_permissions = [] _alert_urgency_permissions = d.pop("alert_urgency_permissions", UNSET) - alert_urgency_permissions: list[OnCallRoleAlertUrgencyPermissionsItem] | Unset = UNSET - if _alert_urgency_permissions is not UNSET: - alert_urgency_permissions = [] - for alert_urgency_permissions_item_data in _alert_urgency_permissions: - alert_urgency_permissions_item = check_on_call_role_alert_urgency_permissions_item( - alert_urgency_permissions_item_data - ) + for alert_urgency_permissions_item_data in _alert_urgency_permissions or []: + alert_urgency_permissions_item = check_on_call_role_alert_urgency_permissions_item( + alert_urgency_permissions_item_data + ) - alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_fields_permissions = [] _alert_fields_permissions = d.pop("alert_fields_permissions", UNSET) - alert_fields_permissions: list[OnCallRoleAlertFieldsPermissionsItem] | Unset = UNSET - if _alert_fields_permissions is not UNSET: - alert_fields_permissions = [] - for alert_fields_permissions_item_data in _alert_fields_permissions: - alert_fields_permissions_item = check_on_call_role_alert_fields_permissions_item( - alert_fields_permissions_item_data - ) + for alert_fields_permissions_item_data in _alert_fields_permissions or []: + alert_fields_permissions_item = check_on_call_role_alert_fields_permissions_item( + alert_fields_permissions_item_data + ) - alert_fields_permissions.append(alert_fields_permissions_item) + alert_fields_permissions.append(alert_fields_permissions_item) + alert_groups_permissions = [] _alert_groups_permissions = d.pop("alert_groups_permissions", UNSET) - alert_groups_permissions: list[OnCallRoleAlertGroupsPermissionsItem] | Unset = UNSET - if _alert_groups_permissions is not UNSET: - alert_groups_permissions = [] - for alert_groups_permissions_item_data in _alert_groups_permissions: - alert_groups_permissions_item = check_on_call_role_alert_groups_permissions_item( - alert_groups_permissions_item_data - ) + for alert_groups_permissions_item_data in _alert_groups_permissions or []: + alert_groups_permissions_item = check_on_call_role_alert_groups_permissions_item( + alert_groups_permissions_item_data + ) - alert_groups_permissions.append(alert_groups_permissions_item) + alert_groups_permissions.append(alert_groups_permissions_item) + alert_routing_rules_permissions = [] _alert_routing_rules_permissions = d.pop("alert_routing_rules_permissions", UNSET) - alert_routing_rules_permissions: list[OnCallRoleAlertRoutingRulesPermissionsItem] | Unset = UNSET - if _alert_routing_rules_permissions is not UNSET: - alert_routing_rules_permissions = [] - for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions: - alert_routing_rules_permissions_item = check_on_call_role_alert_routing_rules_permissions_item( - alert_routing_rules_permissions_item_data - ) + for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions or []: + alert_routing_rules_permissions_item = check_on_call_role_alert_routing_rules_permissions_item( + alert_routing_rules_permissions_item_data + ) - alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + on_call_readiness_report_permissions = [] _on_call_readiness_report_permissions = d.pop("on_call_readiness_report_permissions", UNSET) - on_call_readiness_report_permissions: list[OnCallRoleOnCallReadinessReportPermissionsItem] | Unset = UNSET - if _on_call_readiness_report_permissions is not UNSET: - on_call_readiness_report_permissions = [] - for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions: - on_call_readiness_report_permissions_item = ( - check_on_call_role_on_call_readiness_report_permissions_item( - on_call_readiness_report_permissions_item_data - ) - ) + for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions or []: + on_call_readiness_report_permissions_item = check_on_call_role_on_call_readiness_report_permissions_item( + on_call_readiness_report_permissions_item_data + ) - on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_roles_permissions = [] _on_call_roles_permissions = d.pop("on_call_roles_permissions", UNSET) - on_call_roles_permissions: list[OnCallRoleOnCallRolesPermissionsItem] | Unset = UNSET - if _on_call_roles_permissions is not UNSET: - on_call_roles_permissions = [] - for on_call_roles_permissions_item_data in _on_call_roles_permissions: - on_call_roles_permissions_item = check_on_call_role_on_call_roles_permissions_item( - on_call_roles_permissions_item_data - ) + for on_call_roles_permissions_item_data in _on_call_roles_permissions or []: + on_call_roles_permissions_item = check_on_call_role_on_call_roles_permissions_item( + on_call_roles_permissions_item_data + ) - on_call_roles_permissions.append(on_call_roles_permissions_item) + on_call_roles_permissions.append(on_call_roles_permissions_item) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[OnCallRoleAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_on_call_role_alerts_permissions_item(alerts_permissions_item_data) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_on_call_role_alerts_permissions_item(alerts_permissions_item_data) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[OnCallRoleApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_on_call_role_api_keys_permissions_item(api_keys_permissions_item_data) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_on_call_role_api_keys_permissions_item(api_keys_permissions_item_data) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[OnCallRoleAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_on_call_role_audits_permissions_item(audits_permissions_item_data) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_on_call_role_audits_permissions_item(audits_permissions_item_data) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - contacts_permissions: list[OnCallRoleContactsPermissionsItem] | Unset = UNSET - if _contacts_permissions is not UNSET: - contacts_permissions = [] - for contacts_permissions_item_data in _contacts_permissions: - contacts_permissions_item = check_on_call_role_contacts_permissions_item(contacts_permissions_item_data) + for contacts_permissions_item_data in _contacts_permissions or []: + contacts_permissions_item = check_on_call_role_contacts_permissions_item(contacts_permissions_item_data) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) + escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - escalation_policies_permissions: list[OnCallRoleEscalationPoliciesPermissionsItem] | Unset = UNSET - if _escalation_policies_permissions is not UNSET: - escalation_policies_permissions = [] - for escalation_policies_permissions_item_data in _escalation_policies_permissions: - escalation_policies_permissions_item = check_on_call_role_escalation_policies_permissions_item( - escalation_policies_permissions_item_data - ) + for escalation_policies_permissions_item_data in _escalation_policies_permissions or []: + escalation_policies_permissions_item = check_on_call_role_escalation_policies_permissions_item( + escalation_policies_permissions_item_data + ) - escalation_policies_permissions.append(escalation_policies_permissions_item) + escalation_policies_permissions.append(escalation_policies_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[OnCallRoleGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_on_call_role_groups_permissions_item(groups_permissions_item_data) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_on_call_role_groups_permissions_item(groups_permissions_item_data) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - heartbeats_permissions: list[OnCallRoleHeartbeatsPermissionsItem] | Unset = UNSET - if _heartbeats_permissions is not UNSET: - heartbeats_permissions = [] - for heartbeats_permissions_item_data in _heartbeats_permissions: - heartbeats_permissions_item = check_on_call_role_heartbeats_permissions_item( - heartbeats_permissions_item_data - ) + for heartbeats_permissions_item_data in _heartbeats_permissions or []: + heartbeats_permissions_item = check_on_call_role_heartbeats_permissions_item( + heartbeats_permissions_item_data + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[OnCallRoleIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_on_call_role_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_on_call_role_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[OnCallRoleInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_on_call_role_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_on_call_role_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + live_call_routing_permissions = [] _live_call_routing_permissions = d.pop("live_call_routing_permissions", UNSET) - live_call_routing_permissions: list[OnCallRoleLiveCallRoutingPermissionsItem] | Unset = UNSET - if _live_call_routing_permissions is not UNSET: - live_call_routing_permissions = [] - for live_call_routing_permissions_item_data in _live_call_routing_permissions: - live_call_routing_permissions_item = check_on_call_role_live_call_routing_permissions_item( - live_call_routing_permissions_item_data - ) + for live_call_routing_permissions_item_data in _live_call_routing_permissions or []: + live_call_routing_permissions_item = check_on_call_role_live_call_routing_permissions_item( + live_call_routing_permissions_item_data + ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - schedule_override_permissions: list[OnCallRoleScheduleOverridePermissionsItem] | Unset = UNSET - if _schedule_override_permissions is not UNSET: - schedule_override_permissions = [] - for schedule_override_permissions_item_data in _schedule_override_permissions: - schedule_override_permissions_item = check_on_call_role_schedule_override_permissions_item( - schedule_override_permissions_item_data - ) + for schedule_override_permissions_item_data in _schedule_override_permissions or []: + schedule_override_permissions_item = check_on_call_role_schedule_override_permissions_item( + schedule_override_permissions_item_data + ) - schedule_override_permissions.append(schedule_override_permissions_item) + schedule_override_permissions.append(schedule_override_permissions_item) + schedules_permissions = [] _schedules_permissions = d.pop("schedules_permissions", UNSET) - schedules_permissions: list[OnCallRoleSchedulesPermissionsItem] | Unset = UNSET - if _schedules_permissions is not UNSET: - schedules_permissions = [] - for schedules_permissions_item_data in _schedules_permissions: - schedules_permissions_item = check_on_call_role_schedules_permissions_item( - schedules_permissions_item_data - ) + for schedules_permissions_item_data in _schedules_permissions or []: + schedules_permissions_item = check_on_call_role_schedules_permissions_item(schedules_permissions_item_data) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[OnCallRoleServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_on_call_role_services_permissions_item(services_permissions_item_data) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_on_call_role_services_permissions_item(services_permissions_item_data) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[OnCallRoleFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_on_call_role_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_on_call_role_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[OnCallRoleWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_on_call_role_webhooks_permissions_item(webhooks_permissions_item_data) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_on_call_role_webhooks_permissions_item(webhooks_permissions_item_data) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[OnCallRoleWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_on_call_role_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_on_call_role_workflows_permissions_item(workflows_permissions_item_data) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[OnCallRoleCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_on_call_role_catalogs_permissions_item(catalogs_permissions_item_data) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_on_call_role_catalogs_permissions_item(catalogs_permissions_item_data) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) on_call_role = cls( name=name, diff --git a/rootly_sdk/models/on_call_role_list.py b/rootly_sdk/models/on_call_role_list.py index ae3d3942..87c265c3 100644 --- a/rootly_sdk/models/on_call_role_list.py +++ b/rootly_sdk/models/on_call_role_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class OnCallRoleList: """ Attributes: - data (list[OnCallRoleListDataItem]): + data (list['OnCallRoleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OnCallRoleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OnCallRoleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_role_list = cls( data=data, diff --git a/rootly_sdk/models/on_call_role_list_data_item.py b/rootly_sdk/models/on_call_role_list_data_item.py index 2de264b6..615a062e 100644 --- a/rootly_sdk/models/on_call_role_list_data_item.py +++ b/rootly_sdk/models/on_call_role_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class OnCallRoleListDataItem: id: str type_: OnCallRoleListDataItemType - attributes: OnCallRole + attributes: "OnCallRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_role_relationship.py b/rootly_sdk/models/on_call_role_relationship.py index b1385f6f..8e9f610d 100644 --- a/rootly_sdk/models/on_call_role_relationship.py +++ b/rootly_sdk/models/on_call_role_relationship.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class OnCallRoleRelationship: """ Attributes: - data (None | OnCallRoleRelationshipDataType0 | Unset): + data (Union['OnCallRoleRelationshipDataType0', None, Unset]): """ - data: None | OnCallRoleRelationshipDataType0 | Unset = UNSET + data: Union["OnCallRoleRelationshipDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.on_call_role_relationship_data_type_0 import OnCallRoleRelationshipDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OnCallRoleRelationshipDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OnCallRoleRelationshipDataType0 | Unset: + def _parse_data(data: object) -> Union["OnCallRoleRelationshipDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | OnCallRoleRelationshipDataType0 | Unset: data_type_0 = OnCallRoleRelationshipDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OnCallRoleRelationshipDataType0 | Unset, data) + return cast(Union["OnCallRoleRelationshipDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/on_call_role_relationship_data_type_0.py b/rootly_sdk/models/on_call_role_relationship_data_type_0.py index 20a1e8a6..16815aea 100644 --- a/rootly_sdk/models/on_call_role_relationship_data_type_0.py +++ b/rootly_sdk/models/on_call_role_relationship_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class OnCallRoleRelationshipDataType0: """ Attributes: - id (str | Unset): - type_ (OnCallRoleRelationshipDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OnCallRoleRelationshipDataType0Type]): """ - id: str | Unset = UNSET - type_: OnCallRoleRelationshipDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | OnCallRoleRelationshipDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OnCallRoleRelationshipDataType0Type | Unset + type_: Unset | OnCallRoleRelationshipDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/on_call_role_response.py b/rootly_sdk/models/on_call_role_response.py index f6ba050c..ddca24ce 100644 --- a/rootly_sdk/models/on_call_role_response.py +++ b/rootly_sdk/models/on_call_role_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class OnCallRoleResponse: """ Attributes: data (OnCallRoleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OnCallRoleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OnCallRoleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OnCallRoleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_role_response = cls( data=data, diff --git a/rootly_sdk/models/on_call_role_response_data.py b/rootly_sdk/models/on_call_role_response_data.py index 6a49a2a1..805a5a45 100644 --- a/rootly_sdk/models/on_call_role_response_data.py +++ b/rootly_sdk/models/on_call_role_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class OnCallRoleResponseData: id: str type_: OnCallRoleResponseDataType - attributes: OnCallRole + attributes: "OnCallRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_shadow.py b/rootly_sdk/models/on_call_shadow.py index c04b4ed3..372d29f8 100644 --- a/rootly_sdk/models/on_call_shadow.py +++ b/rootly_sdk/models/on_call_shadow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -24,8 +22,8 @@ class OnCallShadow: shadow_user_id (int): Which user the shadow shift belongs to. starts_at (datetime.datetime): Start datetime of shadow shift ends_at (datetime.datetime): End datetime for shadow shift - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ schedule_id: str @@ -34,8 +32,8 @@ class OnCallShadow: shadow_user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/on_call_shadow_response.py b/rootly_sdk/models/on_call_shadow_response.py index e9e20b04..021e0251 100644 --- a/rootly_sdk/models/on_call_shadow_response.py +++ b/rootly_sdk/models/on_call_shadow_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class OnCallShadowResponse: """ Attributes: data (OnCallShadowResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OnCallShadowResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OnCallShadowResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OnCallShadowResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_shadow_response = cls( data=data, diff --git a/rootly_sdk/models/on_call_shadow_response_data.py b/rootly_sdk/models/on_call_shadow_response_data.py index b0b5e603..8306a936 100644 --- a/rootly_sdk/models/on_call_shadow_response_data.py +++ b/rootly_sdk/models/on_call_shadow_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallShadowResponseData: id: str type_: OnCallShadowResponseDataType - attributes: OnCallShadow + attributes: "OnCallShadow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_shadows_list.py b/rootly_sdk/models/on_call_shadows_list.py index cd3e8af6..936dc57b 100644 --- a/rootly_sdk/models/on_call_shadows_list.py +++ b/rootly_sdk/models/on_call_shadows_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class OnCallShadowsList: """ Attributes: - data (list[OnCallShadowsListDataItem]): + data (list['OnCallShadowsListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OnCallShadowsListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OnCallShadowsListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_shadows_list = cls( data=data, diff --git a/rootly_sdk/models/on_call_shadows_list_data_item.py b/rootly_sdk/models/on_call_shadows_list_data_item.py index ce854fcf..57322935 100644 --- a/rootly_sdk/models/on_call_shadows_list_data_item.py +++ b/rootly_sdk/models/on_call_shadows_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallShadowsListDataItem: id: str type_: OnCallShadowsListDataItemType - attributes: OnCallShadow + attributes: "OnCallShadow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/oncall.py b/rootly_sdk/models/oncall.py index 7e3fac08..15574aea 100644 --- a/rootly_sdk/models/oncall.py +++ b/rootly_sdk/models/oncall.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,13 +21,14 @@ class Oncall: user_id (int): ID of the on-call user starts_at (datetime.datetime): Start datetime of the on-call shift ends_at (datetime.datetime): End datetime of the on-call shift - escalation_policy_path_id (None | str | Unset): ID of the escalation policy path - escalation_policy_path_name (None | str | Unset): Name of the escalation policy path - notification_type (OncallNotificationType | Unset): Notification type of the escalation path (audible or quiet) - is_default_path (bool | None | Unset): Whether this is the default escalation path - escalation_level (int | Unset): Level within the escalation policy - schedule_id (None | str | Unset): ID of the schedule - schedule_name (None | str | Unset): Name of the schedule + escalation_policy_path_id (Union[None, Unset, str]): ID of the escalation policy path + escalation_policy_path_name (Union[None, Unset, str]): Name of the escalation policy path + notification_type (Union[Unset, OncallNotificationType]): Notification type of the escalation path (audible or + quiet) + is_default_path (Union[None, Unset, bool]): Whether this is the default escalation path + escalation_level (Union[Unset, int]): Level within the escalation policy + schedule_id (Union[None, Unset, str]): ID of the schedule + schedule_name (Union[None, Unset, str]): Name of the schedule """ escalation_policy_id: str @@ -37,13 +36,13 @@ class Oncall: user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - escalation_policy_path_id: None | str | Unset = UNSET - escalation_policy_path_name: None | str | Unset = UNSET - notification_type: OncallNotificationType | Unset = UNSET - is_default_path: bool | None | Unset = UNSET - escalation_level: int | Unset = UNSET - schedule_id: None | str | Unset = UNSET - schedule_name: None | str | Unset = UNSET + escalation_policy_path_id: None | Unset | str = UNSET + escalation_policy_path_name: None | Unset | str = UNSET + notification_type: Unset | OncallNotificationType = UNSET + is_default_path: None | Unset | bool = UNSET + escalation_level: Unset | int = UNSET + schedule_id: None | Unset | str = UNSET + schedule_name: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,23 +56,23 @@ def to_dict(self) -> dict[str, Any]: ends_at = self.ends_at.isoformat() - escalation_policy_path_id: None | str | Unset + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - escalation_policy_path_name: None | str | Unset + escalation_policy_path_name: None | Unset | str if isinstance(self.escalation_policy_path_name, Unset): escalation_policy_path_name = UNSET else: escalation_policy_path_name = self.escalation_policy_path_name - notification_type: str | Unset = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - is_default_path: bool | None | Unset + is_default_path: None | Unset | bool if isinstance(self.is_default_path, Unset): is_default_path = UNSET else: @@ -81,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - schedule_id: None | str | Unset + schedule_id: None | Unset | str if isinstance(self.schedule_id, Unset): schedule_id = UNSET else: schedule_id = self.schedule_id - schedule_name: None | str | Unset + schedule_name: None | Unset | str if isinstance(self.schedule_name, Unset): schedule_name = UNSET else: @@ -134,57 +133,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ends_at = isoparse(d.pop("ends_at")) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) - def _parse_escalation_policy_path_name(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_path_name = _parse_escalation_policy_path_name(d.pop("escalation_policy_path_name", UNSET)) _notification_type = d.pop("notification_type", UNSET) - notification_type: OncallNotificationType | Unset + notification_type: Unset | OncallNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_oncall_notification_type(_notification_type) - def _parse_is_default_path(data: object) -> bool | None | Unset: + def _parse_is_default_path(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) is_default_path = _parse_is_default_path(d.pop("is_default_path", UNSET)) escalation_level = d.pop("escalation_level", UNSET) - def _parse_schedule_id(data: object) -> None | str | Unset: + def _parse_schedule_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) schedule_id = _parse_schedule_id(d.pop("schedule_id", UNSET)) - def _parse_schedule_name(data: object) -> None | str | Unset: + def _parse_schedule_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) schedule_name = _parse_schedule_name(d.pop("schedule_name", UNSET)) diff --git a/rootly_sdk/models/oncall_list.py b/rootly_sdk/models/oncall_list.py index 30e12715..1263f2c9 100644 --- a/rootly_sdk/models/oncall_list.py +++ b/rootly_sdk/models/oncall_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,22 +18,21 @@ class OncallList: """ Attributes: - data (list[OncallListDataItem]): - included (list[JsonapiIncludedResource] | Unset): + data (list['OncallListDataItem']): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OncallListDataItem] - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OncallListDataItem"] + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -67,14 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) oncall_list = cls( data=data, diff --git a/rootly_sdk/models/oncall_list_data_item.py b/rootly_sdk/models/oncall_list_data_item.py index b1860ed4..2ebdd767 100644 --- a/rootly_sdk/models/oncall_list_data_item.py +++ b/rootly_sdk/models/oncall_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class OncallListDataItem: id (str): Unique ID of the on-call entry type_ (OncallListDataItemType): attributes (Oncall): - relationships (OncallRelationships | Unset): + relationships (Union[Unset, OncallRelationships]): """ id: str type_: OncallListDataItemType - attributes: Oncall - relationships: OncallRelationships | Unset = UNSET + attributes: "Oncall" + relationships: Union[Unset, "OncallRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = Oncall.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: OncallRelationships | Unset + relationships: Unset | OncallRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships.py b/rootly_sdk/models/oncall_relationships.py index c31f0763..3566df31 100644 --- a/rootly_sdk/models/oncall_relationships.py +++ b/rootly_sdk/models/oncall_relationships.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,27 +19,26 @@ class OncallRelationships: """ Attributes: - user (OncallRelationshipsUser | Unset): - schedule (OncallRelationshipsSchedule | Unset): - escalation_policy (OncallRelationshipsEscalationPolicy | Unset): + user (Union[Unset, OncallRelationshipsUser]): + schedule (Union[Unset, OncallRelationshipsSchedule]): + escalation_policy (Union[Unset, OncallRelationshipsEscalationPolicy]): """ - user: OncallRelationshipsUser | Unset = UNSET - schedule: OncallRelationshipsSchedule | Unset = UNSET - escalation_policy: OncallRelationshipsEscalationPolicy | Unset = UNSET + user: Union[Unset, "OncallRelationshipsUser"] = UNSET + schedule: Union[Unset, "OncallRelationshipsSchedule"] = UNSET + escalation_policy: Union[Unset, "OncallRelationshipsEscalationPolicy"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - user: dict[str, Any] | Unset = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - schedule: dict[str, Any] | Unset = UNSET + schedule: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - escalation_policy: dict[str, Any] | Unset = UNSET + escalation_policy: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy, Unset): escalation_policy = self.escalation_policy.to_dict() @@ -65,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _user = d.pop("user", UNSET) - user: OncallRelationshipsUser | Unset + user: Unset | OncallRelationshipsUser if isinstance(_user, Unset): user = UNSET else: user = OncallRelationshipsUser.from_dict(_user) _schedule = d.pop("schedule", UNSET) - schedule: OncallRelationshipsSchedule | Unset + schedule: Unset | OncallRelationshipsSchedule if isinstance(_schedule, Unset): schedule = UNSET else: schedule = OncallRelationshipsSchedule.from_dict(_schedule) _escalation_policy = d.pop("escalation_policy", UNSET) - escalation_policy: OncallRelationshipsEscalationPolicy | Unset + escalation_policy: Unset | OncallRelationshipsEscalationPolicy if isinstance(_escalation_policy, Unset): escalation_policy = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy.py b/rootly_sdk/models/oncall_relationships_escalation_policy.py index 6d5b37df..e69ff1cb 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,10 +17,10 @@ class OncallRelationshipsEscalationPolicy: """ Attributes: - data (None | OncallRelationshipsEscalationPolicyDataType0 | Unset): + data (Union['OncallRelationshipsEscalationPolicyDataType0', None, Unset]): """ - data: None | OncallRelationshipsEscalationPolicyDataType0 | Unset = UNSET + data: Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -30,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: OncallRelationshipsEscalationPolicyDataType0, ) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsEscalationPolicyDataType0): @@ -54,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OncallRelationshipsEscalationPolicyDataType0 | Unset: + def _parse_data(data: object) -> Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -65,9 +63,9 @@ def _parse_data(data: object) -> None | OncallRelationshipsEscalationPolicyDataT data_type_0 = OncallRelationshipsEscalationPolicyDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OncallRelationshipsEscalationPolicyDataType0 | Unset, data) + return cast(Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py index 5f4db389..8fd70eac 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class OncallRelationshipsEscalationPolicyDataType0: """ Attributes: - id (str | Unset): - type_ (OncallRelationshipsEscalationPolicyDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type]): """ - id: str | Unset = UNSET - type_: OncallRelationshipsEscalationPolicyDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | OncallRelationshipsEscalationPolicyDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OncallRelationshipsEscalationPolicyDataType0Type | Unset + type_: Unset | OncallRelationshipsEscalationPolicyDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_schedule.py b/rootly_sdk/models/oncall_relationships_schedule.py index e09c49b7..bc122047 100644 --- a/rootly_sdk/models/oncall_relationships_schedule.py +++ b/rootly_sdk/models/oncall_relationships_schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class OncallRelationshipsSchedule: """ Attributes: - data (None | OncallRelationshipsScheduleDataType0 | Unset): + data (Union['OncallRelationshipsScheduleDataType0', None, Unset]): """ - data: None | OncallRelationshipsScheduleDataType0 | Unset = UNSET + data: Union["OncallRelationshipsScheduleDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.oncall_relationships_schedule_data_type_0 import OncallRelationshipsScheduleDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsScheduleDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OncallRelationshipsScheduleDataType0 | Unset: + def _parse_data(data: object) -> Union["OncallRelationshipsScheduleDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | OncallRelationshipsScheduleDataType0 | U data_type_0 = OncallRelationshipsScheduleDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OncallRelationshipsScheduleDataType0 | Unset, data) + return cast(Union["OncallRelationshipsScheduleDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py index c9919c8a..5cfe8fbc 100644 --- a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class OncallRelationshipsScheduleDataType0: """ Attributes: - id (str | Unset): - type_ (OncallRelationshipsScheduleDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OncallRelationshipsScheduleDataType0Type]): """ - id: str | Unset = UNSET - type_: OncallRelationshipsScheduleDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | OncallRelationshipsScheduleDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OncallRelationshipsScheduleDataType0Type | Unset + type_: Unset | OncallRelationshipsScheduleDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_user.py b/rootly_sdk/models/oncall_relationships_user.py index 6c35d047..9d1f9b5d 100644 --- a/rootly_sdk/models/oncall_relationships_user.py +++ b/rootly_sdk/models/oncall_relationships_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class OncallRelationshipsUser: """ Attributes: - data (None | OncallRelationshipsUserDataType0 | Unset): + data (Union['OncallRelationshipsUserDataType0', None, Unset]): """ - data: None | OncallRelationshipsUserDataType0 | Unset = UNSET + data: Union["OncallRelationshipsUserDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.oncall_relationships_user_data_type_0 import OncallRelationshipsUserDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsUserDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OncallRelationshipsUserDataType0 | Unset: + def _parse_data(data: object) -> Union["OncallRelationshipsUserDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | OncallRelationshipsUserDataType0 | Unset data_type_0 = OncallRelationshipsUserDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OncallRelationshipsUserDataType0 | Unset, data) + return cast(Union["OncallRelationshipsUserDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/oncall_relationships_user_data_type_0.py b/rootly_sdk/models/oncall_relationships_user_data_type_0.py index 0554b0fc..3771fba7 100644 --- a/rootly_sdk/models/oncall_relationships_user_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_user_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class OncallRelationshipsUserDataType0: """ Attributes: - id (str | Unset): - type_ (OncallRelationshipsUserDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OncallRelationshipsUserDataType0Type]): """ - id: str | Unset = UNSET - type_: OncallRelationshipsUserDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | OncallRelationshipsUserDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OncallRelationshipsUserDataType0Type | Unset + type_: Unset | OncallRelationshipsUserDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/override_shift.py b/rootly_sdk/models/override_shift.py index 287ca8fe..b37efd61 100644 --- a/rootly_sdk/models/override_shift.py +++ b/rootly_sdk/models/override_shift.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,15 @@ class OverrideShift: """ Attributes: schedule_id (str): ID of schedule - rotation_id (None | str): ID of rotation + rotation_id (Union[None, str]): ID of rotation starts_at (str): Start datetime of shift ends_at (str): End datetime of shift is_override (bool): Denotes shift is an override shift - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - shift_override (ShiftOverrideResponse | Unset): - user_id (int | Unset): Override shift user - user (UserResponse | Unset): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + shift_override (Union[Unset, ShiftOverrideResponse]): + user_id (Union[Unset, int]): Override shift user + user (Union[Unset, UserResponse]): """ schedule_id: str @@ -37,15 +35,14 @@ class OverrideShift: starts_at: str ends_at: str is_override: bool - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - shift_override: ShiftOverrideResponse | Unset = UNSET - user_id: int | Unset = UNSET - user: UserResponse | Unset = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET + shift_override: Union[Unset, "ShiftOverrideResponse"] = UNSET + user_id: Unset | int = UNSET + user: Union[Unset, "UserResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - schedule_id = self.schedule_id rotation_id: None | str @@ -61,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - shift_override: dict[str, Any] | Unset = UNSET + shift_override: Unset | dict[str, Any] = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() user_id = self.user_id - user: dict[str, Any] | Unset = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() @@ -121,7 +118,7 @@ def _parse_rotation_id(data: object) -> None | str: updated_at = d.pop("updated_at", UNSET) _shift_override = d.pop("shift_override", UNSET) - shift_override: ShiftOverrideResponse | Unset + shift_override: Unset | ShiftOverrideResponse if isinstance(_shift_override, Unset): shift_override = UNSET else: @@ -130,7 +127,7 @@ def _parse_rotation_id(data: object) -> None | str: user_id = d.pop("user_id", UNSET) _user = d.pop("user", UNSET) - user: UserResponse | Unset + user: Unset | UserResponse if isinstance(_user, Unset): user = UNSET else: diff --git a/rootly_sdk/models/override_shift_list.py b/rootly_sdk/models/override_shift_list.py index d589839b..62db7a61 100644 --- a/rootly_sdk/models/override_shift_list.py +++ b/rootly_sdk/models/override_shift_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class OverrideShiftList: """ Attributes: - data (list[OverrideShiftListDataItem]): + data (list['OverrideShiftListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OverrideShiftListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OverrideShiftListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) override_shift_list = cls( data=data, diff --git a/rootly_sdk/models/override_shift_list_data_item.py b/rootly_sdk/models/override_shift_list_data_item.py index 391a89d5..6549f203 100644 --- a/rootly_sdk/models/override_shift_list_data_item.py +++ b/rootly_sdk/models/override_shift_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OverrideShiftListDataItem: id: str type_: OverrideShiftListDataItemType - attributes: OverrideShift + attributes: "OverrideShift" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/override_shift_response.py b/rootly_sdk/models/override_shift_response.py index 9c0c2d7b..9b082260 100644 --- a/rootly_sdk/models/override_shift_response.py +++ b/rootly_sdk/models/override_shift_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class OverrideShiftResponse: """ Attributes: data (OverrideShiftResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OverrideShiftResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OverrideShiftResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OverrideShiftResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) override_shift_response = cls( data=data, diff --git a/rootly_sdk/models/override_shift_response_data.py b/rootly_sdk/models/override_shift_response_data.py index 3b051c10..751fe8ca 100644 --- a/rootly_sdk/models/override_shift_response_data.py +++ b/rootly_sdk/models/override_shift_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OverrideShiftResponseData: id: str type_: OverrideShiftResponseDataType - attributes: OverrideShift + attributes: "OverrideShift" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py index 916d1784..9079ba31 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,32 +30,31 @@ class PageJsmopsOnCallRespondersTaskParams: """ Attributes: - task_type (PageJsmopsOnCallRespondersTaskParamsTaskType | Unset): - title (None | str | Unset): Incident title. - message (str | Unset): Message of the incident - description (str | Unset): Description field of the incident that is generally used to provide a detailed + task_type (Union[Unset, PageJsmopsOnCallRespondersTaskParamsTaskType]): + title (Union[None, Unset, str]): Incident title. + message (Union[Unset, str]): Message of the incident + description (Union[Unset, str]): Description field of the incident that is generally used to provide a detailed information about the incident - teams (list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset): - users (list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset): - priority (PageJsmopsOnCallRespondersTaskParamsPriority | Unset): Default: 'P3'. + teams (Union[Unset, list['PageJsmopsOnCallRespondersTaskParamsTeamsItem']]): + users (Union[Unset, list['PageJsmopsOnCallRespondersTaskParamsUsersItem']]): + priority (Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority]): Default: 'P3'. """ - task_type: PageJsmopsOnCallRespondersTaskParamsTaskType | Unset = UNSET - title: None | str | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET - teams: list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - users: list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - priority: PageJsmopsOnCallRespondersTaskParamsPriority | Unset = "P3" + task_type: Unset | PageJsmopsOnCallRespondersTaskParamsTaskType = UNSET + title: None | Unset | str = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET + teams: Unset | list["PageJsmopsOnCallRespondersTaskParamsTeamsItem"] = UNSET + users: Unset | list["PageJsmopsOnCallRespondersTaskParamsUsersItem"] = UNSET + priority: Unset | PageJsmopsOnCallRespondersTaskParamsPriority = "P3" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -67,21 +64,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -116,18 +113,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: PageJsmopsOnCallRespondersTaskParamsTaskType | Unset + task_type: Unset | PageJsmopsOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_jsmops_on_call_responders_task_params_task_type(_task_type) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) @@ -135,26 +132,22 @@ def _parse_title(data: object) -> None | str | Unset: description = d.pop("description", UNSET) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = PageJsmopsOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = PageJsmopsOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = PageJsmopsOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = PageJsmopsOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) _priority = d.pop("priority", UNSET) - priority: PageJsmopsOnCallRespondersTaskParamsPriority | Unset + priority: Unset | PageJsmopsOnCallRespondersTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py index 9dee4774..913616a2 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageJsmopsOnCallRespondersTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py index 24aa7ba3..7b755781 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageJsmopsOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py index a278eb46..ad72c711 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,32 +30,31 @@ class PageOpsgenieOnCallRespondersTaskParams: """ Attributes: - task_type (PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset): - title (None | str | Unset): Incident title. - message (str | Unset): Message of the incident - description (str | Unset): Description field of the incident that is generally used to provide a detailed + task_type (Union[Unset, PageOpsgenieOnCallRespondersTaskParamsTaskType]): + title (Union[None, Unset, str]): Incident title. + message (Union[Unset, str]): Message of the incident + description (Union[Unset, str]): Description field of the incident that is generally used to provide a detailed information about the incident - teams (list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset): - users (list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset): - priority (PageOpsgenieOnCallRespondersTaskParamsPriority | Unset): Default: 'P1'. + teams (Union[Unset, list['PageOpsgenieOnCallRespondersTaskParamsTeamsItem']]): + users (Union[Unset, list['PageOpsgenieOnCallRespondersTaskParamsUsersItem']]): + priority (Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority]): Default: 'P1'. """ - task_type: PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset = UNSET - title: None | str | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET - teams: list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - users: list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - priority: PageOpsgenieOnCallRespondersTaskParamsPriority | Unset = "P1" + task_type: Unset | PageOpsgenieOnCallRespondersTaskParamsTaskType = UNSET + title: None | Unset | str = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET + teams: Unset | list["PageOpsgenieOnCallRespondersTaskParamsTeamsItem"] = UNSET + users: Unset | list["PageOpsgenieOnCallRespondersTaskParamsUsersItem"] = UNSET + priority: Unset | PageOpsgenieOnCallRespondersTaskParamsPriority = "P1" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -67,21 +64,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -116,18 +113,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset + task_type: Unset | PageOpsgenieOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_opsgenie_on_call_responders_task_params_task_type(_task_type) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) @@ -135,26 +132,22 @@ def _parse_title(data: object) -> None | str | Unset: description = d.pop("description", UNSET) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = PageOpsgenieOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = PageOpsgenieOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = PageOpsgenieOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = PageOpsgenieOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) _priority = d.pop("priority", UNSET) - priority: PageOpsgenieOnCallRespondersTaskParamsPriority | Unset + priority: Unset | PageOpsgenieOnCallRespondersTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py index 50c3593a..d60d0421 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageOpsgenieOnCallRespondersTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py index 9c55df3e..7eeaf177 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageOpsgenieOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py index cd792d21..69db5e99 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -36,54 +34,53 @@ class PagePagerdutyOnCallRespondersTaskParams: """ Attributes: service (PagePagerdutyOnCallRespondersTaskParamsService): - task_type (PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset): - escalation_policies (list[PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem] | Unset): - users (list[PagePagerdutyOnCallRespondersTaskParamsUsersItem] | Unset): - title (None | str | Unset): Incident title. - message (str | Unset): - urgency (PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset): Default: 'high'. - priority (str | Unset): PagerDuty incident priority, selecting auto will let Rootly auto map our incident + task_type (Union[Unset, PagePagerdutyOnCallRespondersTaskParamsTaskType]): + escalation_policies (Union[Unset, list['PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem']]): + users (Union[Unset, list['PagePagerdutyOnCallRespondersTaskParamsUsersItem']]): + title (Union[None, Unset, str]): Incident title. + message (Union[Unset, str]): + urgency (Union[Unset, PagePagerdutyOnCallRespondersTaskParamsUrgency]): Default: 'high'. + priority (Union[Unset, str]): PagerDuty incident priority, selecting auto will let Rootly auto map our incident severity - create_new_incident_on_conflict (bool | Unset): Rootly only supports linking to a single PagerDuty incident. If - this feature is disabled Rootly will add responders from any additional pages to the existing PagerDuty incident - that is linked to the Rootly incident. If enabled, Rootly will create a new PagerDuty incident that is not - linked to any Rootly incidents Default: False. + create_new_incident_on_conflict (Union[Unset, bool]): Rootly only supports linking to a single PagerDuty + incident. If this feature is disabled Rootly will add responders from any additional pages to the existing + PagerDuty incident that is linked to the Rootly incident. If enabled, Rootly will create a new PagerDuty + incident that is not linked to any Rootly incidents Default: False. """ - service: PagePagerdutyOnCallRespondersTaskParamsService - task_type: PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset = UNSET - escalation_policies: list[PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem] | Unset = UNSET - users: list[PagePagerdutyOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - title: None | str | Unset = UNSET - message: str | Unset = UNSET - urgency: PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset = "high" - priority: str | Unset = UNSET - create_new_incident_on_conflict: bool | Unset = False + service: "PagePagerdutyOnCallRespondersTaskParamsService" + task_type: Unset | PagePagerdutyOnCallRespondersTaskParamsTaskType = UNSET + escalation_policies: Unset | list["PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem"] = UNSET + users: Unset | list["PagePagerdutyOnCallRespondersTaskParamsUsersItem"] = UNSET + title: None | Unset | str = UNSET + message: Unset | str = UNSET + urgency: Unset | PagePagerdutyOnCallRespondersTaskParamsUrgency = "high" + priority: Unset | str = UNSET + create_new_incident_on_conflict: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - service = self.service.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policies: list[dict[str, Any]] | Unset = UNSET + escalation_policies: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: escalation_policies_item = escalation_policies_item_data.to_dict() escalation_policies.append(escalation_policies_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -91,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - urgency: str | Unset = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -141,45 +138,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: service = PagePagerdutyOnCallRespondersTaskParamsService.from_dict(d.pop("service")) _task_type = d.pop("task_type", UNSET) - task_type: PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset + task_type: Unset | PagePagerdutyOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_pagerduty_on_call_responders_task_params_task_type(_task_type) + escalation_policies = [] _escalation_policies = d.pop("escalation_policies", UNSET) - escalation_policies: list[PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem] | Unset = UNSET - if _escalation_policies is not UNSET: - escalation_policies = [] - for escalation_policies_item_data in _escalation_policies: - escalation_policies_item = PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem.from_dict( - escalation_policies_item_data - ) + for escalation_policies_item_data in _escalation_policies or []: + escalation_policies_item = PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem.from_dict( + escalation_policies_item_data + ) - escalation_policies.append(escalation_policies_item) + escalation_policies.append(escalation_policies_item) + users = [] _users = d.pop("users", UNSET) - users: list[PagePagerdutyOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = PagePagerdutyOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = PagePagerdutyOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) message = d.pop("message", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset + urgency: Unset | PagePagerdutyOnCallRespondersTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py index 2d743482..4384233c 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py index 5d7c2c8e..2e52e7c6 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PagePagerdutyOnCallRespondersTaskParamsService: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py index bd0237ac..1ce3b023 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PagePagerdutyOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params.py index e35e7ba7..0a67bd82 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,58 +37,57 @@ class PageRootlyOnCallRespondersTaskParams: Attributes: alert_urgency_id (str): Alert urgency ID summary (str): Alert title - task_type (PageRootlyOnCallRespondersTaskParamsTaskType | Unset): - escalation_policy_target (PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset): - service_target (PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset): - user_target (PageRootlyOnCallRespondersTaskParamsUserTarget | Unset): - group_target (PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset): - functionality_target (PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset): - description (str | Unset): Alert description - escalation_note (str | Unset): - create_new_alert (bool | Unset): When true, always create a new alert instead of re-paging the alert that + task_type (Union[Unset, PageRootlyOnCallRespondersTaskParamsTaskType]): + escalation_policy_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget]): + service_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsServiceTarget]): + user_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsUserTarget]): + group_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsGroupTarget]): + functionality_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsFunctionalityTarget]): + description (Union[Unset, str]): Alert description + escalation_note (Union[Unset, str]): + create_new_alert (Union[Unset, bool]): When true, always create a new alert instead of re-paging the alert that triggered the workflow Default: False. """ alert_urgency_id: str summary: str - task_type: PageRootlyOnCallRespondersTaskParamsTaskType | Unset = UNSET - escalation_policy_target: PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset = UNSET - user_target: PageRootlyOnCallRespondersTaskParamsUserTarget | Unset = UNSET - group_target: PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset = UNSET - functionality_target: PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset = UNSET - description: str | Unset = UNSET - escalation_note: str | Unset = UNSET - create_new_alert: bool | Unset = False + task_type: Unset | PageRootlyOnCallRespondersTaskParamsTaskType = UNSET + escalation_policy_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget"] = UNSET + service_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsServiceTarget"] = UNSET + user_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsUserTarget"] = UNSET + group_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsGroupTarget"] = UNSET + functionality_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsFunctionalityTarget"] = UNSET + description: Unset | str = UNSET + escalation_note: Unset | str = UNSET + create_new_alert: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - alert_urgency_id = self.alert_urgency_id summary = self.summary - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: dict[str, Any] | Unset = UNSET + escalation_policy_target: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: dict[str, Any] | Unset = UNSET + service_target: Unset | dict[str, Any] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: dict[str, Any] | Unset = UNSET + user_target: Unset | dict[str, Any] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: dict[str, Any] | Unset = UNSET + group_target: Unset | dict[str, Any] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - functionality_target: dict[str, Any] | Unset = UNSET + functionality_target: Unset | dict[str, Any] = UNSET if not isinstance(self.functionality_target, Unset): functionality_target = self.functionality_target.to_dict() @@ -153,14 +150,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary") _task_type = d.pop("task_type", UNSET) - task_type: PageRootlyOnCallRespondersTaskParamsTaskType | Unset + task_type: Unset | PageRootlyOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_rootly_on_call_responders_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset + escalation_policy_target: Unset | PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -169,28 +166,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset + service_target: Unset | PageRootlyOnCallRespondersTaskParamsServiceTarget if isinstance(_service_target, Unset): service_target = UNSET else: service_target = PageRootlyOnCallRespondersTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: PageRootlyOnCallRespondersTaskParamsUserTarget | Unset + user_target: Unset | PageRootlyOnCallRespondersTaskParamsUserTarget if isinstance(_user_target, Unset): user_target = UNSET else: user_target = PageRootlyOnCallRespondersTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset + group_target: Unset | PageRootlyOnCallRespondersTaskParamsGroupTarget if isinstance(_group_target, Unset): group_target = UNSET else: group_target = PageRootlyOnCallRespondersTaskParamsGroupTarget.from_dict(_group_target) _functionality_target = d.pop("functionality_target", UNSET) - functionality_target: PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset + functionality_target: Unset | PageRootlyOnCallRespondersTaskParamsFunctionalityTarget if isinstance(_functionality_target, Unset): functionality_target = UNSET else: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py index 3120e18c..8eb10f74 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py index 9d0b0fcf..f57ba69b 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsFunctionalityTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py index e66c01e4..491fc701 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsGroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py index 8bdb97c4..c7f7fdc3 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py index 5dd0f4fe..e66fae34 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsUserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py index 941d2835..d87c9af5 100644 --- a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py +++ b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageVictorOpsOnCallRespondersTaskParamsType0UsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py index 5848af71..575d7525 100644 --- a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py +++ b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PageVictorOpsOnCallRespondersTaskParamsType1EscalationPoliciesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/patch_alert_route.py b/rootly_sdk/models/patch_alert_route.py index ad87d4c5..2c80e136 100644 --- a/rootly_sdk/models/patch_alert_route.py +++ b/rootly_sdk/models/patch_alert_route.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class PatchAlertRoute: data (PatchAlertRouteData): """ - data: PatchAlertRouteData + data: "PatchAlertRouteData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/patch_alert_route_data.py b/rootly_sdk/models/patch_alert_route_data.py index 334bec3e..78df219c 100644 --- a/rootly_sdk/models/patch_alert_route_data.py +++ b/rootly_sdk/models/patch_alert_route_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class PatchAlertRouteData: """ type_: PatchAlertRouteDataType - attributes: PatchAlertRouteDataAttributes + attributes: "PatchAlertRouteDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/patch_alert_route_data_attributes.py b/rootly_sdk/models/patch_alert_route_data_attributes.py index 04d8dd16..7ce0b72e 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -19,40 +17,39 @@ class PatchAlertRouteDataAttributes: """ Attributes: - name (str | Unset): The name of the alert route - enabled (bool | Unset): Whether the alert route is enabled - alerts_source_ids (list[UUID] | Unset): - owning_team_ids (list[UUID] | Unset): - rules (list[PatchAlertRouteDataAttributesRulesItem] | Unset): + name (Union[Unset, str]): The name of the alert route + enabled (Union[Unset, bool]): Whether the alert route is enabled + alerts_source_ids (Union[Unset, list[UUID]]): + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['PatchAlertRouteDataAttributesRulesItem']]): """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - alerts_source_ids: list[UUID] | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[PatchAlertRouteDataAttributesRulesItem] | Unset = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + alerts_source_ids: Unset | list[UUID] = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["PatchAlertRouteDataAttributesRulesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name enabled = self.enabled - alerts_source_ids: list[str] | Unset = UNSET + alerts_source_ids: Unset | list[str] = UNSET if not isinstance(self.alerts_source_ids, Unset): alerts_source_ids = [] for alerts_source_ids_item_data in self.alerts_source_ids: alerts_source_ids_item = str(alerts_source_ids_item_data) alerts_source_ids.append(alerts_source_ids_item) - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -84,32 +81,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + alerts_source_ids = [] _alerts_source_ids = d.pop("alerts_source_ids", UNSET) - alerts_source_ids: list[UUID] | Unset = UNSET - if _alerts_source_ids is not UNSET: - alerts_source_ids = [] - for alerts_source_ids_item_data in _alerts_source_ids: - alerts_source_ids_item = UUID(alerts_source_ids_item_data) + for alerts_source_ids_item_data in _alerts_source_ids or []: + alerts_source_ids_item = UUID(alerts_source_ids_item_data) - alerts_source_ids.append(alerts_source_ids_item) + alerts_source_ids.append(alerts_source_ids_item) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[PatchAlertRouteDataAttributesRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = PatchAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = PatchAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) patch_alert_route_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py index 83f9eba3..0a3db1c0 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -25,27 +23,26 @@ class PatchAlertRouteDataAttributesRulesItem: """ Attributes: - id (UUID | Unset): The ID of the alert routing rule. Required for updating or deleting existing rules. - field_destroy (bool | Unset): Set to true to delete this rule. When true, only the id field is required. - name (str | Unset): The name of the alert routing rule - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. - destinations (list[PatchAlertRouteDataAttributesRulesItemDestinationsItem] | Unset): - condition_groups (list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItem] | Unset): + id (Union[Unset, UUID]): The ID of the alert routing rule. Required for updating or deleting existing rules. + field_destroy (Union[Unset, bool]): Set to true to delete this rule. When true, only the id field is required. + name (Union[Unset, str]): The name of the alert routing rule + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. + destinations (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemDestinationsItem']]): + condition_groups (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemConditionGroupsItem']]): """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - name: str | Unset = UNSET - position: int | Unset = UNSET - fallback_rule: bool | Unset = False - destinations: list[PatchAlertRouteDataAttributesRulesItemDestinationsItem] | Unset = UNSET - condition_groups: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItem] | Unset = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + name: Unset | str = UNSET + position: Unset | int = UNSET + fallback_rule: Unset | bool = False + destinations: Unset | list["PatchAlertRouteDataAttributesRulesItemDestinationsItem"] = UNSET + condition_groups: Unset | list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -57,14 +54,14 @@ def to_dict(self) -> dict[str, Any]: fallback_rule = self.fallback_rule - destinations: list[dict[str, Any]] | Unset = UNSET + destinations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.destinations, Unset): destinations = [] for destinations_item_data in self.destinations: destinations_item = destinations_item_data.to_dict() destinations.append(destinations_item) - condition_groups: list[dict[str, Any]] | Unset = UNSET + condition_groups: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -102,7 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -116,27 +113,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fallback_rule = d.pop("fallback_rule", UNSET) + destinations = [] _destinations = d.pop("destinations", UNSET) - destinations: list[PatchAlertRouteDataAttributesRulesItemDestinationsItem] | Unset = UNSET - if _destinations is not UNSET: - destinations = [] - for destinations_item_data in _destinations: - destinations_item = PatchAlertRouteDataAttributesRulesItemDestinationsItem.from_dict( - destinations_item_data - ) + for destinations_item_data in _destinations or []: + destinations_item = PatchAlertRouteDataAttributesRulesItemDestinationsItem.from_dict(destinations_item_data) - destinations.append(destinations_item) + destinations.append(destinations_item) + condition_groups = [] _condition_groups = d.pop("condition_groups", UNSET) - condition_groups: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItem] | Unset = UNSET - if _condition_groups is not UNSET: - condition_groups = [] - for condition_groups_item_data in _condition_groups: - condition_groups_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItem.from_dict( - condition_groups_item_data - ) + for condition_groups_item_data in _condition_groups or []: + condition_groups_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItem.from_dict( + condition_groups_item_data + ) - condition_groups.append(condition_groups_item) + condition_groups.append(condition_groups_item) patch_alert_route_data_attributes_rules_item = cls( id=id, diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py index dde7d127..e7c6bfbb 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -22,21 +20,21 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - id (UUID | Unset): The ID of the condition group. Required for updating or deleting existing condition groups. - field_destroy (bool | Unset): Set to true to delete this condition group - position (int | Unset): The position of the condition group - conditions (list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset): + id (Union[Unset, UUID]): The ID of the condition group. Required for updating or deleting existing condition + groups. + field_destroy (Union[Unset, bool]): Set to true to delete this condition group + position (Union[Unset, int]): The position of the condition group + conditions (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']]): """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - position: int | Unset = UNSET - conditions: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + position: Unset | int = UNSET + conditions: Unset | list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -44,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -73,7 +71,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -83,16 +81,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem.from_dict( - conditions_item_data - ) + for conditions_item_data in _conditions or []: + conditions_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem.from_dict( + conditions_item_data + ) - conditions.append(conditions_item) + conditions.append(conditions_item) patch_alert_route_data_attributes_rules_item_condition_groups_item = cls( id=id, diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index d9b6fcc0..0c6a94c1 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -28,63 +26,64 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: """ Attributes: - id (UUID | Unset): The ID of the condition. Required for updating or deleting existing conditions. - field_destroy (bool | Unset): Set to true to delete this condition - property_field_condition_type - (PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset): - property_field_name (str | Unset): The name of the property field - property_field_type (PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | - Unset): - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + id (Union[Unset, UUID]): The ID of the condition. Required for updating or deleting existing conditions. + field_destroy (Union[Unset, bool]): Set to true to delete this condition + property_field_condition_type (Union[Unset, + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType]): + property_field_name (Union[Unset, str]): The name of the property field + property_field_type (Union[Unset, + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType]): + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET property_field_condition_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) = UNSET - property_field_name: str | Unset = UNSET + property_field_name: Unset | str = UNSET property_field_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | Unset + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType ) = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET conditionable_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType ) = UNSET - conditionable_id: None | Unset | UUID = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - property_field_condition_type: str | Unset = UNSET + property_field_condition_type: Unset | str = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type property_field_name = self.property_field_name - property_field_type: str | Unset = UNSET + property_field_type: Unset | str = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -93,7 +92,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -102,11 +101,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -144,7 +143,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -154,7 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_condition_type = d.pop("property_field_condition_type", UNSET) property_field_condition_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET @@ -167,7 +166,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_type = d.pop("property_field_type", UNSET) property_field_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | Unset + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType ) if isinstance(_property_field_type, Unset): property_field_type = UNSET @@ -176,16 +175,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_type ) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -196,13 +195,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -213,15 +212,15 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -230,7 +229,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -241,9 +240,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py index 237f4198..f9641168 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID @@ -20,31 +18,31 @@ class PatchAlertRouteDataAttributesRulesItemDestinationsItem: """ Attributes: - id (UUID | Unset): The ID of the destination. Required for updating or deleting existing destinations. - field_destroy (bool | Unset): Set to true to delete this destination - target_type (PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset): The type of the target. - Please contact support if you encounter issues using `Functionality` as a target type. - target_id (UUID | Unset): The ID of the target + id (Union[Unset, UUID]): The ID of the destination. Required for updating or deleting existing destinations. + field_destroy (Union[Unset, bool]): Set to true to delete this destination + target_type (Union[Unset, PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType]): The type of the + target. Please contact support if you encounter issues using `Functionality` as a target type. + target_id (Union[Unset, UUID]): The ID of the target """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - target_type: PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset = UNSET - target_id: UUID | Unset = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + target_type: Unset | PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType = UNSET + target_id: Unset | UUID = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - target_type: str | Unset = UNSET + target_type: Unset | str = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: str | Unset = UNSET + target_id: Unset | str = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -75,14 +73,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_destroy = d.pop("_destroy", UNSET) _target_type = d.pop("target_type", UNSET) - target_type: PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset + target_type: Unset | PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType if isinstance(_target_type, Unset): target_type = UNSET else: target_type = check_patch_alert_route_data_attributes_rules_item_destinations_item_target_type(_target_type) _target_id = d.pop("target_id", UNSET) - target_id: UUID | Unset + target_id: Unset | UUID if isinstance(_target_id, Unset): target_id = UNSET else: diff --git a/rootly_sdk/models/phone_verification_response.py b/rootly_sdk/models/phone_verification_response.py index 636cfa5a..f04e1cf3 100644 --- a/rootly_sdk/models/phone_verification_response.py +++ b/rootly_sdk/models/phone_verification_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PhoneVerificationResponse: """ Attributes: - message (str | Unset): Success message - error (str | Unset): Error message + message (Union[Unset, str]): Success message + error (Union[Unset, str]): Error message """ - message: str | Unset = UNSET - error: str | Unset = UNSET + message: Unset | str = UNSET + error: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/playbook.py b/rootly_sdk/models/playbook.py index cc9126ef..a2d1dac4 100644 --- a/rootly_sdk/models/playbook.py +++ b/rootly_sdk/models/playbook.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,27 +16,27 @@ class Playbook: title (str): The title of the playbook created_at (str): Date of creation updated_at (str): Date of last update - summary (None | str | Unset): The summary of the playbook - external_url (None | str | Unset): The external url of the playbook - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident + summary (Union[None, Unset, str]): The summary of the playbook + external_url (Union[None, Unset, str]): The external url of the playbook + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ title: str created_at: str updated_at: str - summary: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + summary: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + severity_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -69,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -87,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -96,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -105,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -151,25 +149,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -180,13 +178,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -197,13 +195,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -214,13 +212,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -231,13 +229,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -248,13 +246,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -265,9 +263,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/playbook_list.py b/rootly_sdk/models/playbook_list.py index 41883360..9c4e42b7 100644 --- a/rootly_sdk/models/playbook_list.py +++ b/rootly_sdk/models/playbook_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class PlaybookList: """ Attributes: - data (list[PlaybookListDataItem]): + data (list['PlaybookListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PlaybookListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PlaybookListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_list = cls( data=data, diff --git a/rootly_sdk/models/playbook_list_data_item.py b/rootly_sdk/models/playbook_list_data_item.py index 90c8ddde..049aef9b 100644 --- a/rootly_sdk/models/playbook_list_data_item.py +++ b/rootly_sdk/models/playbook_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PlaybookListDataItem: id: str type_: PlaybookListDataItemType - attributes: Playbook + attributes: "Playbook" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/playbook_response.py b/rootly_sdk/models/playbook_response.py index 09e9cb31..55dcfd53 100644 --- a/rootly_sdk/models/playbook_response.py +++ b/rootly_sdk/models/playbook_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class PlaybookResponse: """ Attributes: data (PlaybookResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PlaybookResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PlaybookResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PlaybookResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_response = cls( data=data, diff --git a/rootly_sdk/models/playbook_response_data.py b/rootly_sdk/models/playbook_response_data.py index 8c844e20..4ef6997f 100644 --- a/rootly_sdk/models/playbook_response_data.py +++ b/rootly_sdk/models/playbook_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PlaybookResponseData: id: str type_: PlaybookResponseDataType - attributes: Playbook + attributes: "Playbook" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/playbook_task.py b/rootly_sdk/models/playbook_task.py index 401f39aa..3aad84ad 100644 --- a/rootly_sdk/models/playbook_task.py +++ b/rootly_sdk/models/playbook_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,17 +16,17 @@ class PlaybookTask: task (str): The task of the task created_at (str): Date of creation updated_at (str): Date of last update - playbook_id (str | Unset): - description (None | str | Unset): The description of task - position (int | None | Unset): The position of the task + playbook_id (Union[Unset, str]): + description (Union[None, Unset, str]): The description of task + position (Union[None, Unset, int]): The position of the task """ task: str created_at: str updated_at: str - playbook_id: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + playbook_id: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,13 +38,13 @@ def to_dict(self) -> dict[str, Any]: playbook_id = self.playbook_id - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -81,21 +79,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: playbook_id = d.pop("playbook_id", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/playbook_task_list.py b/rootly_sdk/models/playbook_task_list.py index da771781..e93328d3 100644 --- a/rootly_sdk/models/playbook_task_list.py +++ b/rootly_sdk/models/playbook_task_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class PlaybookTaskList: """ Attributes: - data (list[PlaybookTaskListDataItem]): + data (list['PlaybookTaskListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PlaybookTaskListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PlaybookTaskListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_task_list = cls( data=data, diff --git a/rootly_sdk/models/playbook_task_list_data_item.py b/rootly_sdk/models/playbook_task_list_data_item.py index 6a1a8b7e..8a7fac55 100644 --- a/rootly_sdk/models/playbook_task_list_data_item.py +++ b/rootly_sdk/models/playbook_task_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PlaybookTaskListDataItem: id: str type_: PlaybookTaskListDataItemType - attributes: PlaybookTask + attributes: "PlaybookTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/playbook_task_response.py b/rootly_sdk/models/playbook_task_response.py index cfa83e2b..7ce3df22 100644 --- a/rootly_sdk/models/playbook_task_response.py +++ b/rootly_sdk/models/playbook_task_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class PlaybookTaskResponse: """ Attributes: data (PlaybookTaskResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PlaybookTaskResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PlaybookTaskResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PlaybookTaskResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_task_response = cls( data=data, diff --git a/rootly_sdk/models/playbook_task_response_data.py b/rootly_sdk/models/playbook_task_response_data.py index 8dda77d8..7ec717a0 100644 --- a/rootly_sdk/models/playbook_task_response_data.py +++ b/rootly_sdk/models/playbook_task_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PlaybookTaskResponseData: id: str type_: PlaybookTaskResponseDataType - attributes: PlaybookTask + attributes: "PlaybookTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/post_mortem_template.py b/rootly_sdk/models/post_mortem_template.py index 175b93d9..48bfd505 100644 --- a/rootly_sdk/models/post_mortem_template.py +++ b/rootly_sdk/models/post_mortem_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,25 @@ class PostMortemTemplate: name (str): The name of the postmortem template created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slugified name of the postmortem template - default (bool | None | Unset): Default selected template when editing a postmortem - content (str | Unset): The postmortem template. Liquid syntax and markdown are supported - content_html (None | str | Unset): The postmortem template in HTML format with TipTap blocks support. Supports - followup and timeline components. Liquid syntax is supported. - content_json (None | PostMortemTemplateContentJsonType0 | Unset): The postmortem template in TipTap JSON format - format_ (PostMortemTemplateFormat | Unset): The format of the input + slug (Union[Unset, str]): The slugified name of the postmortem template + default (Union[None, Unset, bool]): Default selected template when editing a postmortem + content (Union[Unset, str]): The postmortem template. Liquid syntax and markdown are supported + content_html (Union[None, Unset, str]): The postmortem template in HTML format with TipTap blocks support. + Supports followup and timeline components. Liquid syntax is supported. + content_json (Union['PostMortemTemplateContentJsonType0', None, Unset]): The postmortem template in TipTap JSON + format + format_ (Union[Unset, PostMortemTemplateFormat]): The format of the input """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - default: bool | None | Unset = UNSET - content: str | Unset = UNSET - content_html: None | str | Unset = UNSET - content_json: None | PostMortemTemplateContentJsonType0 | Unset = UNSET - format_: PostMortemTemplateFormat | Unset = UNSET + slug: Unset | str = UNSET + default: None | Unset | bool = UNSET + content: Unset | str = UNSET + content_html: None | Unset | str = UNSET + content_json: Union["PostMortemTemplateContentJsonType0", None, Unset] = UNSET + format_: Unset | PostMortemTemplateFormat = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - default: bool | None | Unset + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: @@ -62,13 +61,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - content_html: None | str | Unset + content_html: None | Unset | str if isinstance(self.content_html, Unset): content_html = UNSET else: content_html = self.content_html - content_json: dict[str, Any] | None | Unset + content_json: None | Unset | dict[str, Any] if isinstance(self.content_json, Unset): content_json = UNSET elif isinstance(self.content_json, PostMortemTemplateContentJsonType0): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: content_json = self.content_json - format_: str | Unset = UNSET + format_: Unset | str = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -117,27 +116,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) - def _parse_content_html(data: object) -> None | str | Unset: + def _parse_content_html(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) content_html = _parse_content_html(d.pop("content_html", UNSET)) - def _parse_content_json(data: object) -> None | PostMortemTemplateContentJsonType0 | Unset: + def _parse_content_json(data: object) -> Union["PostMortemTemplateContentJsonType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -148,14 +147,14 @@ def _parse_content_json(data: object) -> None | PostMortemTemplateContentJsonTyp content_json_type_0 = PostMortemTemplateContentJsonType0.from_dict(data) return content_json_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | PostMortemTemplateContentJsonType0 | Unset, data) + return cast(Union["PostMortemTemplateContentJsonType0", None, Unset], data) content_json = _parse_content_json(d.pop("content_json", UNSET)) _format_ = d.pop("format", UNSET) - format_: PostMortemTemplateFormat | Unset + format_: Unset | PostMortemTemplateFormat if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/post_mortem_template_content_json_type_0.py b/rootly_sdk/models/post_mortem_template_content_json_type_0.py index 0375e77a..0670aad3 100644 --- a/rootly_sdk/models/post_mortem_template_content_json_type_0.py +++ b/rootly_sdk/models/post_mortem_template_content_json_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class PostMortemTemplateContentJsonType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/post_mortem_template_list.py b/rootly_sdk/models/post_mortem_template_list.py index f855b333..d8515f04 100644 --- a/rootly_sdk/models/post_mortem_template_list.py +++ b/rootly_sdk/models/post_mortem_template_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class PostMortemTemplateList: """ Attributes: - data (list[PostMortemTemplateListDataItem]): + data (list['PostMortemTemplateListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PostMortemTemplateListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PostMortemTemplateListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) post_mortem_template_list = cls( data=data, diff --git a/rootly_sdk/models/post_mortem_template_list_data_item.py b/rootly_sdk/models/post_mortem_template_list_data_item.py index 18004832..7bd5a785 100644 --- a/rootly_sdk/models/post_mortem_template_list_data_item.py +++ b/rootly_sdk/models/post_mortem_template_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PostMortemTemplateListDataItem: id: str type_: PostMortemTemplateListDataItemType - attributes: PostMortemTemplate + attributes: "PostMortemTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/post_mortem_template_response.py b/rootly_sdk/models/post_mortem_template_response.py index 19995e60..fe5da9dd 100644 --- a/rootly_sdk/models/post_mortem_template_response.py +++ b/rootly_sdk/models/post_mortem_template_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class PostMortemTemplateResponse: """ Attributes: data (PostMortemTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PostMortemTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PostMortemTemplateResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PostMortemTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) post_mortem_template_response = cls( data=data, diff --git a/rootly_sdk/models/post_mortem_template_response_data.py b/rootly_sdk/models/post_mortem_template_response_data.py index 839a4498..c9c97e69 100644 --- a/rootly_sdk/models/post_mortem_template_response_data.py +++ b/rootly_sdk/models/post_mortem_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PostMortemTemplateResponseData: id: str type_: PostMortemTemplateResponseDataType - attributes: PostMortemTemplate + attributes: "PostMortemTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/post_mortem_trigger_params.py b/rootly_sdk/models/post_mortem_trigger_params.py index a045bbe9..0abd7368 100644 --- a/rootly_sdk/models/post_mortem_trigger_params.py +++ b/rootly_sdk/models/post_mortem_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -128,214 +126,217 @@ class PostMortemTriggerParams: """ Attributes: trigger_type (PostMortemTriggerParamsTriggerType): - triggers (list[str] | Unset): - incident_visibilities (list[bool] | Unset): - incident_kinds (list[PostMortemTriggerParamsIncidentKindsItem] | Unset): - incident_statuses (list[PostMortemTriggerParamsIncidentStatusesItem] | Unset): - incident_inactivity_duration (None | str | Unset): ex. 10 min, 1h, 3 days, 2 weeks - incident_condition (PostMortemTriggerParamsIncidentCondition | Unset): Default: 'ALL'. - incident_condition_visibility (PostMortemTriggerParamsIncidentConditionVisibility | Unset): Default: 'ANY'. - incident_condition_kind (PostMortemTriggerParamsIncidentConditionKind | Unset): Default: 'IS'. - incident_condition_status (PostMortemTriggerParamsIncidentConditionStatus | Unset): Default: 'ANY'. - incident_condition_sub_status (PostMortemTriggerParamsIncidentConditionSubStatus | Unset): Default: 'ANY'. - incident_condition_environment (PostMortemTriggerParamsIncidentConditionEnvironment | Unset): Default: 'ANY'. - incident_condition_severity (PostMortemTriggerParamsIncidentConditionSeverity | Unset): Default: 'ANY'. - incident_condition_incident_type (PostMortemTriggerParamsIncidentConditionIncidentType | Unset): Default: + triggers (Union[Unset, list[str]]): + incident_visibilities (Union[Unset, list[bool]]): + incident_kinds (Union[Unset, list[PostMortemTriggerParamsIncidentKindsItem]]): + incident_statuses (Union[Unset, list[PostMortemTriggerParamsIncidentStatusesItem]]): + incident_inactivity_duration (Union[None, Unset, str]): ex. 10 min, 1h, 3 days, 2 weeks + incident_condition (Union[Unset, PostMortemTriggerParamsIncidentCondition]): Default: 'ALL'. + incident_condition_visibility (Union[Unset, PostMortemTriggerParamsIncidentConditionVisibility]): Default: + 'ANY'. + incident_condition_kind (Union[Unset, PostMortemTriggerParamsIncidentConditionKind]): Default: 'IS'. + incident_condition_status (Union[Unset, PostMortemTriggerParamsIncidentConditionStatus]): Default: 'ANY'. + incident_condition_sub_status (Union[Unset, PostMortemTriggerParamsIncidentConditionSubStatus]): Default: 'ANY'. - incident_condition_incident_roles (PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset): Default: + incident_condition_environment (Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment]): Default: 'ANY'. - incident_condition_service (PostMortemTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. - incident_condition_functionality (PostMortemTriggerParamsIncidentConditionFunctionality | Unset): Default: + incident_condition_severity (Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. + incident_condition_incident_type (Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType]): Default: 'ANY'. - incident_condition_group (PostMortemTriggerParamsIncidentConditionGroup | Unset): Default: 'ANY'. - incident_condition_cause (PostMortemTriggerParamsIncidentConditionCause | Unset): Default: 'ANY'. - incident_condition_label (PostMortemTriggerParamsIncidentConditionLabel | Unset): Default: 'ANY'. - incident_condition_label_use_regexp (bool | Unset): Default: False. - incident_labels (list[str] | Unset): - incident_post_mortem_condition_cause (PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset): + incident_condition_incident_roles (Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentRoles]): + Default: 'ANY'. + incident_condition_service (Union[Unset, PostMortemTriggerParamsIncidentConditionService]): Default: 'ANY'. + incident_condition_functionality (Union[Unset, PostMortemTriggerParamsIncidentConditionFunctionality]): + Default: 'ANY'. + incident_condition_group (Union[Unset, PostMortemTriggerParamsIncidentConditionGroup]): Default: 'ANY'. + incident_condition_cause (Union[Unset, PostMortemTriggerParamsIncidentConditionCause]): Default: 'ANY'. + incident_condition_label (Union[Unset, PostMortemTriggerParamsIncidentConditionLabel]): Default: 'ANY'. + incident_condition_label_use_regexp (Union[Unset, bool]): Default: False. + incident_labels (Union[Unset, list[str]]): + incident_post_mortem_condition_cause (Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionCause]): [DEPRECATED] Use incident_condition_cause instead Default: 'ANY'. - incident_condition_summary (PostMortemTriggerParamsIncidentConditionSummary | Unset): - incident_condition_started_at (PostMortemTriggerParamsIncidentConditionStartedAt | Unset): - incident_condition_detected_at (PostMortemTriggerParamsIncidentConditionDetectedAt | Unset): - incident_condition_acknowledged_at (PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset): - incident_condition_mitigated_at (PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset): - incident_condition_resolved_at (PostMortemTriggerParamsIncidentConditionResolvedAt | Unset): - incident_conditional_inactivity (PostMortemTriggerParamsIncidentConditionalInactivity | Unset): - incident_post_mortem_condition (PostMortemTriggerParamsIncidentPostMortemCondition | Unset): - incident_post_mortem_condition_status (PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset): + incident_condition_summary (Union[Unset, PostMortemTriggerParamsIncidentConditionSummary]): + incident_condition_started_at (Union[Unset, PostMortemTriggerParamsIncidentConditionStartedAt]): + incident_condition_detected_at (Union[Unset, PostMortemTriggerParamsIncidentConditionDetectedAt]): + incident_condition_acknowledged_at (Union[Unset, PostMortemTriggerParamsIncidentConditionAcknowledgedAt]): + incident_condition_mitigated_at (Union[Unset, PostMortemTriggerParamsIncidentConditionMitigatedAt]): + incident_condition_resolved_at (Union[Unset, PostMortemTriggerParamsIncidentConditionResolvedAt]): + incident_conditional_inactivity (Union[Unset, PostMortemTriggerParamsIncidentConditionalInactivity]): + incident_post_mortem_condition (Union[Unset, PostMortemTriggerParamsIncidentPostMortemCondition]): + incident_post_mortem_condition_status (Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionStatus]): Default: 'ANY'. - incident_post_mortem_statuses (list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset): + incident_post_mortem_statuses (Union[Unset, list[PostMortemTriggerParamsIncidentPostMortemStatusesItem]]): """ trigger_type: PostMortemTriggerParamsTriggerType - triggers: list[str] | Unset = UNSET - incident_visibilities: list[bool] | Unset = UNSET - incident_kinds: list[PostMortemTriggerParamsIncidentKindsItem] | Unset = UNSET - incident_statuses: list[PostMortemTriggerParamsIncidentStatusesItem] | Unset = UNSET - incident_inactivity_duration: None | str | Unset = UNSET - incident_condition: PostMortemTriggerParamsIncidentCondition | Unset = "ALL" - incident_condition_visibility: PostMortemTriggerParamsIncidentConditionVisibility | Unset = "ANY" - incident_condition_kind: PostMortemTriggerParamsIncidentConditionKind | Unset = "IS" - incident_condition_status: PostMortemTriggerParamsIncidentConditionStatus | Unset = "ANY" - incident_condition_sub_status: PostMortemTriggerParamsIncidentConditionSubStatus | Unset = "ANY" - incident_condition_environment: PostMortemTriggerParamsIncidentConditionEnvironment | Unset = "ANY" - incident_condition_severity: PostMortemTriggerParamsIncidentConditionSeverity | Unset = "ANY" - incident_condition_incident_type: PostMortemTriggerParamsIncidentConditionIncidentType | Unset = "ANY" - incident_condition_incident_roles: PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset = "ANY" - incident_condition_service: PostMortemTriggerParamsIncidentConditionService | Unset = "ANY" - incident_condition_functionality: PostMortemTriggerParamsIncidentConditionFunctionality | Unset = "ANY" - incident_condition_group: PostMortemTriggerParamsIncidentConditionGroup | Unset = "ANY" - incident_condition_cause: PostMortemTriggerParamsIncidentConditionCause | Unset = "ANY" - incident_condition_label: PostMortemTriggerParamsIncidentConditionLabel | Unset = "ANY" - incident_condition_label_use_regexp: bool | Unset = False - incident_labels: list[str] | Unset = UNSET - incident_post_mortem_condition_cause: PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset = "ANY" - incident_condition_summary: PostMortemTriggerParamsIncidentConditionSummary | Unset = UNSET - incident_condition_started_at: PostMortemTriggerParamsIncidentConditionStartedAt | Unset = UNSET - incident_condition_detected_at: PostMortemTriggerParamsIncidentConditionDetectedAt | Unset = UNSET - incident_condition_acknowledged_at: PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset = UNSET - incident_condition_mitigated_at: PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset = UNSET - incident_condition_resolved_at: PostMortemTriggerParamsIncidentConditionResolvedAt | Unset = UNSET - incident_conditional_inactivity: PostMortemTriggerParamsIncidentConditionalInactivity | Unset = UNSET - incident_post_mortem_condition: PostMortemTriggerParamsIncidentPostMortemCondition | Unset = UNSET - incident_post_mortem_condition_status: PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset = "ANY" - incident_post_mortem_statuses: list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset = UNSET + triggers: Unset | list[str] = UNSET + incident_visibilities: Unset | list[bool] = UNSET + incident_kinds: Unset | list[PostMortemTriggerParamsIncidentKindsItem] = UNSET + incident_statuses: Unset | list[PostMortemTriggerParamsIncidentStatusesItem] = UNSET + incident_inactivity_duration: None | Unset | str = UNSET + incident_condition: Unset | PostMortemTriggerParamsIncidentCondition = "ALL" + incident_condition_visibility: Unset | PostMortemTriggerParamsIncidentConditionVisibility = "ANY" + incident_condition_kind: Unset | PostMortemTriggerParamsIncidentConditionKind = "IS" + incident_condition_status: Unset | PostMortemTriggerParamsIncidentConditionStatus = "ANY" + incident_condition_sub_status: Unset | PostMortemTriggerParamsIncidentConditionSubStatus = "ANY" + incident_condition_environment: Unset | PostMortemTriggerParamsIncidentConditionEnvironment = "ANY" + incident_condition_severity: Unset | PostMortemTriggerParamsIncidentConditionSeverity = "ANY" + incident_condition_incident_type: Unset | PostMortemTriggerParamsIncidentConditionIncidentType = "ANY" + incident_condition_incident_roles: Unset | PostMortemTriggerParamsIncidentConditionIncidentRoles = "ANY" + incident_condition_service: Unset | PostMortemTriggerParamsIncidentConditionService = "ANY" + incident_condition_functionality: Unset | PostMortemTriggerParamsIncidentConditionFunctionality = "ANY" + incident_condition_group: Unset | PostMortemTriggerParamsIncidentConditionGroup = "ANY" + incident_condition_cause: Unset | PostMortemTriggerParamsIncidentConditionCause = "ANY" + incident_condition_label: Unset | PostMortemTriggerParamsIncidentConditionLabel = "ANY" + incident_condition_label_use_regexp: Unset | bool = False + incident_labels: Unset | list[str] = UNSET + incident_post_mortem_condition_cause: Unset | PostMortemTriggerParamsIncidentPostMortemConditionCause = "ANY" + incident_condition_summary: Unset | PostMortemTriggerParamsIncidentConditionSummary = UNSET + incident_condition_started_at: Unset | PostMortemTriggerParamsIncidentConditionStartedAt = UNSET + incident_condition_detected_at: Unset | PostMortemTriggerParamsIncidentConditionDetectedAt = UNSET + incident_condition_acknowledged_at: Unset | PostMortemTriggerParamsIncidentConditionAcknowledgedAt = UNSET + incident_condition_mitigated_at: Unset | PostMortemTriggerParamsIncidentConditionMitigatedAt = UNSET + incident_condition_resolved_at: Unset | PostMortemTriggerParamsIncidentConditionResolvedAt = UNSET + incident_conditional_inactivity: Unset | PostMortemTriggerParamsIncidentConditionalInactivity = UNSET + incident_post_mortem_condition: Unset | PostMortemTriggerParamsIncidentPostMortemCondition = UNSET + incident_post_mortem_condition_status: Unset | PostMortemTriggerParamsIncidentPostMortemConditionStatus = "ANY" + incident_post_mortem_statuses: Unset | list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: list[bool] | Unset = UNSET + incident_visibilities: Unset | list[bool] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: list[str] | Unset = UNSET + incident_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: list[str] | Unset = UNSET + incident_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: None | str | Unset + incident_inactivity_duration: None | Unset | str if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: str | Unset = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: str | Unset = UNSET + incident_condition_visibility: Unset | str = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: str | Unset = UNSET + incident_condition_kind: Unset | str = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: str | Unset = UNSET + incident_condition_status: Unset | str = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: str | Unset = UNSET + incident_condition_sub_status: Unset | str = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: str | Unset = UNSET + incident_condition_environment: Unset | str = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: str | Unset = UNSET + incident_condition_severity: Unset | str = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: str | Unset = UNSET + incident_condition_incident_type: Unset | str = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: str | Unset = UNSET + incident_condition_incident_roles: Unset | str = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: str | Unset = UNSET + incident_condition_service: Unset | str = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: str | Unset = UNSET + incident_condition_functionality: Unset | str = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: str | Unset = UNSET + incident_condition_group: Unset | str = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: str | Unset = UNSET + incident_condition_cause: Unset | str = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: str | Unset = UNSET + incident_condition_label: Unset | str = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: list[str] | Unset = UNSET + incident_labels: Unset | list[str] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: str | Unset = UNSET + incident_post_mortem_condition_cause: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = self.incident_post_mortem_condition_cause - incident_condition_summary: str | Unset = UNSET + incident_condition_summary: Unset | str = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: str | Unset = UNSET + incident_condition_started_at: Unset | str = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: str | Unset = UNSET + incident_condition_detected_at: Unset | str = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: str | Unset = UNSET + incident_condition_acknowledged_at: Unset | str = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: str | Unset = UNSET + incident_condition_mitigated_at: Unset | str = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: str | Unset = UNSET + incident_condition_resolved_at: Unset | str = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: str | Unset = UNSET + incident_conditional_inactivity: Unset | str = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_post_mortem_condition: str | Unset = UNSET + incident_post_mortem_condition: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition, Unset): incident_post_mortem_condition = self.incident_post_mortem_condition - incident_post_mortem_condition_status: str | Unset = UNSET + incident_post_mortem_condition_status: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = self.incident_post_mortem_condition_status - incident_post_mortem_statuses: list[str] | Unset = UNSET + incident_post_mortem_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_post_mortem_statuses, Unset): incident_post_mortem_statuses = [] for incident_post_mortem_statuses_item_data in self.incident_post_mortem_statuses: @@ -425,44 +426,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_visibilities = cast(list[bool], d.pop("incident_visibilities", UNSET)) + incident_kinds = [] _incident_kinds = d.pop("incident_kinds", UNSET) - incident_kinds: list[PostMortemTriggerParamsIncidentKindsItem] | Unset = UNSET - if _incident_kinds is not UNSET: - incident_kinds = [] - for incident_kinds_item_data in _incident_kinds: - incident_kinds_item = check_post_mortem_trigger_params_incident_kinds_item(incident_kinds_item_data) + for incident_kinds_item_data in _incident_kinds or []: + incident_kinds_item = check_post_mortem_trigger_params_incident_kinds_item(incident_kinds_item_data) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) + incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - incident_statuses: list[PostMortemTriggerParamsIncidentStatusesItem] | Unset = UNSET - if _incident_statuses is not UNSET: - incident_statuses = [] - for incident_statuses_item_data in _incident_statuses: - incident_statuses_item = check_post_mortem_trigger_params_incident_statuses_item( - incident_statuses_item_data - ) + for incident_statuses_item_data in _incident_statuses or []: + incident_statuses_item = check_post_mortem_trigger_params_incident_statuses_item( + incident_statuses_item_data + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: + def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: PostMortemTriggerParamsIncidentCondition | Unset + incident_condition: Unset | PostMortemTriggerParamsIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_post_mortem_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: PostMortemTriggerParamsIncidentConditionVisibility | Unset + incident_condition_visibility: Unset | PostMortemTriggerParamsIncidentConditionVisibility if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -471,14 +468,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: PostMortemTriggerParamsIncidentConditionKind | Unset + incident_condition_kind: Unset | PostMortemTriggerParamsIncidentConditionKind if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_post_mortem_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: PostMortemTriggerParamsIncidentConditionStatus | Unset + incident_condition_status: Unset | PostMortemTriggerParamsIncidentConditionStatus if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -487,7 +484,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: PostMortemTriggerParamsIncidentConditionSubStatus | Unset + incident_condition_sub_status: Unset | PostMortemTriggerParamsIncidentConditionSubStatus if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -496,7 +493,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: PostMortemTriggerParamsIncidentConditionEnvironment | Unset + incident_condition_environment: Unset | PostMortemTriggerParamsIncidentConditionEnvironment if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -505,7 +502,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: PostMortemTriggerParamsIncidentConditionSeverity | Unset + incident_condition_severity: Unset | PostMortemTriggerParamsIncidentConditionSeverity if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -514,7 +511,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: PostMortemTriggerParamsIncidentConditionIncidentType | Unset + incident_condition_incident_type: Unset | PostMortemTriggerParamsIncidentConditionIncidentType if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -523,7 +520,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset + incident_condition_incident_roles: Unset | PostMortemTriggerParamsIncidentConditionIncidentRoles if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -532,7 +529,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: PostMortemTriggerParamsIncidentConditionService | Unset + incident_condition_service: Unset | PostMortemTriggerParamsIncidentConditionService if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -541,7 +538,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: PostMortemTriggerParamsIncidentConditionFunctionality | Unset + incident_condition_functionality: Unset | PostMortemTriggerParamsIncidentConditionFunctionality if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -550,7 +547,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: PostMortemTriggerParamsIncidentConditionGroup | Unset + incident_condition_group: Unset | PostMortemTriggerParamsIncidentConditionGroup if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -559,7 +556,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: PostMortemTriggerParamsIncidentConditionCause | Unset + incident_condition_cause: Unset | PostMortemTriggerParamsIncidentConditionCause if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: @@ -568,7 +565,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: PostMortemTriggerParamsIncidentConditionLabel | Unset + incident_condition_label: Unset | PostMortemTriggerParamsIncidentConditionLabel if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -581,7 +578,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_post_mortem_condition_cause = d.pop("incident_post_mortem_condition_cause", UNSET) - incident_post_mortem_condition_cause: PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset + incident_post_mortem_condition_cause: Unset | PostMortemTriggerParamsIncidentPostMortemConditionCause if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -592,7 +589,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: PostMortemTriggerParamsIncidentConditionSummary | Unset + incident_condition_summary: Unset | PostMortemTriggerParamsIncidentConditionSummary if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -601,7 +598,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: PostMortemTriggerParamsIncidentConditionStartedAt | Unset + incident_condition_started_at: Unset | PostMortemTriggerParamsIncidentConditionStartedAt if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -610,7 +607,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: PostMortemTriggerParamsIncidentConditionDetectedAt | Unset + incident_condition_detected_at: Unset | PostMortemTriggerParamsIncidentConditionDetectedAt if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -619,7 +616,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset + incident_condition_acknowledged_at: Unset | PostMortemTriggerParamsIncidentConditionAcknowledgedAt if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -628,7 +625,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset + incident_condition_mitigated_at: Unset | PostMortemTriggerParamsIncidentConditionMitigatedAt if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -637,7 +634,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: PostMortemTriggerParamsIncidentConditionResolvedAt | Unset + incident_condition_resolved_at: Unset | PostMortemTriggerParamsIncidentConditionResolvedAt if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -646,7 +643,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: PostMortemTriggerParamsIncidentConditionalInactivity | Unset + incident_conditional_inactivity: Unset | PostMortemTriggerParamsIncidentConditionalInactivity if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -655,7 +652,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_post_mortem_condition = d.pop("incident_post_mortem_condition", UNSET) - incident_post_mortem_condition: PostMortemTriggerParamsIncidentPostMortemCondition | Unset + incident_post_mortem_condition: Unset | PostMortemTriggerParamsIncidentPostMortemCondition if isinstance(_incident_post_mortem_condition, Unset): incident_post_mortem_condition = UNSET else: @@ -664,7 +661,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_post_mortem_condition_status = d.pop("incident_post_mortem_condition_status", UNSET) - incident_post_mortem_condition_status: PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset + incident_post_mortem_condition_status: Unset | PostMortemTriggerParamsIncidentPostMortemConditionStatus if isinstance(_incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = UNSET else: @@ -674,18 +671,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) ) + incident_post_mortem_statuses = [] _incident_post_mortem_statuses = d.pop("incident_post_mortem_statuses", UNSET) - incident_post_mortem_statuses: list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset = UNSET - if _incident_post_mortem_statuses is not UNSET: - incident_post_mortem_statuses = [] - for incident_post_mortem_statuses_item_data in _incident_post_mortem_statuses: - incident_post_mortem_statuses_item = ( - check_post_mortem_trigger_params_incident_post_mortem_statuses_item( - incident_post_mortem_statuses_item_data - ) - ) + for incident_post_mortem_statuses_item_data in _incident_post_mortem_statuses or []: + incident_post_mortem_statuses_item = check_post_mortem_trigger_params_incident_post_mortem_statuses_item( + incident_post_mortem_statuses_item_data + ) - incident_post_mortem_statuses.append(incident_post_mortem_statuses_item) + incident_post_mortem_statuses.append(incident_post_mortem_statuses_item) post_mortem_trigger_params = cls( trigger_type=trigger_type, diff --git a/rootly_sdk/models/print_task_params.py b/rootly_sdk/models/print_task_params.py index caf8f707..c781290e 100644 --- a/rootly_sdk/models/print_task_params.py +++ b/rootly_sdk/models/print_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,17 +15,17 @@ class PrintTaskParams: """ Attributes: message (str): The message to print - task_type (PrintTaskParamsTaskType | Unset): + task_type (Union[Unset, PrintTaskParamsTaskType]): """ message: str - task_type: PrintTaskParamsTaskType | Unset = UNSET + task_type: Unset | PrintTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -49,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: PrintTaskParamsTaskType | Unset + task_type: Unset | PrintTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/publish_incident_task_params.py b/rootly_sdk/models/publish_incident_task_params.py index 62a95e4c..3a5074ae 100644 --- a/rootly_sdk/models/publish_incident_task_params.py +++ b/rootly_sdk/models/publish_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,31 +30,34 @@ class PublishIncidentTaskParams: public_title (str): status (PublishIncidentTaskParamsStatus): Default: 'resolved'. status_page_id (str): - task_type (PublishIncidentTaskParamsTaskType | Unset): - event (str | Unset): Incident event description - notify_subscribers (bool | Unset): When true notifies subscribers of the status page by email/text Default: - False. - should_tweet (bool | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update Default: - False. - status_page_template (PublishIncidentTaskParamsStatusPageTemplate | Unset): - integration_payload (None | str | Unset): Additional API Payload you can pass to statuspage.io for example. Can - contain liquid markup and need to be valid JSON + task_type (Union[Unset, PublishIncidentTaskParamsTaskType]): + event (Union[Unset, str]): Incident event description + notify_subscribers (Union[Unset, bool]): When true notifies subscribers of the status page by email/text + Default: False. + should_tweet (Union[Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your update + Default: False. + status_page_template (Union[Unset, PublishIncidentTaskParamsStatusPageTemplate]): + status_page_ids (Union[Unset, list[str]]): Publishes the update to every listed status page (requires the + status-page-v3-limited-bulk-publish feature). When set, it takes precedence over status_page_id and the first + entry becomes status_page_id. + integration_payload (Union[None, Unset, str]): Additional API Payload you can pass to statuspage.io for example. + Can contain liquid markup and need to be valid JSON """ - incident: PublishIncidentTaskParamsIncident + incident: "PublishIncidentTaskParamsIncident" public_title: str status_page_id: str status: PublishIncidentTaskParamsStatus = "resolved" - task_type: PublishIncidentTaskParamsTaskType | Unset = UNSET - event: str | Unset = UNSET - notify_subscribers: bool | Unset = False - should_tweet: bool | Unset = False - status_page_template: PublishIncidentTaskParamsStatusPageTemplate | Unset = UNSET - integration_payload: None | str | Unset = UNSET + task_type: Unset | PublishIncidentTaskParamsTaskType = UNSET + event: Unset | str = UNSET + notify_subscribers: Unset | bool = False + should_tweet: Unset | bool = False + status_page_template: Union[Unset, "PublishIncidentTaskParamsStatusPageTemplate"] = UNSET + status_page_ids: Unset | list[str] = UNSET + integration_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident = self.incident.to_dict() public_title = self.public_title @@ -65,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -75,11 +76,15 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet - status_page_template: dict[str, Any] | Unset = UNSET + status_page_template: Unset | dict[str, Any] = UNSET if not isinstance(self.status_page_template, Unset): status_page_template = self.status_page_template.to_dict() - integration_payload: None | str | Unset + status_page_ids: Unset | list[str] = UNSET + if not isinstance(self.status_page_ids, Unset): + status_page_ids = self.status_page_ids + + integration_payload: None | Unset | str if isinstance(self.integration_payload, Unset): integration_payload = UNSET else: @@ -105,6 +110,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["should_tweet"] = should_tweet if status_page_template is not UNSET: field_dict["status_page_template"] = status_page_template + if status_page_ids is not UNSET: + field_dict["status_page_ids"] = status_page_ids if integration_payload is not UNSET: field_dict["integration_payload"] = integration_payload @@ -127,7 +134,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id") _task_type = d.pop("task_type", UNSET) - task_type: PublishIncidentTaskParamsTaskType | Unset + task_type: Unset | PublishIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -140,18 +147,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: should_tweet = d.pop("should_tweet", UNSET) _status_page_template = d.pop("status_page_template", UNSET) - status_page_template: PublishIncidentTaskParamsStatusPageTemplate | Unset + status_page_template: Unset | PublishIncidentTaskParamsStatusPageTemplate if isinstance(_status_page_template, Unset): status_page_template = UNSET else: status_page_template = PublishIncidentTaskParamsStatusPageTemplate.from_dict(_status_page_template) - def _parse_integration_payload(data: object) -> None | str | Unset: + status_page_ids = cast(list[str], d.pop("status_page_ids", UNSET)) + + def _parse_integration_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) integration_payload = _parse_integration_payload(d.pop("integration_payload", UNSET)) @@ -165,6 +174,7 @@ def _parse_integration_payload(data: object) -> None | str | Unset: notify_subscribers=notify_subscribers, should_tweet=should_tweet, status_page_template=status_page_template, + status_page_ids=status_page_ids, integration_payload=integration_payload, ) diff --git a/rootly_sdk/models/publish_incident_task_params_incident.py b/rootly_sdk/models/publish_incident_task_params_incident.py index 2b20e7ca..01e13aec 100644 --- a/rootly_sdk/models/publish_incident_task_params_incident.py +++ b/rootly_sdk/models/publish_incident_task_params_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PublishIncidentTaskParamsIncident: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/publish_incident_task_params_status_page_template.py b/rootly_sdk/models/publish_incident_task_params_status_page_template.py index 05bd965f..fb64cc16 100644 --- a/rootly_sdk/models/publish_incident_task_params_status_page_template.py +++ b/rootly_sdk/models/publish_incident_task_params_status_page_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class PublishIncidentTaskParamsStatusPageTemplate: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/pulse.py b/rootly_sdk/models/pulse.py index d5f9b38b..f2638491 100644 --- a/rootly_sdk/models/pulse.py +++ b/rootly_sdk/models/pulse.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,25 +24,25 @@ class Pulse: summary (str): The summary of the pulse created_at (str): Date of creation updated_at (str): Date of last update - source (None | str | Unset): The source of the pulse (eg: k8s) - services (list[Service] | Unset): Services attached to the pulse - environments (list[Environment] | Unset): Environments attached to the pulse - external_url (None | str | Unset): The external url of the pulse - labels (list[None | PulseLabelsItemType0] | Unset): - refs (list[None | PulseRefsItemType0] | Unset): - data (None | PulseDataType0 | Unset): Additional data + source (Union[None, Unset, str]): The source of the pulse (eg: k8s) + services (Union[Unset, list['Service']]): Services attached to the pulse + environments (Union[Unset, list['Environment']]): Environments attached to the pulse + external_url (Union[None, Unset, str]): The external url of the pulse + labels (Union[Unset, list[Union['PulseLabelsItemType0', None]]]): + refs (Union[Unset, list[Union['PulseRefsItemType0', None]]]): + data (Union['PulseDataType0', None, Unset]): Additional data """ summary: str created_at: str updated_at: str - source: None | str | Unset = UNSET - services: list[Service] | Unset = UNSET - environments: list[Environment] | Unset = UNSET - external_url: None | str | Unset = UNSET - labels: list[None | PulseLabelsItemType0] | Unset = UNSET - refs: list[None | PulseRefsItemType0] | Unset = UNSET - data: None | PulseDataType0 | Unset = UNSET + source: None | Unset | str = UNSET + services: Unset | list["Service"] = UNSET + environments: Unset | list["Environment"] = UNSET + external_url: None | Unset | str = UNSET + labels: Unset | list[Union["PulseLabelsItemType0", None]] = UNSET + refs: Unset | list[Union["PulseRefsItemType0", None]] = UNSET + data: Union["PulseDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,55 +56,55 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - source: None | str | Unset + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: source = self.source - services: list[dict[str, Any]] | Unset = UNSET + services: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.services, Unset): services = [] for services_item_data in self.services: services_item = services_item_data.to_dict() services.append(services_item) - environments: list[dict[str, Any]] | Unset = UNSET + environments: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.environments, Unset): environments = [] for environments_item_data in self.environments: environments_item = environments_item_data.to_dict() environments.append(environments_item) - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: None | dict[str, Any] if isinstance(labels_item_data, PulseLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: list[dict[str, Any] | None] | Unset = UNSET + refs: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: dict[str, Any] | None + refs_item: None | dict[str, Any] if isinstance(refs_item_data, PulseRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, PulseDataType0): @@ -155,89 +153,81 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) + services = [] _services = d.pop("services", UNSET) - services: list[Service] | Unset = UNSET - if _services is not UNSET: - services = [] - for services_item_data in _services: - services_item = Service.from_dict(services_item_data) + for services_item_data in _services or []: + services_item = Service.from_dict(services_item_data) - services.append(services_item) + services.append(services_item) + environments = [] _environments = d.pop("environments", UNSET) - environments: list[Environment] | Unset = UNSET - if _environments is not UNSET: - environments = [] - for environments_item_data in _environments: - environments_item = Environment.from_dict(environments_item_data) + for environments_item_data in _environments or []: + environments_item = Environment.from_dict(environments_item_data) - environments.append(environments_item) + environments.append(environments_item) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[None | PulseLabelsItemType0] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> None | PulseLabelsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = PulseLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["PulseLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = PulseLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PulseLabelsItemType0, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["PulseLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) + refs = [] _refs = d.pop("refs", UNSET) - refs: list[None | PulseRefsItemType0] | Unset = UNSET - if _refs is not UNSET: - refs = [] - for refs_item_data in _refs: + for refs_item_data in _refs or []: - def _parse_refs_item(data: object) -> None | PulseRefsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - refs_item_type_0 = PulseRefsItemType0.from_dict(data) + def _parse_refs_item(data: object) -> Union["PulseRefsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + refs_item_type_0 = PulseRefsItemType0.from_dict(data) - return refs_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PulseRefsItemType0, data) + return refs_item_type_0 + except: # noqa: E722 + pass + return cast(Union["PulseRefsItemType0", None], data) - refs_item = _parse_refs_item(refs_item_data) + refs_item = _parse_refs_item(refs_item_data) - refs.append(refs_item) + refs.append(refs_item) - def _parse_data(data: object) -> None | PulseDataType0 | Unset: + def _parse_data(data: object) -> Union["PulseDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -248,9 +238,9 @@ def _parse_data(data: object) -> None | PulseDataType0 | Unset: data_type_0 = PulseDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | PulseDataType0 | Unset, data) + return cast(Union["PulseDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/pulse_data_type_0.py b/rootly_sdk/models/pulse_data_type_0.py index afcb2bbc..341057a8 100644 --- a/rootly_sdk/models/pulse_data_type_0.py +++ b/rootly_sdk/models/pulse_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class PulseDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/pulse_labels_item_type_0.py b/rootly_sdk/models/pulse_labels_item_type_0.py index ff7e4e81..6636720d 100644 --- a/rootly_sdk/models/pulse_labels_item_type_0.py +++ b/rootly_sdk/models/pulse_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/pulse_list.py b/rootly_sdk/models/pulse_list.py index 39a986bc..c83b7397 100644 --- a/rootly_sdk/models/pulse_list.py +++ b/rootly_sdk/models/pulse_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class PulseList: """ Attributes: - data (list[PulseListDataItem]): + data (list['PulseListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PulseListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PulseListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) pulse_list = cls( data=data, diff --git a/rootly_sdk/models/pulse_list_data_item.py b/rootly_sdk/models/pulse_list_data_item.py index 2b770f8e..50c07fba 100644 --- a/rootly_sdk/models/pulse_list_data_item.py +++ b/rootly_sdk/models/pulse_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PulseListDataItem: id: str type_: PulseListDataItemType - attributes: Pulse + attributes: "Pulse" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/pulse_refs_item_type_0.py b/rootly_sdk/models/pulse_refs_item_type_0.py index c65c8b53..7a101f7f 100644 --- a/rootly_sdk/models/pulse_refs_item_type_0.py +++ b/rootly_sdk/models/pulse_refs_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/pulse_response.py b/rootly_sdk/models/pulse_response.py index 6268b8b5..d5b9e15c 100644 --- a/rootly_sdk/models/pulse_response.py +++ b/rootly_sdk/models/pulse_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class PulseResponse: """ Attributes: data (PulseResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PulseResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PulseResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PulseResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) pulse_response = cls( data=data, diff --git a/rootly_sdk/models/pulse_response_data.py b/rootly_sdk/models/pulse_response_data.py index 6efc7c8f..7b7d58cc 100644 --- a/rootly_sdk/models/pulse_response_data.py +++ b/rootly_sdk/models/pulse_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PulseResponseData: id: str type_: PulseResponseDataType - attributes: Pulse + attributes: "Pulse" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/pulse_trigger_params.py b/rootly_sdk/models/pulse_trigger_params.py index 138e75d9..e96eb5f8 100644 --- a/rootly_sdk/models/pulse_trigger_params.py +++ b/rootly_sdk/models/pulse_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -40,80 +38,80 @@ class PulseTriggerParams: """ Attributes: trigger_type (PulseTriggerParamsTriggerType): - triggers (list[PulseTriggerParamsTriggersItem] | Unset): - pulse_condition (PulseTriggerParamsPulseCondition | Unset): - pulse_condition_source (PulseTriggerParamsPulseConditionSource | Unset): Default: 'ANY'. - pulse_condition_source_use_regexp (bool | Unset): Default: False. - pulse_sources (list[str] | Unset): - pulse_condition_label (PulseTriggerParamsPulseConditionLabel | Unset): Default: 'ANY'. - pulse_condition_label_use_regexp (bool | Unset): Default: False. - pulse_labels (list[str] | Unset): - pulse_condition_payload (PulseTriggerParamsPulseConditionPayload | Unset): Default: 'ANY'. - pulse_condition_payload_use_regexp (bool | Unset): Default: False. - pulse_payload (list[str] | Unset): - pulse_query_payload (None | str | Unset): You can use jsonpath syntax. eg: $.incident.teams[*] + triggers (Union[Unset, list[PulseTriggerParamsTriggersItem]]): + pulse_condition (Union[Unset, PulseTriggerParamsPulseCondition]): + pulse_condition_source (Union[Unset, PulseTriggerParamsPulseConditionSource]): Default: 'ANY'. + pulse_condition_source_use_regexp (Union[Unset, bool]): Default: False. + pulse_sources (Union[Unset, list[str]]): + pulse_condition_label (Union[Unset, PulseTriggerParamsPulseConditionLabel]): Default: 'ANY'. + pulse_condition_label_use_regexp (Union[Unset, bool]): Default: False. + pulse_labels (Union[Unset, list[str]]): + pulse_condition_payload (Union[Unset, PulseTriggerParamsPulseConditionPayload]): Default: 'ANY'. + pulse_condition_payload_use_regexp (Union[Unset, bool]): Default: False. + pulse_payload (Union[Unset, list[str]]): + pulse_query_payload (Union[None, Unset, str]): You can use jsonpath syntax. eg: $.incident.teams[*] """ trigger_type: PulseTriggerParamsTriggerType - triggers: list[PulseTriggerParamsTriggersItem] | Unset = UNSET - pulse_condition: PulseTriggerParamsPulseCondition | Unset = UNSET - pulse_condition_source: PulseTriggerParamsPulseConditionSource | Unset = "ANY" - pulse_condition_source_use_regexp: bool | Unset = False - pulse_sources: list[str] | Unset = UNSET - pulse_condition_label: PulseTriggerParamsPulseConditionLabel | Unset = "ANY" - pulse_condition_label_use_regexp: bool | Unset = False - pulse_labels: list[str] | Unset = UNSET - pulse_condition_payload: PulseTriggerParamsPulseConditionPayload | Unset = "ANY" - pulse_condition_payload_use_regexp: bool | Unset = False - pulse_payload: list[str] | Unset = UNSET - pulse_query_payload: None | str | Unset = UNSET + triggers: Unset | list[PulseTriggerParamsTriggersItem] = UNSET + pulse_condition: Unset | PulseTriggerParamsPulseCondition = UNSET + pulse_condition_source: Unset | PulseTriggerParamsPulseConditionSource = "ANY" + pulse_condition_source_use_regexp: Unset | bool = False + pulse_sources: Unset | list[str] = UNSET + pulse_condition_label: Unset | PulseTriggerParamsPulseConditionLabel = "ANY" + pulse_condition_label_use_regexp: Unset | bool = False + pulse_labels: Unset | list[str] = UNSET + pulse_condition_payload: Unset | PulseTriggerParamsPulseConditionPayload = "ANY" + pulse_condition_payload_use_regexp: Unset | bool = False + pulse_payload: Unset | list[str] = UNSET + pulse_query_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: triggers_item: str = triggers_item_data triggers.append(triggers_item) - pulse_condition: str | Unset = UNSET + pulse_condition: Unset | str = UNSET if not isinstance(self.pulse_condition, Unset): pulse_condition = self.pulse_condition - pulse_condition_source: str | Unset = UNSET + pulse_condition_source: Unset | str = UNSET if not isinstance(self.pulse_condition_source, Unset): pulse_condition_source = self.pulse_condition_source pulse_condition_source_use_regexp = self.pulse_condition_source_use_regexp - pulse_sources: list[str] | Unset = UNSET + pulse_sources: Unset | list[str] = UNSET if not isinstance(self.pulse_sources, Unset): pulse_sources = self.pulse_sources - pulse_condition_label: str | Unset = UNSET + pulse_condition_label: Unset | str = UNSET if not isinstance(self.pulse_condition_label, Unset): pulse_condition_label = self.pulse_condition_label pulse_condition_label_use_regexp = self.pulse_condition_label_use_regexp - pulse_labels: list[str] | Unset = UNSET + pulse_labels: Unset | list[str] = UNSET if not isinstance(self.pulse_labels, Unset): pulse_labels = self.pulse_labels - pulse_condition_payload: str | Unset = UNSET + pulse_condition_payload: Unset | str = UNSET if not isinstance(self.pulse_condition_payload, Unset): pulse_condition_payload = self.pulse_condition_payload pulse_condition_payload_use_regexp = self.pulse_condition_payload_use_regexp - pulse_payload: list[str] | Unset = UNSET + pulse_payload: Unset | list[str] = UNSET if not isinstance(self.pulse_payload, Unset): pulse_payload = self.pulse_payload - pulse_query_payload: None | str | Unset + pulse_query_payload: None | Unset | str if isinstance(self.pulse_query_payload, Unset): pulse_query_payload = UNSET else: @@ -158,24 +156,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) trigger_type = check_pulse_trigger_params_trigger_type(d.pop("trigger_type")) + triggers = [] _triggers = d.pop("triggers", UNSET) - triggers: list[PulseTriggerParamsTriggersItem] | Unset = UNSET - if _triggers is not UNSET: - triggers = [] - for triggers_item_data in _triggers: - triggers_item = check_pulse_trigger_params_triggers_item(triggers_item_data) + for triggers_item_data in _triggers or []: + triggers_item = check_pulse_trigger_params_triggers_item(triggers_item_data) - triggers.append(triggers_item) + triggers.append(triggers_item) _pulse_condition = d.pop("pulse_condition", UNSET) - pulse_condition: PulseTriggerParamsPulseCondition | Unset + pulse_condition: Unset | PulseTriggerParamsPulseCondition if isinstance(_pulse_condition, Unset): pulse_condition = UNSET else: pulse_condition = check_pulse_trigger_params_pulse_condition(_pulse_condition) _pulse_condition_source = d.pop("pulse_condition_source", UNSET) - pulse_condition_source: PulseTriggerParamsPulseConditionSource | Unset + pulse_condition_source: Unset | PulseTriggerParamsPulseConditionSource if isinstance(_pulse_condition_source, Unset): pulse_condition_source = UNSET else: @@ -186,7 +182,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_sources = cast(list[str], d.pop("pulse_sources", UNSET)) _pulse_condition_label = d.pop("pulse_condition_label", UNSET) - pulse_condition_label: PulseTriggerParamsPulseConditionLabel | Unset + pulse_condition_label: Unset | PulseTriggerParamsPulseConditionLabel if isinstance(_pulse_condition_label, Unset): pulse_condition_label = UNSET else: @@ -197,7 +193,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_labels = cast(list[str], d.pop("pulse_labels", UNSET)) _pulse_condition_payload = d.pop("pulse_condition_payload", UNSET) - pulse_condition_payload: PulseTriggerParamsPulseConditionPayload | Unset + pulse_condition_payload: Unset | PulseTriggerParamsPulseConditionPayload if isinstance(_pulse_condition_payload, Unset): pulse_condition_payload = UNSET else: @@ -207,12 +203,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_payload = cast(list[str], d.pop("pulse_payload", UNSET)) - def _parse_pulse_query_payload(data: object) -> None | str | Unset: + def _parse_pulse_query_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pulse_query_payload = _parse_pulse_query_payload(d.pop("pulse_query_payload", UNSET)) diff --git a/rootly_sdk/models/receipt.py b/rootly_sdk/models/receipt.py index 1e6442b7..56511e01 100644 --- a/rootly_sdk/models/receipt.py +++ b/rootly_sdk/models/receipt.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -18,21 +16,21 @@ class Receipt: """ Attributes: state (ReceiptState): Delivery state of the receipt. - reason (ReceiptReason | Unset): Reason a receipt failed. Present when state is failed. - resource_type (str | Unset): Type of the referenced resource (present when set). - resource_id (str | Unset): ID of the referenced resource (present when set). + reason (Union[Unset, ReceiptReason]): Reason a receipt failed. Present when state is failed. + resource_type (Union[Unset, str]): Type of the referenced resource (present when set). + resource_id (Union[Unset, str]): ID of the referenced resource (present when set). """ state: ReceiptState - reason: ReceiptReason | Unset = UNSET - resource_type: str | Unset = UNSET - resource_id: str | Unset = UNSET + reason: Unset | ReceiptReason = UNSET + resource_type: Unset | str = UNSET + resource_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: state: str = self.state - reason: str | Unset = UNSET + reason: Unset | str = UNSET if not isinstance(self.reason, Unset): reason = self.reason @@ -62,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = check_receipt_state(d.pop("state")) _reason = d.pop("reason", UNSET) - reason: ReceiptReason | Unset + reason: Unset | ReceiptReason if isinstance(_reason, Unset): reason = UNSET else: diff --git a/rootly_sdk/models/redis_client_task_params.py b/rootly_sdk/models/redis_client_task_params.py index 4d4b9aab..6aa2959c 100644 --- a/rootly_sdk/models/redis_client_task_params.py +++ b/rootly_sdk/models/redis_client_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,29 +25,28 @@ class RedisClientTaskParams: Attributes: url (str): Example: redis://redis-12345.c1.us-east-1-2.ec2.cloud.redislabs.com:12345. commands (str): - task_type (RedisClientTaskParamsTaskType | Unset): - event_url (str | Unset): - event_message (str | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[RedisClientTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, RedisClientTaskParamsTaskType]): + event_url (Union[Unset, str]): + event_message (Union[Unset, str]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['RedisClientTaskParamsPostToSlackChannelsItem']]): """ url: str commands: str - task_type: RedisClientTaskParamsTaskType | Unset = UNSET - event_url: str | Unset = UNSET - event_message: str | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[RedisClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | RedisClientTaskParamsTaskType = UNSET + event_url: Unset | str = UNSET + event_message: Unset | str = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["RedisClientTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - url = self.url commands = self.commands - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -99,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: commands = d.pop("commands") _task_type = d.pop("task_type", UNSET) - task_type: RedisClientTaskParamsTaskType | Unset + task_type: Unset | RedisClientTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -111,16 +108,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[RedisClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = RedisClientTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = RedisClientTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) redis_client_task_params = cls( url=url, diff --git a/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py index f9bb82cb..43f76fd7 100644 --- a/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class RedisClientTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/remove_google_docs_permissions_task_params.py b/rootly_sdk/models/remove_google_docs_permissions_task_params.py index 4caa857f..6b299669 100644 --- a/rootly_sdk/models/remove_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/remove_google_docs_permissions_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -26,13 +24,13 @@ class RemoveGoogleDocsPermissionsTaskParams: file_id (str): The Google Doc file ID attribute_to_query_by (RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy): Default: 'email_address'. value (str): - task_type (RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset): + task_type (Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType]): """ file_id: str value: str attribute_to_query_by: RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy = "email_address" - task_type: RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset = UNSET + task_type: Unset | RemoveGoogleDocsPermissionsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -72,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value = d.pop("value") _task_type = d.pop("task_type", UNSET) - task_type: RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset + task_type: Unset | RemoveGoogleDocsPermissionsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/remove_subscribers.py b/rootly_sdk/models/remove_subscribers.py index 84417031..39d25586 100644 --- a/rootly_sdk/models/remove_subscribers.py +++ b/rootly_sdk/models/remove_subscribers.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class RemoveSubscribers: data (RemoveSubscribersData): """ - data: RemoveSubscribersData + data: "RemoveSubscribersData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/remove_subscribers_data.py b/rootly_sdk/models/remove_subscribers_data.py index 0b101a4c..5f04e403 100644 --- a/rootly_sdk/models/remove_subscribers_data.py +++ b/rootly_sdk/models/remove_subscribers_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class RemoveSubscribersData: """ type_: RemoveSubscribersDataType - attributes: RemoveSubscribersDataAttributes + attributes: "RemoveSubscribersDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/remove_subscribers_data_attributes.py b/rootly_sdk/models/remove_subscribers_data_attributes.py index a2b72357..c8933597 100644 --- a/rootly_sdk/models/remove_subscribers_data_attributes.py +++ b/rootly_sdk/models/remove_subscribers_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,17 +12,17 @@ class RemoveSubscribersDataAttributes: """ Attributes: - user_ids (list[str] | None | Unset): IDs of users you wish to remove from the list of subscribers for this + user_ids (Union[None, Unset, list[str]]): IDs of users you wish to remove from the list of subscribers for this incident - remove_users_with_no_private_incident_access (bool | None | Unset): Users without read permissions for private - incidents will be removed from the subscriber list of this incident Default: False. + remove_users_with_no_private_incident_access (Union[None, Unset, bool]): Users without read permissions for + private incidents will be removed from the subscriber list of this incident Default: False. """ - user_ids: list[str] | None | Unset = UNSET - remove_users_with_no_private_incident_access: bool | None | Unset = False + user_ids: None | Unset | list[str] = UNSET + remove_users_with_no_private_incident_access: None | Unset | bool = False def to_dict(self) -> dict[str, Any]: - user_ids: list[str] | None | Unset + user_ids: None | Unset | list[str] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -33,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: bool | None | Unset + remove_users_with_no_private_incident_access: None | Unset | bool if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -53,7 +51,7 @@ 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_user_ids(data: object) -> list[str] | None | Unset: + def _parse_user_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -64,18 +62,18 @@ def _parse_user_ids(data: object) -> list[str] | None | Unset: user_ids_type_0 = cast(list[str], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> bool | None | Unset: + def _parse_remove_users_with_no_private_incident_access(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) remove_users_with_no_private_incident_access = _parse_remove_users_with_no_private_incident_access( d.pop("remove_users_with_no_private_incident_access", UNSET) diff --git a/rootly_sdk/models/rename_google_chat_space_task_params.py b/rootly_sdk/models/rename_google_chat_space_task_params.py index d1b918ec..7d91f3e8 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class RenameGoogleChatSpaceTaskParams: Attributes: space (RenameGoogleChatSpaceTaskParamsSpace): title (str): - task_type (RenameGoogleChatSpaceTaskParamsTaskType | Unset): + task_type (Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType]): """ - space: RenameGoogleChatSpaceTaskParamsSpace + space: "RenameGoogleChatSpaceTaskParamsSpace" title: str - task_type: RenameGoogleChatSpaceTaskParamsTaskType | Unset = UNSET + task_type: Unset | RenameGoogleChatSpaceTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: RenameGoogleChatSpaceTaskParamsTaskType | Unset + task_type: Unset | RenameGoogleChatSpaceTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_google_chat_space_task_params_space.py b/rootly_sdk/models/rename_google_chat_space_task_params_space.py index 5b28cfb2..d121c0ac 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params_space.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params_space.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class RenameGoogleChatSpaceTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py index c11439a6..4e0c3dfe 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,24 +25,23 @@ class RenameMicrosoftTeamsChannelTaskParams: team (RenameMicrosoftTeamsChannelTaskParamsTeam): channel (RenameMicrosoftTeamsChannelTaskParamsChannel): title (str): - task_type (RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset): + task_type (Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType]): """ - team: RenameMicrosoftTeamsChannelTaskParamsTeam - channel: RenameMicrosoftTeamsChannelTaskParamsChannel + team: "RenameMicrosoftTeamsChannelTaskParamsTeam" + channel: "RenameMicrosoftTeamsChannelTaskParamsChannel" title: str - task_type: RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET + task_type: Unset | RenameMicrosoftTeamsChannelTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() channel = self.channel.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -77,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset + task_type: Unset | RenameMicrosoftTeamsChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py index adc80c16..40a6795c 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class RenameMicrosoftTeamsChannelTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py index 45eda40c..40409c1b 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class RenameMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_slack_channel_task_params.py b/rootly_sdk/models/rename_slack_channel_task_params.py index 1f7b3787..47cecb7e 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params.py +++ b/rootly_sdk/models/rename_slack_channel_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class RenameSlackChannelTaskParams: Attributes: channel (RenameSlackChannelTaskParamsChannel): title (str): - task_type (RenameSlackChannelTaskParamsTaskType | Unset): + task_type (Union[Unset, RenameSlackChannelTaskParamsTaskType]): """ - channel: RenameSlackChannelTaskParamsChannel + channel: "RenameSlackChannelTaskParamsChannel" title: str - task_type: RenameSlackChannelTaskParamsTaskType | Unset = UNSET + task_type: Unset | RenameSlackChannelTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: RenameSlackChannelTaskParamsTaskType | Unset + task_type: Unset | RenameSlackChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_slack_channel_task_params_channel.py b/rootly_sdk/models/rename_slack_channel_task_params_channel.py index e2cc7d5f..4d14a018 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_slack_channel_task_params_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class RenameSlackChannelTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/resolve_alert.py b/rootly_sdk/models/resolve_alert.py index 5ceee88f..d14428fe 100644 --- a/rootly_sdk/models/resolve_alert.py +++ b/rootly_sdk/models/resolve_alert.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class ResolveAlert: """ Attributes: - data (ResolveAlertData | Unset): + data (Union[Unset, ResolveAlertData]): """ - data: ResolveAlertData | Unset = UNSET + data: Union[Unset, "ResolveAlertData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: ResolveAlertData | Unset + data: Unset | ResolveAlertData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/resolve_alert_data.py b/rootly_sdk/models/resolve_alert_data.py index 52f09fcf..7286461f 100644 --- a/rootly_sdk/models/resolve_alert_data.py +++ b/rootly_sdk/models/resolve_alert_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class ResolveAlertData: """ Attributes: - type_ (ResolveAlertDataType | Unset): - attributes (ResolveAlertDataAttributes | Unset): + type_ (Union[Unset, ResolveAlertDataType]): + attributes (Union[Unset, ResolveAlertDataAttributes]): """ - type_: ResolveAlertDataType | Unset = UNSET - attributes: ResolveAlertDataAttributes | Unset = UNSET + type_: Unset | ResolveAlertDataType = UNSET + attributes: Union[Unset, "ResolveAlertDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: ResolveAlertDataType | Unset + type_: Unset | ResolveAlertDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_resolve_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: ResolveAlertDataAttributes | Unset + attributes: Unset | ResolveAlertDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/resolve_alert_data_attributes.py b/rootly_sdk/models/resolve_alert_data_attributes.py index 145979dc..a074323f 100644 --- a/rootly_sdk/models/resolve_alert_data_attributes.py +++ b/rootly_sdk/models/resolve_alert_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,21 +12,21 @@ class ResolveAlertDataAttributes: """ Attributes: - resolution_message (None | str | Unset): How was the alert resolved? - resolve_related_incidents (bool | None | Unset): Resolve all associated incidents + resolution_message (Union[None, Unset, str]): How was the alert resolved? + resolve_related_incidents (Union[None, Unset, bool]): Resolve all associated incidents """ - resolution_message: None | str | Unset = UNSET - resolve_related_incidents: bool | None | Unset = UNSET + resolution_message: None | Unset | str = UNSET + resolve_related_incidents: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: None | str | Unset + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - resolve_related_incidents: bool | None | Unset + resolve_related_incidents: None | Unset | bool if isinstance(self.resolve_related_incidents, Unset): resolve_related_incidents = UNSET else: @@ -48,21 +46,21 @@ 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_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_resolve_related_incidents(data: object) -> bool | None | Unset: + def _parse_resolve_related_incidents(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) resolve_related_incidents = _parse_resolve_related_incidents(d.pop("resolve_related_incidents", UNSET)) diff --git a/rootly_sdk/models/resolve_incident.py b/rootly_sdk/models/resolve_incident.py index 3b7dca45..dd2a87be 100644 --- a/rootly_sdk/models/resolve_incident.py +++ b/rootly_sdk/models/resolve_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class ResolveIncident: data (ResolveIncidentData): """ - data: ResolveIncidentData + data: "ResolveIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/resolve_incident_data.py b/rootly_sdk/models/resolve_incident_data.py index 2a3d672f..7f814f56 100644 --- a/rootly_sdk/models/resolve_incident_data.py +++ b/rootly_sdk/models/resolve_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class ResolveIncidentData: """ type_: ResolveIncidentDataType - attributes: ResolveIncidentDataAttributes + attributes: "ResolveIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/resolve_incident_data_attributes.py b/rootly_sdk/models/resolve_incident_data_attributes.py index f692c9d9..779a6bc0 100644 --- a/rootly_sdk/models/resolve_incident_data_attributes.py +++ b/rootly_sdk/models/resolve_incident_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,13 +12,13 @@ class ResolveIncidentDataAttributes: """ Attributes: - resolution_message (None | str | Unset): How was the incident resolved? + resolution_message (Union[None, Unset, str]): How was the incident resolved? """ - resolution_message: None | str | Unset = UNSET + resolution_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: None | str | Unset + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: @@ -38,12 +36,12 @@ 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_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) diff --git a/rootly_sdk/models/restart_incident.py b/rootly_sdk/models/restart_incident.py index 491f2a4a..6ad06f78 100644 --- a/rootly_sdk/models/restart_incident.py +++ b/rootly_sdk/models/restart_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class RestartIncident: data (RestartIncidentData): """ - data: RestartIncidentData + data: "RestartIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/restart_incident_data.py b/rootly_sdk/models/restart_incident_data.py index 0be77f7c..ac26db8c 100644 --- a/rootly_sdk/models/restart_incident_data.py +++ b/rootly_sdk/models/restart_incident_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RestartIncidentData: """ Attributes: type_ (RestartIncidentDataType): - attributes (RestartIncidentDataAttributes | Unset): + attributes (Union[Unset, RestartIncidentDataAttributes]): """ type_: RestartIncidentDataType - attributes: RestartIncidentDataAttributes | Unset = UNSET + attributes: Union[Unset, "RestartIncidentDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -56,7 +53,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = check_restart_incident_data_type(d.pop("type")) _attributes = d.pop("attributes", UNSET) - attributes: RestartIncidentDataAttributes | Unset + attributes: Unset | RestartIncidentDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/restart_incident_data_attributes.py b/rootly_sdk/models/restart_incident_data_attributes.py index 3d95b753..17cdc6f5 100644 --- a/rootly_sdk/models/restart_incident_data_attributes.py +++ b/rootly_sdk/models/restart_incident_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -13,7 +11,6 @@ class RestartIncidentDataAttributes: """ """ def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} return field_dict diff --git a/rootly_sdk/models/retrospective_configuration.py b/rootly_sdk/models/retrospective_configuration.py index f2ccd845..3374e771 100644 --- a/rootly_sdk/models/retrospective_configuration.py +++ b/rootly_sdk/models/retrospective_configuration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,28 +17,29 @@ class RetrospectiveConfiguration: """ Attributes: - kind (RetrospectiveConfigurationKind | Unset): The kind of the configuration. - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the retrospective configuration - group_ids (list[str] | None | Unset): The Team IDs to attach to the retrospective configuration - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the retrospective configuration - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + kind (Union[Unset, RetrospectiveConfigurationKind]): The kind of the configuration. + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the retrospective configuration + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the retrospective configuration + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the retrospective + configuration + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - kind: RetrospectiveConfigurationKind | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + kind: Unset | RetrospectiveConfigurationKind = UNSET + severity_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -49,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -58,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -93,13 +92,13 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: RetrospectiveConfigurationKind | Unset + kind: Unset | RetrospectiveConfigurationKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_retrospective_configuration_kind(_kind) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -110,13 +109,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -127,13 +126,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -144,9 +143,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/retrospective_configuration_list.py b/rootly_sdk/models/retrospective_configuration_list.py index 729d9b07..825d65e8 100644 --- a/rootly_sdk/models/retrospective_configuration_list.py +++ b/rootly_sdk/models/retrospective_configuration_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,22 +18,21 @@ class RetrospectiveConfigurationList: """ Attributes: - data (list[RetrospectiveConfigurationListDataItem]): - included (list[JsonapiIncludedResource] | Unset): + data (list['RetrospectiveConfigurationListDataItem']): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveConfigurationListDataItem] - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveConfigurationListDataItem"] + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -67,14 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_configuration_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_configuration_list_data_item.py b/rootly_sdk/models/retrospective_configuration_list_data_item.py index fc365e1b..c3f88c45 100644 --- a/rootly_sdk/models/retrospective_configuration_list_data_item.py +++ b/rootly_sdk/models/retrospective_configuration_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveConfigurationListDataItem: id: str type_: RetrospectiveConfigurationListDataItemType - attributes: RetrospectiveConfiguration + attributes: "RetrospectiveConfiguration" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_configuration_response.py b/rootly_sdk/models/retrospective_configuration_response.py index bd588e56..42219f57 100644 --- a/rootly_sdk/models/retrospective_configuration_response.py +++ b/rootly_sdk/models/retrospective_configuration_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class RetrospectiveConfigurationResponse: """ Attributes: data (RetrospectiveConfigurationResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveConfigurationResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveConfigurationResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveConfigurationResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_configuration_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_configuration_response_data.py b/rootly_sdk/models/retrospective_configuration_response_data.py index 0de247d5..fc3eeec0 100644 --- a/rootly_sdk/models/retrospective_configuration_response_data.py +++ b/rootly_sdk/models/retrospective_configuration_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveConfigurationResponseData: id: str type_: RetrospectiveConfigurationResponseDataType - attributes: RetrospectiveConfiguration + attributes: "RetrospectiveConfiguration" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process.py b/rootly_sdk/models/retrospective_process.py index 05b0511d..7f16675f 100644 --- a/rootly_sdk/models/retrospective_process.py +++ b/rootly_sdk/models/retrospective_process.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,29 +25,29 @@ class RetrospectiveProcess: """ Attributes: - name (str | Unset): The name of the retrospective process - description (None | str | Unset): The description of the retrospective process - is_default (bool | None | Unset): Indicates the default process that Rootly created. This will be used as a + name (Union[Unset, str]): The name of the retrospective process + description (Union[None, Unset, str]): The description of the retrospective process + is_default (Union[None, Unset, bool]): Indicates the default process that Rootly created. This will be used as a fallback if no processes match the incident's conditions. The default process cannot have conditions and cannot be changed. - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - retrospective_process_matching_criteria (RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 | - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 | - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 | Unset): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + retrospective_process_matching_criteria (Union['RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0', + 'RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1', + 'RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2', Unset]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - is_default: bool | None | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - retrospective_process_matching_criteria: ( - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 - | Unset - ) = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + is_default: None | Unset | bool = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET + retrospective_process_matching_criteria: Union[ + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2", + Unset, + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_default: bool | None | Unset + is_default: None | Unset | bool if isinstance(self.is_default, Unset): is_default = UNSET else: @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - retrospective_process_matching_criteria: dict[str, Any] | Unset + retrospective_process_matching_criteria: Unset | dict[str, Any] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -125,21 +123,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_default(data: object) -> bool | None | Unset: + def _parse_is_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) is_default = _parse_is_default(d.pop("is_default", UNSET)) @@ -149,12 +147,12 @@ def _parse_is_default(data: object) -> bool | None | Unset: def _parse_retrospective_process_matching_criteria( data: object, - ) -> ( - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 - | Unset - ): + ) -> Union[ + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -165,7 +163,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -175,7 +173,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/retrospective_process_group.py b/rootly_sdk/models/retrospective_process_group.py index c6214add..bd6c59c6 100644 --- a/rootly_sdk/models/retrospective_process_group.py +++ b/rootly_sdk/models/retrospective_process_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/retrospective_process_group_list.py b/rootly_sdk/models/retrospective_process_group_list.py index c61ee6a9..49950afc 100644 --- a/rootly_sdk/models/retrospective_process_group_list.py +++ b/rootly_sdk/models/retrospective_process_group_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class RetrospectiveProcessGroupList: """ Attributes: - data (list[RetrospectiveProcessGroupListDataItem]): + data (list['RetrospectiveProcessGroupListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveProcessGroupListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveProcessGroupListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_list_data_item.py b/rootly_sdk/models/retrospective_process_group_list_data_item.py index 019912a5..001161de 100644 --- a/rootly_sdk/models/retrospective_process_group_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_group_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupListDataItem: id: str type_: RetrospectiveProcessGroupListDataItemType - attributes: RetrospectiveProcessGroup + attributes: "RetrospectiveProcessGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_group_response.py b/rootly_sdk/models/retrospective_process_group_response.py index 0b29d413..dd1146e7 100644 --- a/rootly_sdk/models/retrospective_process_group_response.py +++ b/rootly_sdk/models/retrospective_process_group_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class RetrospectiveProcessGroupResponse: """ Attributes: data (RetrospectiveProcessGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveProcessGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveProcessGroupResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveProcessGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_response_data.py b/rootly_sdk/models/retrospective_process_group_response_data.py index ea3a5523..728a7c2d 100644 --- a/rootly_sdk/models/retrospective_process_group_response_data.py +++ b/rootly_sdk/models/retrospective_process_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupResponseData: id: str type_: RetrospectiveProcessGroupResponseDataType - attributes: RetrospectiveProcessGroup + attributes: "RetrospectiveProcessGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_group_step.py b/rootly_sdk/models/retrospective_process_group_step.py index d03eeab7..c1e006cd 100644 --- a/rootly_sdk/models/retrospective_process_group_step.py +++ b/rootly_sdk/models/retrospective_process_group_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/retrospective_process_group_step_list.py b/rootly_sdk/models/retrospective_process_group_step_list.py index 555ec62f..da4c38c5 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list.py +++ b/rootly_sdk/models/retrospective_process_group_step_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class RetrospectiveProcessGroupStepList: """ Attributes: - data (list[RetrospectiveProcessGroupStepListDataItem]): + data (list['RetrospectiveProcessGroupStepListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveProcessGroupStepListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveProcessGroupStepListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_step_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_step_list_data_item.py b/rootly_sdk/models/retrospective_process_group_step_list_data_item.py index ebf584e3..760eb209 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_group_step_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupStepListDataItem: id: str type_: RetrospectiveProcessGroupStepListDataItemType - attributes: RetrospectiveProcessGroupStep + attributes: "RetrospectiveProcessGroupStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_group_step_response.py b/rootly_sdk/models/retrospective_process_group_step_response.py index 857efd29..dfcd4544 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response.py +++ b/rootly_sdk/models/retrospective_process_group_step_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class RetrospectiveProcessGroupStepResponse: """ Attributes: data (RetrospectiveProcessGroupStepResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveProcessGroupStepResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveProcessGroupStepResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveProcessGroupStepResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_step_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_step_response_data.py b/rootly_sdk/models/retrospective_process_group_step_response_data.py index 22381d50..9cc6a8ce 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response_data.py +++ b/rootly_sdk/models/retrospective_process_group_step_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupStepResponseData: id: str type_: RetrospectiveProcessGroupStepResponseDataType - attributes: RetrospectiveProcessGroupStep + attributes: "RetrospectiveProcessGroupStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_list.py b/rootly_sdk/models/retrospective_process_list.py index 5afa0273..e8bb5dd4 100644 --- a/rootly_sdk/models/retrospective_process_list.py +++ b/rootly_sdk/models/retrospective_process_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class RetrospectiveProcessList: """ Attributes: - data (list[RetrospectiveProcessListDataItem]): + data (list['RetrospectiveProcessListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveProcessListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveProcessListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_list_data_item.py b/rootly_sdk/models/retrospective_process_list_data_item.py index 2d5f8fd7..0689a834 100644 --- a/rootly_sdk/models/retrospective_process_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessListDataItem: id: str type_: RetrospectiveProcessListDataItemType - attributes: RetrospectiveProcess + attributes: "RetrospectiveProcess" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_response.py b/rootly_sdk/models/retrospective_process_response.py index 0ee37bf2..1a67a415 100644 --- a/rootly_sdk/models/retrospective_process_response.py +++ b/rootly_sdk/models/retrospective_process_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class RetrospectiveProcessResponse: """ Attributes: data (RetrospectiveProcessResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveProcessResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveProcessResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveProcessResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_response_data.py b/rootly_sdk/models/retrospective_process_response_data.py index de0061c5..63527e2b 100644 --- a/rootly_sdk/models/retrospective_process_response_data.py +++ b/rootly_sdk/models/retrospective_process_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessResponseData: id: str type_: RetrospectiveProcessResponseDataType - attributes: RetrospectiveProcess + attributes: "RetrospectiveProcess" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py index dc946fab..c5264651 100644 --- a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py +++ b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py index 07a6c5da..5ad34cd0 100644 --- a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py +++ b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py index 4243efab..a1080736 100644 --- a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py +++ b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/retrospective_step.py b/rootly_sdk/models/retrospective_step.py index 2f2c7941..753bfd37 100644 --- a/rootly_sdk/models/retrospective_step.py +++ b/rootly_sdk/models/retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,25 +17,25 @@ class RetrospectiveStep: title (str): The name of the step created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the step - description (None | str | Unset): The description of the step - incident_role_id (None | str | Unset): Users assigned to the selected incident role will be the default owners - for this step - due_after_days (int | None | Unset): Due date in days - position (int | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + slug (Union[Unset, str]): The slug of the step + description (Union[None, Unset, str]): The description of the step + incident_role_id (Union[None, Unset, str]): Users assigned to the selected incident role will be the default + owners for this step + due_after_days (Union[None, Unset, int]): Due date in days + position (Union[Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ retrospective_process_id: str title: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - incident_role_id: None | str | Unset = UNSET - due_after_days: int | None | Unset = UNSET - position: int | Unset = UNSET - skippable: bool | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + incident_role_id: None | Unset | str = UNSET + due_after_days: None | Unset | int = UNSET + position: Unset | int = UNSET + skippable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,19 +49,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: None | str | Unset + incident_role_id: None | Unset | str if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: int | None | Unset + due_after_days: None | Unset | int if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: @@ -111,30 +109,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> None | str | Unset: + def _parse_incident_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> int | None | Unset: + def _parse_due_after_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) diff --git a/rootly_sdk/models/retrospective_step_list.py b/rootly_sdk/models/retrospective_step_list.py index 217ff699..eff55e6a 100644 --- a/rootly_sdk/models/retrospective_step_list.py +++ b/rootly_sdk/models/retrospective_step_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class RetrospectiveStepList: """ Attributes: - data (list[RetrospectiveStepListDataItem]): + data (list['RetrospectiveStepListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveStepListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveStepListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_step_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_step_list_data_item.py b/rootly_sdk/models/retrospective_step_list_data_item.py index 8b3f2ac7..160e4e85 100644 --- a/rootly_sdk/models/retrospective_step_list_data_item.py +++ b/rootly_sdk/models/retrospective_step_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveStepListDataItem: id: str type_: RetrospectiveStepListDataItemType - attributes: RetrospectiveStep + attributes: "RetrospectiveStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_step_response.py b/rootly_sdk/models/retrospective_step_response.py index be53a1f7..2caec2db 100644 --- a/rootly_sdk/models/retrospective_step_response.py +++ b/rootly_sdk/models/retrospective_step_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class RetrospectiveStepResponse: """ Attributes: data (RetrospectiveStepResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveStepResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveStepResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveStepResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_step_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_step_response_data.py b/rootly_sdk/models/retrospective_step_response_data.py index 61cc6489..28e0e5b4 100644 --- a/rootly_sdk/models/retrospective_step_response_data.py +++ b/rootly_sdk/models/retrospective_step_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveStepResponseData: id: str type_: RetrospectiveStepResponseDataType - attributes: RetrospectiveStep + attributes: "RetrospectiveStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/role.py b/rootly_sdk/models/role.py index 58edeedd..5bcb4b61 100644 --- a/rootly_sdk/models/role.py +++ b/rootly_sdk/models/role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -102,85 +100,85 @@ class Role: name (str): The role name. created_at (str): updated_at (str): - slug (str | Unset): The role slug. - incident_permission_set_id (None | str | Unset): Associated incident permissions set. - is_deletable (bool | Unset): Whether the role can be deleted. - is_editable (bool | Unset): Whether the role can be edited. - alerts_permissions (list[RoleAlertsPermissionsItem] | Unset): - api_keys_permissions (list[RoleApiKeysPermissionsItem] | Unset): - audits_permissions (list[RoleAuditsPermissionsItem] | Unset): - billing_permissions (list[RoleBillingPermissionsItem] | Unset): - environments_permissions (list[RoleEnvironmentsPermissionsItem] | Unset): - form_fields_permissions (list[RoleFormFieldsPermissionsItem] | Unset): - functionalities_permissions (list[RoleFunctionalitiesPermissionsItem] | Unset): - groups_permissions (list[RoleGroupsPermissionsItem] | Unset): - incident_causes_permissions (list[RoleIncidentCausesPermissionsItem] | Unset): - incident_feedbacks_permissions (list[RoleIncidentFeedbacksPermissionsItem] | Unset): - incident_roles_permissions (list[RoleIncidentRolesPermissionsItem] | Unset): - incident_types_permissions (list[RoleIncidentTypesPermissionsItem] | Unset): - incidents_permissions (list[RoleIncidentsPermissionsItem] | Unset): - integrations_permissions (list[RoleIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[RoleInvitationsPermissionsItem] | Unset): - playbooks_permissions (list[RolePlaybooksPermissionsItem] | Unset): - private_incidents_permissions (list[RolePrivateIncidentsPermissionsItem] | Unset): - pulses_permissions (list[RolePulsesPermissionsItem] | Unset): - retrospective_permissions (list[RoleRetrospectivePermissionsItem] | Unset): - roles_permissions (list[RoleRolesPermissionsItem] | Unset): - secrets_permissions (list[RoleSecretsPermissionsItem] | Unset): - services_permissions (list[RoleServicesPermissionsItem] | Unset): - severities_permissions (list[RoleSeveritiesPermissionsItem] | Unset): - status_pages_permissions (list[RoleStatusPagesPermissionsItem] | Unset): - webhooks_permissions (list[RoleWebhooksPermissionsItem] | Unset): - workflows_permissions (list[RoleWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[RoleCatalogsPermissionsItem] | Unset): - sub_statuses_permissions (list[RoleSubStatusesPermissionsItem] | Unset): - edge_connector_permissions (list[RoleEdgeConnectorPermissionsItem] | Unset): - slas_permissions (list[RoleSlasPermissionsItem] | Unset): - paging_permissions (list[RolePagingPermissionsItem] | Unset): - incident_communication_permissions (list[RoleIncidentCommunicationPermissionsItem] | Unset): - communication_permissions (list[RoleCommunicationPermissionsItem] | Unset): + slug (Union[Unset, str]): The role slug. + incident_permission_set_id (Union[None, Unset, str]): Associated incident permissions set. + is_deletable (Union[Unset, bool]): Whether the role can be deleted. + is_editable (Union[Unset, bool]): Whether the role can be edited. + alerts_permissions (Union[Unset, list[RoleAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[RoleApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[RoleAuditsPermissionsItem]]): + billing_permissions (Union[Unset, list[RoleBillingPermissionsItem]]): + environments_permissions (Union[Unset, list[RoleEnvironmentsPermissionsItem]]): + form_fields_permissions (Union[Unset, list[RoleFormFieldsPermissionsItem]]): + functionalities_permissions (Union[Unset, list[RoleFunctionalitiesPermissionsItem]]): + groups_permissions (Union[Unset, list[RoleGroupsPermissionsItem]]): + incident_causes_permissions (Union[Unset, list[RoleIncidentCausesPermissionsItem]]): + incident_feedbacks_permissions (Union[Unset, list[RoleIncidentFeedbacksPermissionsItem]]): + incident_roles_permissions (Union[Unset, list[RoleIncidentRolesPermissionsItem]]): + incident_types_permissions (Union[Unset, list[RoleIncidentTypesPermissionsItem]]): + incidents_permissions (Union[Unset, list[RoleIncidentsPermissionsItem]]): + integrations_permissions (Union[Unset, list[RoleIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[RoleInvitationsPermissionsItem]]): + playbooks_permissions (Union[Unset, list[RolePlaybooksPermissionsItem]]): + private_incidents_permissions (Union[Unset, list[RolePrivateIncidentsPermissionsItem]]): + pulses_permissions (Union[Unset, list[RolePulsesPermissionsItem]]): + retrospective_permissions (Union[Unset, list[RoleRetrospectivePermissionsItem]]): + roles_permissions (Union[Unset, list[RoleRolesPermissionsItem]]): + secrets_permissions (Union[Unset, list[RoleSecretsPermissionsItem]]): + services_permissions (Union[Unset, list[RoleServicesPermissionsItem]]): + severities_permissions (Union[Unset, list[RoleSeveritiesPermissionsItem]]): + status_pages_permissions (Union[Unset, list[RoleStatusPagesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[RoleWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[RoleWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[RoleCatalogsPermissionsItem]]): + sub_statuses_permissions (Union[Unset, list[RoleSubStatusesPermissionsItem]]): + edge_connector_permissions (Union[Unset, list[RoleEdgeConnectorPermissionsItem]]): + slas_permissions (Union[Unset, list[RoleSlasPermissionsItem]]): + paging_permissions (Union[Unset, list[RolePagingPermissionsItem]]): + incident_communication_permissions (Union[Unset, list[RoleIncidentCommunicationPermissionsItem]]): + communication_permissions (Union[Unset, list[RoleCommunicationPermissionsItem]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - incident_permission_set_id: None | str | Unset = UNSET - is_deletable: bool | Unset = UNSET - is_editable: bool | Unset = UNSET - alerts_permissions: list[RoleAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[RoleApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[RoleAuditsPermissionsItem] | Unset = UNSET - billing_permissions: list[RoleBillingPermissionsItem] | Unset = UNSET - environments_permissions: list[RoleEnvironmentsPermissionsItem] | Unset = UNSET - form_fields_permissions: list[RoleFormFieldsPermissionsItem] | Unset = UNSET - functionalities_permissions: list[RoleFunctionalitiesPermissionsItem] | Unset = UNSET - groups_permissions: list[RoleGroupsPermissionsItem] | Unset = UNSET - incident_causes_permissions: list[RoleIncidentCausesPermissionsItem] | Unset = UNSET - incident_feedbacks_permissions: list[RoleIncidentFeedbacksPermissionsItem] | Unset = UNSET - incident_roles_permissions: list[RoleIncidentRolesPermissionsItem] | Unset = UNSET - incident_types_permissions: list[RoleIncidentTypesPermissionsItem] | Unset = UNSET - incidents_permissions: list[RoleIncidentsPermissionsItem] | Unset = UNSET - integrations_permissions: list[RoleIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[RoleInvitationsPermissionsItem] | Unset = UNSET - playbooks_permissions: list[RolePlaybooksPermissionsItem] | Unset = UNSET - private_incidents_permissions: list[RolePrivateIncidentsPermissionsItem] | Unset = UNSET - pulses_permissions: list[RolePulsesPermissionsItem] | Unset = UNSET - retrospective_permissions: list[RoleRetrospectivePermissionsItem] | Unset = UNSET - roles_permissions: list[RoleRolesPermissionsItem] | Unset = UNSET - secrets_permissions: list[RoleSecretsPermissionsItem] | Unset = UNSET - services_permissions: list[RoleServicesPermissionsItem] | Unset = UNSET - severities_permissions: list[RoleSeveritiesPermissionsItem] | Unset = UNSET - status_pages_permissions: list[RoleStatusPagesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[RoleWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[RoleWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[RoleCatalogsPermissionsItem] | Unset = UNSET - sub_statuses_permissions: list[RoleSubStatusesPermissionsItem] | Unset = UNSET - edge_connector_permissions: list[RoleEdgeConnectorPermissionsItem] | Unset = UNSET - slas_permissions: list[RoleSlasPermissionsItem] | Unset = UNSET - paging_permissions: list[RolePagingPermissionsItem] | Unset = UNSET - incident_communication_permissions: list[RoleIncidentCommunicationPermissionsItem] | Unset = UNSET - communication_permissions: list[RoleCommunicationPermissionsItem] | Unset = UNSET + slug: Unset | str = UNSET + incident_permission_set_id: None | Unset | str = UNSET + is_deletable: Unset | bool = UNSET + is_editable: Unset | bool = UNSET + alerts_permissions: Unset | list[RoleAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[RoleApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[RoleAuditsPermissionsItem] = UNSET + billing_permissions: Unset | list[RoleBillingPermissionsItem] = UNSET + environments_permissions: Unset | list[RoleEnvironmentsPermissionsItem] = UNSET + form_fields_permissions: Unset | list[RoleFormFieldsPermissionsItem] = UNSET + functionalities_permissions: Unset | list[RoleFunctionalitiesPermissionsItem] = UNSET + groups_permissions: Unset | list[RoleGroupsPermissionsItem] = UNSET + incident_causes_permissions: Unset | list[RoleIncidentCausesPermissionsItem] = UNSET + incident_feedbacks_permissions: Unset | list[RoleIncidentFeedbacksPermissionsItem] = UNSET + incident_roles_permissions: Unset | list[RoleIncidentRolesPermissionsItem] = UNSET + incident_types_permissions: Unset | list[RoleIncidentTypesPermissionsItem] = UNSET + incidents_permissions: Unset | list[RoleIncidentsPermissionsItem] = UNSET + integrations_permissions: Unset | list[RoleIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[RoleInvitationsPermissionsItem] = UNSET + playbooks_permissions: Unset | list[RolePlaybooksPermissionsItem] = UNSET + private_incidents_permissions: Unset | list[RolePrivateIncidentsPermissionsItem] = UNSET + pulses_permissions: Unset | list[RolePulsesPermissionsItem] = UNSET + retrospective_permissions: Unset | list[RoleRetrospectivePermissionsItem] = UNSET + roles_permissions: Unset | list[RoleRolesPermissionsItem] = UNSET + secrets_permissions: Unset | list[RoleSecretsPermissionsItem] = UNSET + services_permissions: Unset | list[RoleServicesPermissionsItem] = UNSET + severities_permissions: Unset | list[RoleSeveritiesPermissionsItem] = UNSET + status_pages_permissions: Unset | list[RoleStatusPagesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[RoleWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[RoleWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[RoleCatalogsPermissionsItem] = UNSET + sub_statuses_permissions: Unset | list[RoleSubStatusesPermissionsItem] = UNSET + edge_connector_permissions: Unset | list[RoleEdgeConnectorPermissionsItem] = UNSET + slas_permissions: Unset | list[RoleSlasPermissionsItem] = UNSET + paging_permissions: Unset | list[RolePagingPermissionsItem] = UNSET + incident_communication_permissions: Unset | list[RoleIncidentCommunicationPermissionsItem] = UNSET + communication_permissions: Unset | list[RoleCommunicationPermissionsItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -192,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - incident_permission_set_id: None | str | Unset + incident_permission_set_id: None | Unset | str if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -202,231 +200,231 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: list[str] | Unset = UNSET + billing_permissions: Unset | list[str] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: list[str] | Unset = UNSET + environments_permissions: Unset | list[str] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: list[str] | Unset = UNSET + form_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: list[str] | Unset = UNSET + incident_causes_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: list[str] | Unset = UNSET + incident_feedbacks_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: list[str] | Unset = UNSET + incident_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: list[str] | Unset = UNSET + incident_types_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: list[str] | Unset = UNSET + incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: list[str] | Unset = UNSET + playbooks_permissions: Unset | list[str] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: list[str] | Unset = UNSET + private_incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - pulses_permissions: list[str] | Unset = UNSET + pulses_permissions: Unset | list[str] = UNSET if not isinstance(self.pulses_permissions, Unset): pulses_permissions = [] for pulses_permissions_item_data in self.pulses_permissions: pulses_permissions_item: str = pulses_permissions_item_data pulses_permissions.append(pulses_permissions_item) - retrospective_permissions: list[str] | Unset = UNSET + retrospective_permissions: Unset | list[str] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: list[str] | Unset = UNSET + roles_permissions: Unset | list[str] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: list[str] | Unset = UNSET + secrets_permissions: Unset | list[str] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: list[str] | Unset = UNSET + severities_permissions: Unset | list[str] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: list[str] | Unset = UNSET + status_pages_permissions: Unset | list[str] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: list[str] | Unset = UNSET + sub_statuses_permissions: Unset | list[str] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: list[str] | Unset = UNSET + edge_connector_permissions: Unset | list[str] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: list[str] | Unset = UNSET + slas_permissions: Unset | list[str] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: list[str] | Unset = UNSET + paging_permissions: Unset | list[str] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: list[str] | Unset = UNSET + incident_communication_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: list[str] | Unset = UNSET + communication_permissions: Unset | list[str] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -530,12 +528,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_incident_permission_set_id(data: object) -> None | str | Unset: + def _parse_incident_permission_set_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) @@ -543,334 +541,256 @@ def _parse_incident_permission_set_id(data: object) -> None | str | Unset: is_editable = d.pop("is_editable", UNSET) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[RoleAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_role_alerts_permissions_item(alerts_permissions_item_data) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_role_alerts_permissions_item(alerts_permissions_item_data) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[RoleApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_role_api_keys_permissions_item(api_keys_permissions_item_data) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_role_api_keys_permissions_item(api_keys_permissions_item_data) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[RoleAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_role_audits_permissions_item(audits_permissions_item_data) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_role_audits_permissions_item(audits_permissions_item_data) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - billing_permissions: list[RoleBillingPermissionsItem] | Unset = UNSET - if _billing_permissions is not UNSET: - billing_permissions = [] - for billing_permissions_item_data in _billing_permissions: - billing_permissions_item = check_role_billing_permissions_item(billing_permissions_item_data) + for billing_permissions_item_data in _billing_permissions or []: + billing_permissions_item = check_role_billing_permissions_item(billing_permissions_item_data) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) + environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - environments_permissions: list[RoleEnvironmentsPermissionsItem] | Unset = UNSET - if _environments_permissions is not UNSET: - environments_permissions = [] - for environments_permissions_item_data in _environments_permissions: - environments_permissions_item = check_role_environments_permissions_item( - environments_permissions_item_data - ) + for environments_permissions_item_data in _environments_permissions or []: + environments_permissions_item = check_role_environments_permissions_item(environments_permissions_item_data) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) + form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - form_fields_permissions: list[RoleFormFieldsPermissionsItem] | Unset = UNSET - if _form_fields_permissions is not UNSET: - form_fields_permissions = [] - for form_fields_permissions_item_data in _form_fields_permissions: - form_fields_permissions_item = check_role_form_fields_permissions_item( - form_fields_permissions_item_data - ) + for form_fields_permissions_item_data in _form_fields_permissions or []: + form_fields_permissions_item = check_role_form_fields_permissions_item(form_fields_permissions_item_data) - form_fields_permissions.append(form_fields_permissions_item) + form_fields_permissions.append(form_fields_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[RoleFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_role_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_role_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[RoleGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_role_groups_permissions_item(groups_permissions_item_data) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_role_groups_permissions_item(groups_permissions_item_data) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - incident_causes_permissions: list[RoleIncidentCausesPermissionsItem] | Unset = UNSET - if _incident_causes_permissions is not UNSET: - incident_causes_permissions = [] - for incident_causes_permissions_item_data in _incident_causes_permissions: - incident_causes_permissions_item = check_role_incident_causes_permissions_item( - incident_causes_permissions_item_data - ) + for incident_causes_permissions_item_data in _incident_causes_permissions or []: + incident_causes_permissions_item = check_role_incident_causes_permissions_item( + incident_causes_permissions_item_data + ) - incident_causes_permissions.append(incident_causes_permissions_item) + incident_causes_permissions.append(incident_causes_permissions_item) + incident_feedbacks_permissions = [] _incident_feedbacks_permissions = d.pop("incident_feedbacks_permissions", UNSET) - incident_feedbacks_permissions: list[RoleIncidentFeedbacksPermissionsItem] | Unset = UNSET - if _incident_feedbacks_permissions is not UNSET: - incident_feedbacks_permissions = [] - for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions: - incident_feedbacks_permissions_item = check_role_incident_feedbacks_permissions_item( - incident_feedbacks_permissions_item_data - ) + for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions or []: + incident_feedbacks_permissions_item = check_role_incident_feedbacks_permissions_item( + incident_feedbacks_permissions_item_data + ) - incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_roles_permissions = [] _incident_roles_permissions = d.pop("incident_roles_permissions", UNSET) - incident_roles_permissions: list[RoleIncidentRolesPermissionsItem] | Unset = UNSET - if _incident_roles_permissions is not UNSET: - incident_roles_permissions = [] - for incident_roles_permissions_item_data in _incident_roles_permissions: - incident_roles_permissions_item = check_role_incident_roles_permissions_item( - incident_roles_permissions_item_data - ) + for incident_roles_permissions_item_data in _incident_roles_permissions or []: + incident_roles_permissions_item = check_role_incident_roles_permissions_item( + incident_roles_permissions_item_data + ) - incident_roles_permissions.append(incident_roles_permissions_item) + incident_roles_permissions.append(incident_roles_permissions_item) + incident_types_permissions = [] _incident_types_permissions = d.pop("incident_types_permissions", UNSET) - incident_types_permissions: list[RoleIncidentTypesPermissionsItem] | Unset = UNSET - if _incident_types_permissions is not UNSET: - incident_types_permissions = [] - for incident_types_permissions_item_data in _incident_types_permissions: - incident_types_permissions_item = check_role_incident_types_permissions_item( - incident_types_permissions_item_data - ) + for incident_types_permissions_item_data in _incident_types_permissions or []: + incident_types_permissions_item = check_role_incident_types_permissions_item( + incident_types_permissions_item_data + ) - incident_types_permissions.append(incident_types_permissions_item) + incident_types_permissions.append(incident_types_permissions_item) + incidents_permissions = [] _incidents_permissions = d.pop("incidents_permissions", UNSET) - incidents_permissions: list[RoleIncidentsPermissionsItem] | Unset = UNSET - if _incidents_permissions is not UNSET: - incidents_permissions = [] - for incidents_permissions_item_data in _incidents_permissions: - incidents_permissions_item = check_role_incidents_permissions_item(incidents_permissions_item_data) + for incidents_permissions_item_data in _incidents_permissions or []: + incidents_permissions_item = check_role_incidents_permissions_item(incidents_permissions_item_data) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[RoleIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_role_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_role_integrations_permissions_item(integrations_permissions_item_data) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[RoleInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_role_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_role_invitations_permissions_item(invitations_permissions_item_data) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - playbooks_permissions: list[RolePlaybooksPermissionsItem] | Unset = UNSET - if _playbooks_permissions is not UNSET: - playbooks_permissions = [] - for playbooks_permissions_item_data in _playbooks_permissions: - playbooks_permissions_item = check_role_playbooks_permissions_item(playbooks_permissions_item_data) + for playbooks_permissions_item_data in _playbooks_permissions or []: + playbooks_permissions_item = check_role_playbooks_permissions_item(playbooks_permissions_item_data) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) + private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - private_incidents_permissions: list[RolePrivateIncidentsPermissionsItem] | Unset = UNSET - if _private_incidents_permissions is not UNSET: - private_incidents_permissions = [] - for private_incidents_permissions_item_data in _private_incidents_permissions: - private_incidents_permissions_item = check_role_private_incidents_permissions_item( - private_incidents_permissions_item_data - ) + for private_incidents_permissions_item_data in _private_incidents_permissions or []: + private_incidents_permissions_item = check_role_private_incidents_permissions_item( + private_incidents_permissions_item_data + ) - private_incidents_permissions.append(private_incidents_permissions_item) + private_incidents_permissions.append(private_incidents_permissions_item) + pulses_permissions = [] _pulses_permissions = d.pop("pulses_permissions", UNSET) - pulses_permissions: list[RolePulsesPermissionsItem] | Unset = UNSET - if _pulses_permissions is not UNSET: - pulses_permissions = [] - for pulses_permissions_item_data in _pulses_permissions: - pulses_permissions_item = check_role_pulses_permissions_item(pulses_permissions_item_data) + for pulses_permissions_item_data in _pulses_permissions or []: + pulses_permissions_item = check_role_pulses_permissions_item(pulses_permissions_item_data) - pulses_permissions.append(pulses_permissions_item) + pulses_permissions.append(pulses_permissions_item) + retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - retrospective_permissions: list[RoleRetrospectivePermissionsItem] | Unset = UNSET - if _retrospective_permissions is not UNSET: - retrospective_permissions = [] - for retrospective_permissions_item_data in _retrospective_permissions: - retrospective_permissions_item = check_role_retrospective_permissions_item( - retrospective_permissions_item_data - ) + for retrospective_permissions_item_data in _retrospective_permissions or []: + retrospective_permissions_item = check_role_retrospective_permissions_item( + retrospective_permissions_item_data + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) + roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - roles_permissions: list[RoleRolesPermissionsItem] | Unset = UNSET - if _roles_permissions is not UNSET: - roles_permissions = [] - for roles_permissions_item_data in _roles_permissions: - roles_permissions_item = check_role_roles_permissions_item(roles_permissions_item_data) + for roles_permissions_item_data in _roles_permissions or []: + roles_permissions_item = check_role_roles_permissions_item(roles_permissions_item_data) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) + secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - secrets_permissions: list[RoleSecretsPermissionsItem] | Unset = UNSET - if _secrets_permissions is not UNSET: - secrets_permissions = [] - for secrets_permissions_item_data in _secrets_permissions: - secrets_permissions_item = check_role_secrets_permissions_item(secrets_permissions_item_data) + for secrets_permissions_item_data in _secrets_permissions or []: + secrets_permissions_item = check_role_secrets_permissions_item(secrets_permissions_item_data) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[RoleServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_role_services_permissions_item(services_permissions_item_data) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_role_services_permissions_item(services_permissions_item_data) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - severities_permissions: list[RoleSeveritiesPermissionsItem] | Unset = UNSET - if _severities_permissions is not UNSET: - severities_permissions = [] - for severities_permissions_item_data in _severities_permissions: - severities_permissions_item = check_role_severities_permissions_item(severities_permissions_item_data) + for severities_permissions_item_data in _severities_permissions or []: + severities_permissions_item = check_role_severities_permissions_item(severities_permissions_item_data) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) + status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - status_pages_permissions: list[RoleStatusPagesPermissionsItem] | Unset = UNSET - if _status_pages_permissions is not UNSET: - status_pages_permissions = [] - for status_pages_permissions_item_data in _status_pages_permissions: - status_pages_permissions_item = check_role_status_pages_permissions_item( - status_pages_permissions_item_data - ) + for status_pages_permissions_item_data in _status_pages_permissions or []: + status_pages_permissions_item = check_role_status_pages_permissions_item(status_pages_permissions_item_data) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[RoleWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_role_webhooks_permissions_item(webhooks_permissions_item_data) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_role_webhooks_permissions_item(webhooks_permissions_item_data) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[RoleWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_role_workflows_permissions_item(workflows_permissions_item_data) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_role_workflows_permissions_item(workflows_permissions_item_data) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[RoleCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_role_catalogs_permissions_item(catalogs_permissions_item_data) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_role_catalogs_permissions_item(catalogs_permissions_item_data) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) + sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - sub_statuses_permissions: list[RoleSubStatusesPermissionsItem] | Unset = UNSET - if _sub_statuses_permissions is not UNSET: - sub_statuses_permissions = [] - for sub_statuses_permissions_item_data in _sub_statuses_permissions: - sub_statuses_permissions_item = check_role_sub_statuses_permissions_item( - sub_statuses_permissions_item_data - ) + for sub_statuses_permissions_item_data in _sub_statuses_permissions or []: + sub_statuses_permissions_item = check_role_sub_statuses_permissions_item(sub_statuses_permissions_item_data) - sub_statuses_permissions.append(sub_statuses_permissions_item) + sub_statuses_permissions.append(sub_statuses_permissions_item) + edge_connector_permissions = [] _edge_connector_permissions = d.pop("edge_connector_permissions", UNSET) - edge_connector_permissions: list[RoleEdgeConnectorPermissionsItem] | Unset = UNSET - if _edge_connector_permissions is not UNSET: - edge_connector_permissions = [] - for edge_connector_permissions_item_data in _edge_connector_permissions: - edge_connector_permissions_item = check_role_edge_connector_permissions_item( - edge_connector_permissions_item_data - ) + for edge_connector_permissions_item_data in _edge_connector_permissions or []: + edge_connector_permissions_item = check_role_edge_connector_permissions_item( + edge_connector_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - slas_permissions: list[RoleSlasPermissionsItem] | Unset = UNSET - if _slas_permissions is not UNSET: - slas_permissions = [] - for slas_permissions_item_data in _slas_permissions: - slas_permissions_item = check_role_slas_permissions_item(slas_permissions_item_data) + for slas_permissions_item_data in _slas_permissions or []: + slas_permissions_item = check_role_slas_permissions_item(slas_permissions_item_data) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) + paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - paging_permissions: list[RolePagingPermissionsItem] | Unset = UNSET - if _paging_permissions is not UNSET: - paging_permissions = [] - for paging_permissions_item_data in _paging_permissions: - paging_permissions_item = check_role_paging_permissions_item(paging_permissions_item_data) + for paging_permissions_item_data in _paging_permissions or []: + paging_permissions_item = check_role_paging_permissions_item(paging_permissions_item_data) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) + incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - incident_communication_permissions: list[RoleIncidentCommunicationPermissionsItem] | Unset = UNSET - if _incident_communication_permissions is not UNSET: - incident_communication_permissions = [] - for incident_communication_permissions_item_data in _incident_communication_permissions: - incident_communication_permissions_item = check_role_incident_communication_permissions_item( - incident_communication_permissions_item_data - ) + for incident_communication_permissions_item_data in _incident_communication_permissions or []: + incident_communication_permissions_item = check_role_incident_communication_permissions_item( + incident_communication_permissions_item_data + ) - incident_communication_permissions.append(incident_communication_permissions_item) + incident_communication_permissions.append(incident_communication_permissions_item) + communication_permissions = [] _communication_permissions = d.pop("communication_permissions", UNSET) - communication_permissions: list[RoleCommunicationPermissionsItem] | Unset = UNSET - if _communication_permissions is not UNSET: - communication_permissions = [] - for communication_permissions_item_data in _communication_permissions: - communication_permissions_item = check_role_communication_permissions_item( - communication_permissions_item_data - ) + for communication_permissions_item_data in _communication_permissions or []: + communication_permissions_item = check_role_communication_permissions_item( + communication_permissions_item_data + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) role = cls( name=name, diff --git a/rootly_sdk/models/role_list.py b/rootly_sdk/models/role_list.py index 84c2a73f..39a5997a 100644 --- a/rootly_sdk/models/role_list.py +++ b/rootly_sdk/models/role_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class RoleList: """ Attributes: - data (list[RoleListDataItem]): + data (list['RoleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RoleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RoleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) role_list = cls( data=data, diff --git a/rootly_sdk/models/role_list_data_item.py b/rootly_sdk/models/role_list_data_item.py index 71ba6db3..438b2303 100644 --- a/rootly_sdk/models/role_list_data_item.py +++ b/rootly_sdk/models/role_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class RoleListDataItem: id: str type_: RoleListDataItemType - attributes: Role + attributes: "Role" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/role_relationship.py b/rootly_sdk/models/role_relationship.py index a8a730e0..3bd40da5 100644 --- a/rootly_sdk/models/role_relationship.py +++ b/rootly_sdk/models/role_relationship.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class RoleRelationship: """ Attributes: - data (None | RoleRelationshipDataType0 | Unset): + data (Union['RoleRelationshipDataType0', None, Unset]): """ - data: None | RoleRelationshipDataType0 | Unset = UNSET + data: Union["RoleRelationshipDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.role_relationship_data_type_0 import RoleRelationshipDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, RoleRelationshipDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | RoleRelationshipDataType0 | Unset: + def _parse_data(data: object) -> Union["RoleRelationshipDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | RoleRelationshipDataType0 | Unset: data_type_0 = RoleRelationshipDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | RoleRelationshipDataType0 | Unset, data) + return cast(Union["RoleRelationshipDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/role_relationship_data_type_0.py b/rootly_sdk/models/role_relationship_data_type_0.py index 6a7576ec..5f7ec2fe 100644 --- a/rootly_sdk/models/role_relationship_data_type_0.py +++ b/rootly_sdk/models/role_relationship_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class RoleRelationshipDataType0: """ Attributes: - id (str | Unset): - type_ (RoleRelationshipDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, RoleRelationshipDataType0Type]): """ - id: str | Unset = UNSET - type_: RoleRelationshipDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | RoleRelationshipDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: RoleRelationshipDataType0Type | Unset + type_: Unset | RoleRelationshipDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/role_response.py b/rootly_sdk/models/role_response.py index a8768453..85bba452 100644 --- a/rootly_sdk/models/role_response.py +++ b/rootly_sdk/models/role_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class RoleResponse: """ Attributes: data (RoleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RoleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RoleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RoleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) role_response = cls( data=data, diff --git a/rootly_sdk/models/role_response_data.py b/rootly_sdk/models/role_response_data.py index a238ec70..d1400829 100644 --- a/rootly_sdk/models/role_response_data.py +++ b/rootly_sdk/models/role_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class RoleResponseData: id: str type_: RoleResponseDataType - attributes: Role + attributes: "Role" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/rotate_api_key.py b/rootly_sdk/models/rotate_api_key.py index 1b5e928b..3b4d42ab 100644 --- a/rootly_sdk/models/rotate_api_key.py +++ b/rootly_sdk/models/rotate_api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class RotateApiKey: data (RotateApiKeyData): """ - data: RotateApiKeyData + data: "RotateApiKeyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/rotate_api_key_data.py b/rootly_sdk/models/rotate_api_key_data.py index be73db86..c5409b88 100644 --- a/rootly_sdk/models/rotate_api_key_data.py +++ b/rootly_sdk/models/rotate_api_key_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class RotateApiKeyData: """ type_: RotateApiKeyDataType - attributes: RotateApiKeyDataAttributes + attributes: "RotateApiKeyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/rotate_api_key_data_attributes.py b/rootly_sdk/models/rotate_api_key_data_attributes.py index a65b88c0..d6e37992 100644 --- a/rootly_sdk/models/rotate_api_key_data_attributes.py +++ b/rootly_sdk/models/rotate_api_key_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,16 +14,16 @@ class RotateApiKeyDataAttributes: """ Attributes: - expires_at (datetime.datetime | None | Unset): The new expiration date after rotation (ISO 8601) - grace_period_minutes (int | Unset): How many minutes to keep the old token valid. Only applies when the grace - period feature is enabled for your organization. Defaults to 30. Default: 30. + expires_at (Union[None, Unset, datetime.datetime]): The new expiration date after rotation (ISO 8601) + grace_period_minutes (Union[Unset, int]): How many minutes to keep the old token valid. Only applies when the + grace period feature is enabled for your organization. Defaults to 30. Default: 30. """ - expires_at: datetime.datetime | None | Unset = UNSET - grace_period_minutes: int | Unset = 30 + expires_at: None | Unset | datetime.datetime = UNSET + grace_period_minutes: Unset | int = 30 def to_dict(self) -> dict[str, Any]: - expires_at: None | str | Unset + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -49,7 +47,7 @@ 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_expires_at(data: object) -> datetime.datetime | None | Unset: + def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -60,9 +58,9 @@ def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: expires_at_type_0 = isoparse(data) return expires_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/run_command_heroku_task_params.py b/rootly_sdk/models/run_command_heroku_task_params.py index cfc9232e..49a46930 100644 --- a/rootly_sdk/models/run_command_heroku_task_params.py +++ b/rootly_sdk/models/run_command_heroku_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,34 +30,33 @@ class RunCommandHerokuTaskParams: command (str): app_name (str): size (RunCommandHerokuTaskParamsSize): - task_type (RunCommandHerokuTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, RunCommandHerokuTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['RunCommandHerokuTaskParamsPostToSlackChannelsItem']]): """ command: str app_name: str size: RunCommandHerokuTaskParamsSize - task_type: RunCommandHerokuTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | RunCommandHerokuTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["RunCommandHerokuTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - command = self.command app_name = self.app_name size: str = self.size - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -98,7 +95,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: size = check_run_command_heroku_task_params_size(d.pop("size")) _task_type = d.pop("task_type", UNSET) - task_type: RunCommandHerokuTaskParamsTaskType | Unset + task_type: Unset | RunCommandHerokuTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -106,16 +103,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = RunCommandHerokuTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = RunCommandHerokuTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) run_command_heroku_task_params = cls( command=command, diff --git a/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py index 034627af..27b0a046 100644 --- a/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class RunCommandHerokuTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule.py b/rootly_sdk/models/schedule.py index a876f69e..01b2ec58 100644 --- a/rootly_sdk/models/schedule.py +++ b/rootly_sdk/models/schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,42 +26,45 @@ class Schedule: owner_user_id (int): ID of user assigned as owner of the schedule created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of the schedule - all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule - slack_user_group (None | ScheduleSlackUserGroupType0 | Unset): Synced slack group of the schedule - slack_channel (None | ScheduleSlackChannelType0 | Unset): Synced slack channel of the schedule - owner_group_ids (list[str] | Unset): Owning teams. - sync_linear_enabled (bool | Unset): Whether the schedule is synced with Linear - include_shadows_in_slack_notifications (bool | Unset): Whether shadow users are included in Slack notifications - and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_start_notifications_enabled (bool | Unset): Whether shift-start notifications are enabled. Requires - `slack_channel` to be set; otherwise this value is forced to false on save. - shift_update_notifications_enabled (bool | Unset): Whether shift-update notifications are enabled. Requires + description (Union[None, Unset, str]): The description of the schedule + all_time_coverage (Union[None, Unset, bool]): 24/7 coverage of the schedule + slack_user_group (Union['ScheduleSlackUserGroupType0', None, Unset]): Synced slack group of the schedule + slack_channel (Union['ScheduleSlackChannelType0', None, Unset]): Synced slack channel of the schedule + owner_group_ids (Union[Unset, list[str]]): Owning teams. + sync_linear_enabled (Union[Unset, bool]): Whether the schedule is synced with Linear + include_shadows_in_slack_notifications (Union[Unset, bool]): Whether shadow users are included in Slack + notifications and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to + false on save. + shift_start_notifications_enabled (Union[Unset, bool]): Whether shift-start notifications are enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (bool | Unset): Whether the weekly shift summary report is enabled. Requires + shift_update_notifications_enabled (Union[Unset, bool]): Whether shift-update notifications are enabled. + Requires `slack_channel` to be set; otherwise this value is forced to false on save. + shift_report_enabled (Union[Unset, bool]): Whether the weekly shift summary report is enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_day_of_week (ScheduleShiftReportDayOfWeek | Unset): Day of week the weekly shift summary is sent - shift_report_time_of_day (str | Unset): Time of day the weekly shift summary is sent, in HH:MM 24-hour format - shift_report_time_zone (str | Unset): IANA time zone used for the weekly shift summary + shift_report_day_of_week (Union[Unset, ScheduleShiftReportDayOfWeek]): Day of week the weekly shift summary is + sent + shift_report_time_of_day (Union[Unset, str]): Time of day the weekly shift summary is sent, in HH:MM 24-hour + format + shift_report_time_zone (Union[Unset, str]): IANA time zone used for the weekly shift summary """ name: str owner_user_id: int created_at: str updated_at: str - description: None | str | Unset = UNSET - all_time_coverage: bool | None | Unset = UNSET - slack_user_group: None | ScheduleSlackUserGroupType0 | Unset = UNSET - slack_channel: None | ScheduleSlackChannelType0 | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - sync_linear_enabled: bool | Unset = UNSET - include_shadows_in_slack_notifications: bool | Unset = UNSET - shift_start_notifications_enabled: bool | Unset = UNSET - shift_update_notifications_enabled: bool | Unset = UNSET - shift_report_enabled: bool | Unset = UNSET - shift_report_day_of_week: ScheduleShiftReportDayOfWeek | Unset = UNSET - shift_report_time_of_day: str | Unset = UNSET - shift_report_time_zone: str | Unset = UNSET + description: None | Unset | str = UNSET + all_time_coverage: None | Unset | bool = UNSET + slack_user_group: Union["ScheduleSlackUserGroupType0", None, Unset] = UNSET + slack_channel: Union["ScheduleSlackChannelType0", None, Unset] = UNSET + owner_group_ids: Unset | list[str] = UNSET + sync_linear_enabled: Unset | bool = UNSET + include_shadows_in_slack_notifications: Unset | bool = UNSET + shift_start_notifications_enabled: Unset | bool = UNSET + shift_update_notifications_enabled: Unset | bool = UNSET + shift_report_enabled: Unset | bool = UNSET + shift_report_day_of_week: Unset | ScheduleShiftReportDayOfWeek = UNSET + shift_report_time_of_day: Unset | str = UNSET + shift_report_time_zone: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -78,19 +79,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: bool | None | Unset + all_time_coverage: None | Unset | bool if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: dict[str, Any] | None | Unset + slack_user_group: None | Unset | dict[str, Any] if isinstance(self.slack_user_group, Unset): slack_user_group = UNSET elif isinstance(self.slack_user_group, ScheduleSlackUserGroupType0): @@ -98,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_user_group = self.slack_user_group - slack_channel: dict[str, Any] | None | Unset + slack_channel: None | Unset | dict[str, Any] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, ScheduleSlackChannelType0): @@ -106,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -120,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: str | Unset = UNSET + shift_report_day_of_week: Unset | str = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week @@ -181,25 +182,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> bool | None | Unset: + def _parse_all_time_coverage(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) - def _parse_slack_user_group(data: object) -> None | ScheduleSlackUserGroupType0 | Unset: + def _parse_slack_user_group(data: object) -> Union["ScheduleSlackUserGroupType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -210,13 +211,13 @@ def _parse_slack_user_group(data: object) -> None | ScheduleSlackUserGroupType0 slack_user_group_type_0 = ScheduleSlackUserGroupType0.from_dict(data) return slack_user_group_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ScheduleSlackUserGroupType0 | Unset, data) + return cast(Union["ScheduleSlackUserGroupType0", None, Unset], data) slack_user_group = _parse_slack_user_group(d.pop("slack_user_group", UNSET)) - def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Unset: + def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -227,9 +228,9 @@ def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Uns slack_channel_type_0 = ScheduleSlackChannelType0.from_dict(data) return slack_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ScheduleSlackChannelType0 | Unset, data) + return cast(Union["ScheduleSlackChannelType0", None, Unset], data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) @@ -246,7 +247,7 @@ def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Uns shift_report_enabled = d.pop("shift_report_enabled", UNSET) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: ScheduleShiftReportDayOfWeek | Unset + shift_report_day_of_week: Unset | ScheduleShiftReportDayOfWeek if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: diff --git a/rootly_sdk/models/schedule_list.py b/rootly_sdk/models/schedule_list.py index 1565c112..52a5d577 100644 --- a/rootly_sdk/models/schedule_list.py +++ b/rootly_sdk/models/schedule_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class ScheduleList: """ Attributes: - data (list[ScheduleListDataItem]): + data (list['ScheduleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_list_data_item.py b/rootly_sdk/models/schedule_list_data_item.py index 9e0cb37f..dee5f4d0 100644 --- a/rootly_sdk/models/schedule_list_data_item.py +++ b/rootly_sdk/models/schedule_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ScheduleListDataItem: id: str type_: ScheduleListDataItemType - attributes: Schedule + attributes: "Schedule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_response.py b/rootly_sdk/models/schedule_response.py index 35a66c8e..7a59fdfe 100644 --- a/rootly_sdk/models/schedule_response.py +++ b/rootly_sdk/models/schedule_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ScheduleResponse: """ Attributes: data (ScheduleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ScheduleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ScheduleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_response_data.py b/rootly_sdk/models/schedule_response_data.py index 523ab23b..4b483ed5 100644 --- a/rootly_sdk/models/schedule_response_data.py +++ b/rootly_sdk/models/schedule_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ScheduleResponseData: id: str type_: ScheduleResponseDataType - attributes: Schedule + attributes: "Schedule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation.py b/rootly_sdk/models/schedule_rotation.py index 18d78321..53d1f657 100644 --- a/rootly_sdk/models/schedule_rotation.py +++ b/rootly_sdk/models/schedule_rotation.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,39 +42,39 @@ class ScheduleRotation: schedule_id (str): The ID of parent schedule name (str): The name of the schedule rotation schedule_rotationable_type (ScheduleRotationScheduleRotationableType): Schedule rotation type - schedule_rotationable_attributes (ScheduleRotationScheduleRotationableAttributesType0 | - ScheduleRotationScheduleRotationableAttributesType1 | ScheduleRotationScheduleRotationableAttributesType2 | - ScheduleRotationScheduleRotationableAttributesType3): - position (int | Unset): Position of the schedule rotation - active_all_week (bool | Unset): Schedule rotation active all week? Default: True. - active_days (list[ScheduleRotationActiveDaysItem] | Unset): - active_time_type (str | Unset): - active_time_attributes (list[ScheduleRotationActiveTimeAttributesItem] | Unset): Schedule rotation's active - times - time_zone (str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be + schedule_rotationable_attributes (Union['ScheduleRotationScheduleRotationableAttributesType0', + 'ScheduleRotationScheduleRotationableAttributesType1', 'ScheduleRotationScheduleRotationableAttributesType2', + 'ScheduleRotationScheduleRotationableAttributesType3']): + position (Union[Unset, int]): Position of the schedule rotation + active_all_week (Union[Unset, bool]): Schedule rotation active all week? Default: True. + active_days (Union[Unset, list[ScheduleRotationActiveDaysItem]]): + active_time_type (Union[Unset, str]): + active_time_attributes (Union[Unset, list['ScheduleRotationActiveTimeAttributesItem']]): Schedule rotation's + active times + time_zone (Union[Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + start_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation ends. Shifts will only be created - before this time. + end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be + created before this time. """ schedule_id: str name: str schedule_rotationable_type: ScheduleRotationScheduleRotationableType - schedule_rotationable_attributes: ( - ScheduleRotationScheduleRotationableAttributesType0 - | ScheduleRotationScheduleRotationableAttributesType1 - | ScheduleRotationScheduleRotationableAttributesType2 - | ScheduleRotationScheduleRotationableAttributesType3 - ) - position: int | Unset = UNSET - active_all_week: bool | Unset = True - active_days: list[ScheduleRotationActiveDaysItem] | Unset = UNSET - active_time_type: str | Unset = UNSET - active_time_attributes: list[ScheduleRotationActiveTimeAttributesItem] | Unset = UNSET - time_zone: str | Unset = "Etc/UTC" - start_time: datetime.datetime | None | Unset = UNSET - end_time: datetime.datetime | None | Unset = UNSET + schedule_rotationable_attributes: Union[ + "ScheduleRotationScheduleRotationableAttributesType0", + "ScheduleRotationScheduleRotationableAttributesType1", + "ScheduleRotationScheduleRotationableAttributesType2", + "ScheduleRotationScheduleRotationableAttributesType3", + ] + position: Unset | int = UNSET + active_all_week: Unset | bool = True + active_days: Unset | list[ScheduleRotationActiveDaysItem] = UNSET + active_time_type: Unset | str = UNSET + active_time_attributes: Unset | list["ScheduleRotationActiveTimeAttributesItem"] = UNSET + time_zone: Unset | str = "Etc/UTC" + start_time: None | Unset | datetime.datetime = UNSET + end_time: None | Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -110,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: list[str] | Unset = UNSET + active_days: Unset | list[str] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -119,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -128,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: None | str | Unset + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -136,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | str | Unset + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -200,12 +198,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_schedule_rotationable_attributes( data: object, - ) -> ( - ScheduleRotationScheduleRotationableAttributesType0 - | ScheduleRotationScheduleRotationableAttributesType1 - | ScheduleRotationScheduleRotationableAttributesType2 - | ScheduleRotationScheduleRotationableAttributesType3 - ): + ) -> Union[ + "ScheduleRotationScheduleRotationableAttributesType0", + "ScheduleRotationScheduleRotationableAttributesType1", + "ScheduleRotationScheduleRotationableAttributesType2", + "ScheduleRotationScheduleRotationableAttributesType3", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -214,7 +212,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -224,7 +222,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -234,7 +232,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -252,31 +250,27 @@ def _parse_schedule_rotationable_attributes( active_all_week = d.pop("active_all_week", UNSET) + active_days = [] _active_days = d.pop("active_days", UNSET) - active_days: list[ScheduleRotationActiveDaysItem] | Unset = UNSET - if _active_days is not UNSET: - active_days = [] - for active_days_item_data in _active_days: - active_days_item = check_schedule_rotation_active_days_item(active_days_item_data) + for active_days_item_data in _active_days or []: + active_days_item = check_schedule_rotation_active_days_item(active_days_item_data) - active_days.append(active_days_item) + active_days.append(active_days_item) active_time_type = d.pop("active_time_type", UNSET) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[ScheduleRotationActiveTimeAttributesItem] | Unset = UNSET - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = ScheduleRotationActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = ScheduleRotationActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) time_zone = d.pop("time_zone", UNSET) - def _parse_start_time(data: object) -> datetime.datetime | None | Unset: + def _parse_start_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -287,13 +281,13 @@ def _parse_start_time(data: object) -> datetime.datetime | None | Unset: start_time_type_0 = isoparse(data) return start_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> datetime.datetime | None | Unset: + def _parse_end_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -304,9 +298,9 @@ def _parse_end_time(data: object) -> datetime.datetime | None | Unset: end_time_type_0 = isoparse(data) return end_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/schedule_rotation_active_day.py b/rootly_sdk/models/schedule_rotation_active_day.py index 1410cc1e..f3b1c891 100644 --- a/rootly_sdk/models/schedule_rotation_active_day.py +++ b/rootly_sdk/models/schedule_rotation_active_day.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,21 +24,20 @@ class ScheduleRotationActiveDay: Attributes: schedule_rotation_id (str): day_name (ScheduleRotationActiveDayDayName): Schedule rotation day name for which active times to be created - active_time_attributes (list[ScheduleRotationActiveDayActiveTimeAttributesItem]): Schedule rotation active times - per day + active_time_attributes (list['ScheduleRotationActiveDayActiveTimeAttributesItem']): Schedule rotation active + times per day created_at (str): Date of creation updated_at (str): Date of last update """ schedule_rotation_id: str day_name: ScheduleRotationActiveDayDayName - active_time_attributes: list[ScheduleRotationActiveDayActiveTimeAttributesItem] + active_time_attributes: list["ScheduleRotationActiveDayActiveTimeAttributesItem"] created_at: str updated_at: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - schedule_rotation_id = self.schedule_rotation_id day_name: str = self.day_name diff --git a/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py b/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py index 8407725b..ee238b25 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py +++ b/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ScheduleRotationActiveDayActiveTimeAttributesItem: """ Attributes: - start_time (str | Unset): Start time for schedule rotation active time - end_time (str | Unset): End time for schedule rotation active time + start_time (Union[Unset, str]): Start time for schedule rotation active time + end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule_rotation_active_day_list.py b/rootly_sdk/models/schedule_rotation_active_day_list.py index f359204a..68ad8077 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class ScheduleRotationActiveDayList: """ Attributes: - data (list[ScheduleRotationActiveDayListDataItem]): + data (list['ScheduleRotationActiveDayListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleRotationActiveDayListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleRotationActiveDayListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_active_day_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py b/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py index 4b9438f4..e5f8d111 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationActiveDayListDataItem: id: str type_: ScheduleRotationActiveDayListDataItemType - attributes: ScheduleRotationActiveDay + attributes: "ScheduleRotationActiveDay" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_active_day_response.py b/rootly_sdk/models/schedule_rotation_active_day_response.py index bd8158a0..0bcef0d5 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class ScheduleRotationActiveDayResponse: """ Attributes: - data (ScheduleRotationActiveDayResponseData | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (Union[Unset, ScheduleRotationActiveDayResponseData]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleRotationActiveDayResponseData | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: Union[Unset, "ScheduleRotationActiveDayResponseData"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -58,20 +55,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: ScheduleRotationActiveDayResponseData | Unset + data: Unset | ScheduleRotationActiveDayResponseData if isinstance(_data, Unset): data = UNSET else: data = ScheduleRotationActiveDayResponseData.from_dict(_data) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_active_day_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_active_day_response_data.py b/rootly_sdk/models/schedule_rotation_active_day_response_data.py index c24c7a76..97dce826 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response_data.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class ScheduleRotationActiveDayResponseData: """ Attributes: - id (str | Unset): Unique ID of the schedule rotation active time - type_ (ScheduleRotationActiveDayResponseDataType | Unset): - attributes (ScheduleRotationActiveDay | Unset): + id (Union[Unset, str]): Unique ID of the schedule rotation active time + type_ (Union[Unset, ScheduleRotationActiveDayResponseDataType]): + attributes (Union[Unset, ScheduleRotationActiveDay]): """ - id: str | Unset = UNSET - type_: ScheduleRotationActiveDayResponseDataType | Unset = UNSET - attributes: ScheduleRotationActiveDay | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | ScheduleRotationActiveDayResponseDataType = UNSET + attributes: Union[Unset, "ScheduleRotationActiveDay"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: ScheduleRotationActiveDayResponseDataType | Unset + type_: Unset | ScheduleRotationActiveDayResponseDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_schedule_rotation_active_day_response_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: ScheduleRotationActiveDay | Unset + attributes: Unset | ScheduleRotationActiveDay if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py b/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py index f61260d2..0133b6f5 100644 --- a/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py +++ b/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_list.py b/rootly_sdk/models/schedule_rotation_list.py index 9881f2ff..0c67d4c7 100644 --- a/rootly_sdk/models/schedule_rotation_list.py +++ b/rootly_sdk/models/schedule_rotation_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class ScheduleRotationList: """ Attributes: - data (list[ScheduleRotationListDataItem]): + data (list['ScheduleRotationListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleRotationListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleRotationListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_list_data_item.py b/rootly_sdk/models/schedule_rotation_list_data_item.py index 032ca96c..c61c5b9c 100644 --- a/rootly_sdk/models/schedule_rotation_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationListDataItem: id: str type_: ScheduleRotationListDataItemType - attributes: ScheduleRotation + attributes: "ScheduleRotation" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_response.py b/rootly_sdk/models/schedule_rotation_response.py index 651e9a21..a0fd94db 100644 --- a/rootly_sdk/models/schedule_rotation_response.py +++ b/rootly_sdk/models/schedule_rotation_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ScheduleRotationResponse: """ Attributes: data (ScheduleRotationResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleRotationResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ScheduleRotationResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ScheduleRotationResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_response_data.py b/rootly_sdk/models/schedule_rotation_response_data.py index 4e1354bb..885266b5 100644 --- a/rootly_sdk/models/schedule_rotation_response_data.py +++ b/rootly_sdk/models/schedule_rotation_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationResponseData: id: str type_: ScheduleRotationResponseDataType - attributes: ScheduleRotation + attributes: "ScheduleRotation" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py index 2cd22b53..6835c072 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py index c36e9741..e03a3206 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py index 01e31b7b..b58fca4b 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py index 4134c043..78bf3791 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_user.py b/rootly_sdk/models/schedule_rotation_user.py index 77738f7a..eb4942e9 100644 --- a/rootly_sdk/models/schedule_rotation_user.py +++ b/rootly_sdk/models/schedule_rotation_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_user_list.py b/rootly_sdk/models/schedule_rotation_user_list.py index 8eadaa63..df975947 100644 --- a/rootly_sdk/models/schedule_rotation_user_list.py +++ b/rootly_sdk/models/schedule_rotation_user_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class ScheduleRotationUserList: """ Attributes: - data (list[ScheduleRotationUserListDataItem]): + data (list['ScheduleRotationUserListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleRotationUserListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleRotationUserListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_user_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_user_list_data_item.py b/rootly_sdk/models/schedule_rotation_user_list_data_item.py index 08da3d88..654de35e 100644 --- a/rootly_sdk/models/schedule_rotation_user_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_user_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationUserListDataItem: id: str type_: ScheduleRotationUserListDataItemType - attributes: ScheduleRotationUser + attributes: "ScheduleRotationUser" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_user_response.py b/rootly_sdk/models/schedule_rotation_user_response.py index a77b9c0b..16d4fcf2 100644 --- a/rootly_sdk/models/schedule_rotation_user_response.py +++ b/rootly_sdk/models/schedule_rotation_user_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ScheduleRotationUserResponse: """ Attributes: data (ScheduleRotationUserResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleRotationUserResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ScheduleRotationUserResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ScheduleRotationUserResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_user_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_user_response_data.py b/rootly_sdk/models/schedule_rotation_user_response_data.py index c13bc9a8..f406ddaf 100644 --- a/rootly_sdk/models/schedule_rotation_user_response_data.py +++ b/rootly_sdk/models/schedule_rotation_user_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationUserResponseData: id: str type_: ScheduleRotationUserResponseDataType - attributes: ScheduleRotationUser + attributes: "ScheduleRotationUser" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_slack_channel_type_0.py b/rootly_sdk/models/schedule_slack_channel_type_0.py index eb26f635..ec9d0e00 100644 --- a/rootly_sdk/models/schedule_slack_channel_type_0.py +++ b/rootly_sdk/models/schedule_slack_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class ScheduleSlackChannelType0: """Synced slack channel of the schedule Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule_slack_user_group_type_0.py b/rootly_sdk/models/schedule_slack_user_group_type_0.py index ac2adf75..692964b9 100644 --- a/rootly_sdk/models/schedule_slack_user_group_type_0.py +++ b/rootly_sdk/models/schedule_slack_user_group_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class ScheduleSlackUserGroupType0: """Synced slack group of the schedule Attributes: - id (str | Unset): Slack user group ID - name (str | Unset): Slack user group name + id (Union[Unset, str]): Slack user group ID + name (Union[Unset, str]): Slack user group name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/secret.py b/rootly_sdk/models/secret.py index 19dae479..e3fd23f3 100644 --- a/rootly_sdk/models/secret.py +++ b/rootly_sdk/models/secret.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,19 +16,19 @@ class Secret: name (str): The name of the secret created_at (str): Date of creation updated_at (str): Date of last update - secret (str | Unset): The redacted secret - hashicorp_vault_mount (str | Unset): The HashiCorp Vault secret mount path - hashicorp_vault_path (None | str | Unset): The HashiCorp Vault secret path - hashicorp_vault_version (int | Unset): The HashiCorp Vault secret version + secret (Union[Unset, str]): The redacted secret + hashicorp_vault_mount (Union[Unset, str]): The HashiCorp Vault secret mount path + hashicorp_vault_path (Union[None, Unset, str]): The HashiCorp Vault secret path + hashicorp_vault_version (Union[Unset, int]): The HashiCorp Vault secret version """ name: str created_at: str updated_at: str - secret: str | Unset = UNSET - hashicorp_vault_mount: str | Unset = UNSET - hashicorp_vault_path: None | str | Unset = UNSET - hashicorp_vault_version: int | Unset = UNSET + secret: Unset | str = UNSET + hashicorp_vault_mount: Unset | str = UNSET + hashicorp_vault_path: None | Unset | str = UNSET + hashicorp_vault_version: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | str | Unset + hashicorp_vault_path: None | Unset | str if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: hashicorp_vault_mount = d.pop("hashicorp_vault_mount", UNSET) - def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) diff --git a/rootly_sdk/models/secret_list.py b/rootly_sdk/models/secret_list.py index 702a4e5a..f08a58b1 100644 --- a/rootly_sdk/models/secret_list.py +++ b/rootly_sdk/models/secret_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,28 +19,27 @@ class SecretList: """ Attributes: - data (list[SecretListDataItem]): - links (Links | Unset): - meta (Meta | Unset): + data (list['SecretListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): """ - data: list[SecretListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET + data: list["SecretListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -75,14 +72,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/secret_list_data_item.py b/rootly_sdk/models/secret_list_data_item.py index 31a72676..87fbca70 100644 --- a/rootly_sdk/models/secret_list_data_item.py +++ b/rootly_sdk/models/secret_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SecretListDataItem: id: str type_: SecretListDataItemType - attributes: Secret + attributes: "Secret" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/secret_response.py b/rootly_sdk/models/secret_response.py index 841888e2..d6359e52 100644 --- a/rootly_sdk/models/secret_response.py +++ b/rootly_sdk/models/secret_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class SecretResponse: data (SecretResponseData): """ - data: SecretResponseData + data: "SecretResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/secret_response_data.py b/rootly_sdk/models/secret_response_data.py index e7b5504d..2c776f8e 100644 --- a/rootly_sdk/models/secret_response_data.py +++ b/rootly_sdk/models/secret_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SecretResponseData: id: str type_: SecretResponseDataType - attributes: Secret + attributes: "Secret" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/send_dashboard_report_task_params.py b/rootly_sdk/models/send_dashboard_report_task_params.py index ee77ed07..66a38904 100644 --- a/rootly_sdk/models/send_dashboard_report_task_params.py +++ b/rootly_sdk/models/send_dashboard_report_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,20 +20,20 @@ class SendDashboardReportTaskParams: dashboard_ids (list[str]): to (list[str]): subject (str): The subject - body (None | str): The email body - task_type (SendDashboardReportTaskParamsTaskType | Unset): - from_ (str | Unset): The from email address. Need to use SMTP integration if different than rootly.com Default: - 'Rootly '. - preheader (None | str | Unset): The preheader + body (Union[None, str]): The email body + task_type (Union[Unset, SendDashboardReportTaskParamsTaskType]): + from_ (Union[Unset, str]): The from email address. Need to use SMTP integration if different than rootly.com + Default: 'Rootly '. + preheader (Union[None, Unset, str]): The preheader """ dashboard_ids: list[str] to: list[str] subject: str body: None | str - task_type: SendDashboardReportTaskParamsTaskType | Unset = UNSET - from_: str | Unset = "Rootly " - preheader: None | str | Unset = UNSET + task_type: Unset | SendDashboardReportTaskParamsTaskType = UNSET + from_: Unset | str = "Rootly " + preheader: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: body: None | str body = self.body - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - preheader: None | str | Unset + preheader: None | Unset | str if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -96,7 +94,7 @@ def _parse_body(data: object) -> None | str: body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: SendDashboardReportTaskParamsTaskType | Unset + task_type: Unset | SendDashboardReportTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -104,12 +102,12 @@ def _parse_body(data: object) -> None | str: from_ = d.pop("from", UNSET) - def _parse_preheader(data: object) -> None | str | Unset: + def _parse_preheader(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) preheader = _parse_preheader(d.pop("preheader", UNSET)) diff --git a/rootly_sdk/models/send_email_task_params.py b/rootly_sdk/models/send_email_task_params.py index 6e1d8cfc..4f63f560 100644 --- a/rootly_sdk/models/send_email_task_params.py +++ b/rootly_sdk/models/send_email_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,29 +19,29 @@ class SendEmailTaskParams: Attributes: to (list[str]): subject (str): The subject - body (None | str): The email body - task_type (SendEmailTaskParamsTaskType | Unset): - from_ (str | Unset): The from email address. Need to use SMTP integration if different than rootly.com Default: - 'Rootly '. - cc (list[str] | Unset): - bcc (list[str] | Unset): - preheader (None | str | Unset): The preheader - include_header (bool | Unset): - include_footer (bool | Unset): - custom_logo_url (None | str | Unset): URL to your custom email logo + body (Union[None, str]): The email body + task_type (Union[Unset, SendEmailTaskParamsTaskType]): + from_ (Union[Unset, str]): The from email address. Need to use SMTP integration if different than rootly.com + Default: 'Rootly '. + cc (Union[Unset, list[str]]): + bcc (Union[Unset, list[str]]): + preheader (Union[None, Unset, str]): The preheader + include_header (Union[Unset, bool]): + include_footer (Union[Unset, bool]): + custom_logo_url (Union[None, Unset, str]): URL to your custom email logo """ to: list[str] subject: str body: None | str - task_type: SendEmailTaskParamsTaskType | Unset = UNSET - from_: str | Unset = "Rootly " - cc: list[str] | Unset = UNSET - bcc: list[str] | Unset = UNSET - preheader: None | str | Unset = UNSET - include_header: bool | Unset = UNSET - include_footer: bool | Unset = UNSET - custom_logo_url: None | str | Unset = UNSET + task_type: Unset | SendEmailTaskParamsTaskType = UNSET + from_: Unset | str = "Rootly " + cc: Unset | list[str] = UNSET + bcc: Unset | list[str] = UNSET + preheader: None | Unset | str = UNSET + include_header: Unset | bool = UNSET + include_footer: Unset | bool = UNSET + custom_logo_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,21 +52,21 @@ def to_dict(self) -> dict[str, Any]: body: None | str body = self.body - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - cc: list[str] | Unset = UNSET + cc: Unset | list[str] = UNSET if not isinstance(self.cc, Unset): cc = self.cc - bcc: list[str] | Unset = UNSET + bcc: Unset | list[str] = UNSET if not isinstance(self.bcc, Unset): bcc = self.bcc - preheader: None | str | Unset + preheader: None | Unset | str if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: include_footer = self.include_footer - custom_logo_url: None | str | Unset + custom_logo_url: None | Unset | str if isinstance(self.custom_logo_url, Unset): custom_logo_url = UNSET else: @@ -127,7 +125,7 @@ def _parse_body(data: object) -> None | str: body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: SendEmailTaskParamsTaskType | Unset + task_type: Unset | SendEmailTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -139,12 +137,12 @@ def _parse_body(data: object) -> None | str: bcc = cast(list[str], d.pop("bcc", UNSET)) - def _parse_preheader(data: object) -> None | str | Unset: + def _parse_preheader(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) preheader = _parse_preheader(d.pop("preheader", UNSET)) @@ -152,12 +150,12 @@ def _parse_preheader(data: object) -> None | str | Unset: include_footer = d.pop("include_footer", UNSET) - def _parse_custom_logo_url(data: object) -> None | str | Unset: + def _parse_custom_logo_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_logo_url = _parse_custom_logo_url(d.pop("custom_logo_url", UNSET)) diff --git a/rootly_sdk/models/send_google_chat_attachments_task_params.py b/rootly_sdk/models/send_google_chat_attachments_task_params.py index dd445380..9b409f79 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,18 +23,17 @@ class SendGoogleChatAttachmentsTaskParams: """ Attributes: - spaces (list[SendGoogleChatAttachmentsTaskParamsSpacesItem]): + spaces (list['SendGoogleChatAttachmentsTaskParamsSpacesItem']): attachments (str): - task_type (SendGoogleChatAttachmentsTaskParamsTaskType | Unset): + task_type (Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType]): """ - spaces: list[SendGoogleChatAttachmentsTaskParamsSpacesItem] + spaces: list["SendGoogleChatAttachmentsTaskParamsSpacesItem"] attachments: str - task_type: SendGoogleChatAttachmentsTaskParamsTaskType | Unset = UNSET + task_type: Unset | SendGoogleChatAttachmentsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - spaces = [] for spaces_item_data in self.spaces: spaces_item = spaces_item_data.to_dict() @@ -44,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: attachments = self.attachments - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -78,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attachments = d.pop("attachments") _task_type = d.pop("task_type", UNSET) - task_type: SendGoogleChatAttachmentsTaskParamsTaskType | Unset + task_type: Unset | SendGoogleChatAttachmentsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py b/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py index 0b80e5f7..325dca5e 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendGoogleChatAttachmentsTaskParamsSpacesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_google_chat_message_task_params.py b/rootly_sdk/models/send_google_chat_message_task_params.py index db4a5839..800495c3 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params.py +++ b/rootly_sdk/models/send_google_chat_message_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -23,21 +21,20 @@ class SendGoogleChatMessageTaskParams: """ Attributes: - spaces (list[SendGoogleChatMessageTaskParamsSpacesItem]): + spaces (list['SendGoogleChatMessageTaskParamsSpacesItem']): text (str): - task_type (SendGoogleChatMessageTaskParamsTaskType | Unset): - thread_key (None | str | Unset): Thread key to reply within a thread. Messages with the same thread key are + task_type (Union[Unset, SendGoogleChatMessageTaskParamsTaskType]): + thread_key (Union[None, Unset, str]): Thread key to reply within a thread. Messages with the same thread key are grouped together """ - spaces: list[SendGoogleChatMessageTaskParamsSpacesItem] + spaces: list["SendGoogleChatMessageTaskParamsSpacesItem"] text: str - task_type: SendGoogleChatMessageTaskParamsTaskType | Unset = UNSET - thread_key: None | str | Unset = UNSET + task_type: Unset | SendGoogleChatMessageTaskParamsTaskType = UNSET + thread_key: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - spaces = [] for spaces_item_data in self.spaces: spaces_item = spaces_item_data.to_dict() @@ -45,11 +42,11 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - thread_key: None | str | Unset + thread_key: None | Unset | str if isinstance(self.thread_key, Unset): thread_key = UNSET else: @@ -85,18 +82,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text") _task_type = d.pop("task_type", UNSET) - task_type: SendGoogleChatMessageTaskParamsTaskType | Unset + task_type: Unset | SendGoogleChatMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_send_google_chat_message_task_params_task_type(_task_type) - def _parse_thread_key(data: object) -> None | str | Unset: + def _parse_thread_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) thread_key = _parse_thread_key(d.pop("thread_key", UNSET)) diff --git a/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py b/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py index 71a9a418..2d271390 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py +++ b/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendGoogleChatMessageTaskParamsSpacesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py b/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py index 6aa1da64..d0df8bde 100644 --- a/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendMicrosoftTeamsBlocksTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py index 9fe2be40..a0c00b13 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,18 +23,17 @@ class SendMicrosoftTeamsChatMessageTaskParams: """ Attributes: - chats (list[SendMicrosoftTeamsChatMessageTaskParamsChatsItem]): + chats (list['SendMicrosoftTeamsChatMessageTaskParamsChatsItem']): text (str): The message text - task_type (SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset): + task_type (Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType]): """ - chats: list[SendMicrosoftTeamsChatMessageTaskParamsChatsItem] + chats: list["SendMicrosoftTeamsChatMessageTaskParamsChatsItem"] text: str - task_type: SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset = UNSET + task_type: Unset | SendMicrosoftTeamsChatMessageTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - chats = [] for chats_item_data in self.chats: chats_item = chats_item_data.to_dict() @@ -44,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -78,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text") _task_type = d.pop("task_type", UNSET) - task_type: SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset + task_type: Unset | SendMicrosoftTeamsChatMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py index b5eb86bf..79ad0464 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendMicrosoftTeamsChatMessageTaskParamsChatsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py b/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py index 62d56aa3..4d1cc584 100644 --- a/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendMicrosoftTeamsMessageTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py index 1d13245f..9ac42fea 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendSlackBlocksTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py index fb401ba9..c5f42e8d 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendSlackBlocksTaskParamsType1SlackUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py index 54a82d43..15cbd40a 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendSlackBlocksTaskParamsType2SlackUserGroupsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py b/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py index 07a0fed2..ed01664b 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendSlackMessageTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py b/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py index 7aa7cd68..59d8c659 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendSlackMessageTaskParamsType1SlackUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py b/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py index 8a055aa3..642e8eb2 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SendSlackMessageTaskParamsType2SlackUserGroupsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_sms_task_params.py b/rootly_sdk/models/send_sms_task_params.py index 188935ea..a7013664 100644 --- a/rootly_sdk/models/send_sms_task_params.py +++ b/rootly_sdk/models/send_sms_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,13 +17,13 @@ class SendSmsTaskParams: phone_numbers (list[str]): name (str): The name content (str): The SMS message - task_type (SendSmsTaskParamsTaskType | Unset): + task_type (Union[Unset, SendSmsTaskParamsTaskType]): """ phone_numbers: list[str] name: str content: str - task_type: SendSmsTaskParamsTaskType | Unset = UNSET + task_type: Unset | SendSmsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: SendSmsTaskParamsTaskType | Unset + task_type: Unset | SendSmsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_whatsapp_message_task_params.py b/rootly_sdk/models/send_whatsapp_message_task_params.py index ba3492e7..afc93d42 100644 --- a/rootly_sdk/models/send_whatsapp_message_task_params.py +++ b/rootly_sdk/models/send_whatsapp_message_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,13 +20,13 @@ class SendWhatsappMessageTaskParams: phone_numbers (list[str]): name (str): The name content (str): The WhatsApp message - task_type (SendWhatsappMessageTaskParamsTaskType | Unset): + task_type (Union[Unset, SendWhatsappMessageTaskParamsTaskType]): """ phone_numbers: list[str] name: str content: str - task_type: SendWhatsappMessageTaskParamsTaskType | Unset = UNSET + task_type: Unset | SendWhatsappMessageTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: SendWhatsappMessageTaskParamsTaskType | Unset + task_type: Unset | SendWhatsappMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/service.py b/rootly_sdk/models/service.py index 78237e7e..9dbc0f56 100644 --- a/rootly_sdk/models/service.py +++ b/rootly_sdk/models/service.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,83 +25,88 @@ class Service: name (str): The name of the service created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the service - managed_by (ServiceManagedBy | Unset): How this service is managed (provenance): web, api, terraform, etc. Read- - only. - description (None | str | Unset): The description of the service - public_description (None | str | Unset): The public description of the service - notify_emails (list[str] | None | Unset): Emails attached to the service - color (None | str | Unset): The hex color of the service - position (int | None | Unset): Position of the service - backstage_id (None | str | Unset): The Backstage entity id associated to this service. eg: + slug (Union[Unset, str]): The slug of the service + managed_by (Union[Unset, ServiceManagedBy]): How this service is managed (provenance): web, api, terraform, etc. + Read-only. + description (Union[None, Unset, str]): The description of the service + public_description (Union[None, Unset, str]): The status page description of the service + notify_emails (Union[None, Unset, list[str]]): Emails attached to the service + color (Union[None, Unset, str]): The hex color of the service + position (Union[None, Unset, int]): Position of the service + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this service. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this service - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this service - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this service - cortex_id (None | str | Unset): The Cortex group id associated to this service - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this service - github_repository_name (None | str | Unset): The GitHub repository name associated to this service. eg: + external_id (Union[None, Unset, str]): The external id associated to this service + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this service + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this service + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this service + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this service + github_repository_name (Union[None, Unset, str]): The GitHub repository name associated to this service. eg: rootlyhq/my-service - github_repository_branch (None | str | Unset): The GitHub repository branch associated to this service. eg: main - gitlab_repository_name (None | str | Unset): The GitLab repository name associated to this service. eg: + github_repository_branch (Union[None, Unset, str]): The GitHub repository branch associated to this service. eg: + main + gitlab_repository_name (Union[None, Unset, str]): The GitLab repository name associated to this service. eg: rootlyhq/my-service - gitlab_repository_branch (None | str | Unset): The GitLab repository branch associated to this service. eg: main - kubernetes_deployment_name (None | str | Unset): The Kubernetes deployment name associated to this service. eg: - namespace/deployment-name - environment_ids (list[str] | None | Unset): Environments associated with this service - service_ids (list[str] | None | Unset): Services dependent on this service - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this service - owner_user_ids (list[int] | None | Unset): Owner Users associated with this service - alert_urgency_id (None | str | Unset): The alert urgency id of the service - escalation_policy_id (None | str | Unset): The escalation policy id of the service - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alerts_email_address (None | str | Unset): Email generated to send alerts to - slack_channels (list[ServiceSlackChannelsType0Item] | None | Unset): Slack Channels associated with this service - slack_aliases (list[ServiceSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this service - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | ServiceAlertBroadcastChannelType0 | Unset): Slack channel to broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | ServiceIncidentBroadcastChannelType0 | Unset): Slack channel to broadcast - incidents to - properties (list[ServicePropertiesType0Item] | None | Unset): Array of property values for this service. + gitlab_repository_branch (Union[None, Unset, str]): The GitLab repository branch associated to this service. eg: + main + kubernetes_deployment_name (Union[None, Unset, str]): The Kubernetes deployment name associated to this service. + eg: namespace/deployment-name + environment_ids (Union[None, Unset, list[str]]): Environments associated with this service + service_ids (Union[None, Unset, list[str]]): Services dependent on this service + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this service + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this service + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the service + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the service + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alerts_email_address (Union[None, Unset, str]): Email generated to send alerts to + slack_channels (Union[None, Unset, list['ServiceSlackChannelsType0Item']]): Slack Channels associated with this + service + slack_aliases (Union[None, Unset, list['ServiceSlackAliasesType0Item']]): Slack Aliases associated with this + service + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['ServiceAlertBroadcastChannelType0', None, Unset]): Slack channel to broadcast + alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['ServiceIncidentBroadcastChannelType0', None, Unset]): Slack channel to + broadcast incidents to + properties (Union[None, Unset, list['ServicePropertiesType0Item']]): Array of property values for this service. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: ServiceManagedBy | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alerts_email_address: None | str | Unset = UNSET - slack_channels: list[ServiceSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[ServiceSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | ServiceAlertBroadcastChannelType0 | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | ServiceIncidentBroadcastChannelType0 | Unset = UNSET - properties: list[ServicePropertiesType0Item] | None | Unset = UNSET + slug: Unset | str = UNSET + managed_by: Unset | ServiceManagedBy = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + alert_urgency_id: None | Unset | str = UNSET + escalation_policy_id: None | Unset | str = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alerts_email_address: None | Unset | str = UNSET + slack_channels: None | Unset | list["ServiceSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["ServiceSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET + alert_broadcast_channel: Union["ServiceAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET + incident_broadcast_channel: Union["ServiceIncidentBroadcastChannelType0", None, Unset] = UNSET + properties: None | Unset | list["ServicePropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -118,23 +121,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -143,85 +146,85 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: None | str | Unset + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -230,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -239,7 +242,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -248,7 +251,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -257,31 +260,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | str | Unset + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: None | str | Unset + alerts_email_address: None | Unset | str if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -293,7 +296,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -305,13 +308,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, ServiceAlertBroadcastChannelType0): @@ -319,13 +322,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, ServiceIncidentBroadcastChannelType0): @@ -333,7 +336,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: list[dict[str, Any]] | None | Unset + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -441,31 +444,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: ServiceManagedBy | Unset + managed_by: Unset | ServiceManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_service_managed_by(_managed_by) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -476,130 +479,130 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -610,13 +613,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -627,13 +630,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -644,13 +647,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -661,49 +664,49 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> None | str | Unset: + def _parse_alerts_email_address(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_slack_channels(data: object) -> list[ServiceSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> None | Unset | list["ServiceSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -721,13 +724,13 @@ def _parse_slack_channels(data: object) -> list[ServiceSlackChannelsType0Item] | slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServiceSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["ServiceSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[ServiceSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> None | Unset | list["ServiceSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -743,22 +746,22 @@ def _parse_slack_aliases(data: object) -> list[ServiceSlackAliasesType0Item] | N slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServiceSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["ServiceSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) - def _parse_alert_broadcast_channel(data: object) -> None | ServiceAlertBroadcastChannelType0 | Unset: + def _parse_alert_broadcast_channel(data: object) -> Union["ServiceAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -769,22 +772,24 @@ def _parse_alert_broadcast_channel(data: object) -> None | ServiceAlertBroadcast alert_broadcast_channel_type_0 = ServiceAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ServiceAlertBroadcastChannelType0 | Unset, data) + return cast(Union["ServiceAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) - def _parse_incident_broadcast_channel(data: object) -> None | ServiceIncidentBroadcastChannelType0 | Unset: + def _parse_incident_broadcast_channel( + data: object, + ) -> Union["ServiceIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -795,13 +800,13 @@ def _parse_incident_broadcast_channel(data: object) -> None | ServiceIncidentBro incident_broadcast_channel_type_0 = ServiceIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ServiceIncidentBroadcastChannelType0 | Unset, data) + return cast(Union["ServiceIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_properties(data: object) -> list[ServicePropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> None | Unset | list["ServicePropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -817,9 +822,9 @@ def _parse_properties(data: object) -> list[ServicePropertiesType0Item] | None | properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServicePropertiesType0Item] | None | Unset, data) + return cast(None | Unset | list["ServicePropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py index 352191db..c8429803 100644 --- a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class ServiceAlertBroadcastChannelType0: """Slack channel to broadcast alerts to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py index d5173bde..801815e9 100644 --- a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class ServiceIncidentBroadcastChannelType0: """Slack channel to broadcast incidents to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/service_list.py b/rootly_sdk/models/service_list.py index b5abbabc..5cde24ed 100644 --- a/rootly_sdk/models/service_list.py +++ b/rootly_sdk/models/service_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class ServiceList: """ Attributes: - data (list[ServiceListDataItem]): + data (list['ServiceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ServiceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ServiceListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) service_list = cls( data=data, diff --git a/rootly_sdk/models/service_list_data_item.py b/rootly_sdk/models/service_list_data_item.py index 9134e55d..07946659 100644 --- a/rootly_sdk/models/service_list_data_item.py +++ b/rootly_sdk/models/service_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ServiceListDataItem: id: str type_: ServiceListDataItemType - attributes: Service + attributes: "Service" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/service_properties_type_0_item.py b/rootly_sdk/models/service_properties_type_0_item.py index ca3eadbd..c674b2b6 100644 --- a/rootly_sdk/models/service_properties_type_0_item.py +++ b/rootly_sdk/models/service_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/service_response.py b/rootly_sdk/models/service_response.py index 3309f183..645fe2d2 100644 --- a/rootly_sdk/models/service_response.py +++ b/rootly_sdk/models/service_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ServiceResponse: """ Attributes: data (ServiceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ServiceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ServiceResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ServiceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) service_response = cls( data=data, diff --git a/rootly_sdk/models/service_response_data.py b/rootly_sdk/models/service_response_data.py index 0ebacacd..a94a16d4 100644 --- a/rootly_sdk/models/service_response_data.py +++ b/rootly_sdk/models/service_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ServiceResponseData: id: str type_: ServiceResponseDataType - attributes: Service + attributes: "Service" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/service_slack_aliases_type_0_item.py b/rootly_sdk/models/service_slack_aliases_type_0_item.py index 9349bda9..e4b5ebfb 100644 --- a/rootly_sdk/models/service_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/service_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/service_slack_channels_type_0_item.py b/rootly_sdk/models/service_slack_channels_type_0_item.py index a86a7471..0a61b094 100644 --- a/rootly_sdk/models/service_slack_channels_type_0_item.py +++ b/rootly_sdk/models/service_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/severity.py b/rootly_sdk/models/severity.py index 7e2ec960..91ec5e93 100644 --- a/rootly_sdk/models/severity.py +++ b/rootly_sdk/models/severity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,32 +22,32 @@ class Severity: name (str): The name of the severity created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the severity - description (None | str | Unset): The description of the severity - severity (SeveritySeverity | Unset): The severity of the severity - color (None | str | Unset): The hex color of the severity - position (int | None | Unset): Position of the severity - notify_emails (list[str] | None | Unset): Emails to attach to the severity - slack_channels (list[SeveritySlackChannelsType0Item] | None | Unset): Slack Channels associated with this + slug (Union[Unset, str]): The slug of the severity + description (Union[None, Unset, str]): The description of the severity + severity (Union[Unset, SeveritySeverity]): The severity of the severity + color (Union[None, Unset, str]): The hex color of the severity + position (Union[None, Unset, int]): Position of the severity + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the severity + slack_channels (Union[None, Unset, list['SeveritySlackChannelsType0Item']]): Slack Channels associated with this + severity + slack_aliases (Union[None, Unset, list['SeveritySlackAliasesType0Item']]): Slack Aliases associated with this severity - slack_aliases (list[SeveritySlackAliasesType0Item] | None | Unset): Slack Aliases associated with this severity """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - severity: SeveritySeverity | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[SeveritySlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[SeveritySlackAliasesType0Item] | None | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + severity: Unset | SeveritySeverity = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["SeveritySlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["SeveritySlackAliasesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -58,29 +56,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: str | Unset = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -89,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -101,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -155,41 +153,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: SeveritySeverity | Unset + severity: Unset | SeveritySeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_severity_severity(_severity) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -200,13 +198,13 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> list[SeveritySlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> None | Unset | list["SeveritySlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -224,13 +222,13 @@ def _parse_slack_channels(data: object) -> list[SeveritySlackChannelsType0Item] slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[SeveritySlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["SeveritySlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[SeveritySlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> None | Unset | list["SeveritySlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -246,9 +244,9 @@ def _parse_slack_aliases(data: object) -> list[SeveritySlackAliasesType0Item] | slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[SeveritySlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["SeveritySlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/severity_list.py b/rootly_sdk/models/severity_list.py index fbde9c29..efdf692d 100644 --- a/rootly_sdk/models/severity_list.py +++ b/rootly_sdk/models/severity_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class SeverityList: """ Attributes: - data (list[SeverityListDataItem]): + data (list['SeverityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[SeverityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["SeverityListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) severity_list = cls( data=data, diff --git a/rootly_sdk/models/severity_list_data_item.py b/rootly_sdk/models/severity_list_data_item.py index c720e231..75581779 100644 --- a/rootly_sdk/models/severity_list_data_item.py +++ b/rootly_sdk/models/severity_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SeverityListDataItem: id: str type_: SeverityListDataItemType - attributes: Severity + attributes: "Severity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/severity_response.py b/rootly_sdk/models/severity_response.py index 46d0252d..9c282bba 100644 --- a/rootly_sdk/models/severity_response.py +++ b/rootly_sdk/models/severity_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class SeverityResponse: """ Attributes: data (SeverityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: SeverityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "SeverityResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = SeverityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) severity_response = cls( data=data, diff --git a/rootly_sdk/models/severity_response_data.py b/rootly_sdk/models/severity_response_data.py index 9382039a..45ad1467 100644 --- a/rootly_sdk/models/severity_response_data.py +++ b/rootly_sdk/models/severity_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SeverityResponseData: id: str type_: SeverityResponseDataType - attributes: Severity + attributes: "Severity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/severity_slack_aliases_type_0_item.py b/rootly_sdk/models/severity_slack_aliases_type_0_item.py index d7ac6e2f..62f76e97 100644 --- a/rootly_sdk/models/severity_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/severity_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/severity_slack_channels_type_0_item.py b/rootly_sdk/models/severity_slack_channels_type_0_item.py index 6412d29a..38119176 100644 --- a/rootly_sdk/models/severity_slack_channels_type_0_item.py +++ b/rootly_sdk/models/severity_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/shift.py b/rootly_sdk/models/shift.py index 2243e08f..bc776d7d 100644 --- a/rootly_sdk/models/shift.py +++ b/rootly_sdk/models/shift.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,12 +14,12 @@ class Shift: """ Attributes: schedule_id (str): ID of schedule - rotation_id (None | str): ID of rotation + rotation_id (Union[None, str]): ID of rotation starts_at (str): Start datetime of shift ends_at (str): End datetime of shift is_override (bool): Denotes shift is an override shift is_shadow (bool): Denotes shift is a shadow shift - user_id (int | None | Unset): ID of user on shift + user_id (Union[None, Unset, int]): ID of user on shift """ schedule_id: str @@ -30,7 +28,7 @@ class Shift: ends_at: str is_override: bool is_shadow: bool - user_id: int | None | Unset = UNSET + user_id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: is_shadow = self.is_shadow - user_id: int | None | Unset + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: @@ -90,12 +88,12 @@ def _parse_rotation_id(data: object) -> None | str: is_shadow = d.pop("is_shadow") - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) diff --git a/rootly_sdk/models/shift_coverage_request.py b/rootly_sdk/models/shift_coverage_request.py index 88ab9880..79e36899 100644 --- a/rootly_sdk/models/shift_coverage_request.py +++ b/rootly_sdk/models/shift_coverage_request.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,12 +25,12 @@ class ShiftCoverageRequest: created_by_user_id (int): ID of the user who created the coverage request starts_at (str): Start datetime of the coverage request ends_at (str): End datetime of the coverage request - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - schedule (ScheduleResponse | Unset): - shift (Shift | Unset): - original_shift_user (UserResponse | Unset): - created_by_user (UserResponse | Unset): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + schedule (Union[Unset, ScheduleResponse]): + shift (Union[Unset, Shift]): + original_shift_user (Union[Unset, UserResponse]): + created_by_user (Union[Unset, UserResponse]): """ schedule_id: str @@ -41,16 +39,15 @@ class ShiftCoverageRequest: created_by_user_id: int starts_at: str ends_at: str - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - schedule: ScheduleResponse | Unset = UNSET - shift: Shift | Unset = UNSET - original_shift_user: UserResponse | Unset = UNSET - created_by_user: UserResponse | Unset = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET + schedule: Union[Unset, "ScheduleResponse"] = UNSET + shift: Union[Unset, "Shift"] = UNSET + original_shift_user: Union[Unset, "UserResponse"] = UNSET + created_by_user: Union[Unset, "UserResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - schedule_id = self.schedule_id shift_id = self.shift_id @@ -67,19 +64,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - schedule: dict[str, Any] | Unset = UNSET + schedule: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - shift: dict[str, Any] | Unset = UNSET + shift: Unset | dict[str, Any] = UNSET if not isinstance(self.shift, Unset): shift = self.shift.to_dict() - original_shift_user: dict[str, Any] | Unset = UNSET + original_shift_user: Unset | dict[str, Any] = UNSET if not isinstance(self.original_shift_user, Unset): original_shift_user = self.original_shift_user.to_dict() - created_by_user: dict[str, Any] | Unset = UNSET + created_by_user: Unset | dict[str, Any] = UNSET if not isinstance(self.created_by_user, Unset): created_by_user = self.created_by_user.to_dict() @@ -134,28 +131,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at", UNSET) _schedule = d.pop("schedule", UNSET) - schedule: ScheduleResponse | Unset + schedule: Unset | ScheduleResponse if isinstance(_schedule, Unset): schedule = UNSET else: schedule = ScheduleResponse.from_dict(_schedule) _shift = d.pop("shift", UNSET) - shift: Shift | Unset + shift: Unset | Shift if isinstance(_shift, Unset): shift = UNSET else: shift = Shift.from_dict(_shift) _original_shift_user = d.pop("original_shift_user", UNSET) - original_shift_user: UserResponse | Unset + original_shift_user: Unset | UserResponse if isinstance(_original_shift_user, Unset): original_shift_user = UNSET else: original_shift_user = UserResponse.from_dict(_original_shift_user) _created_by_user = d.pop("created_by_user", UNSET) - created_by_user: UserResponse | Unset + created_by_user: Unset | UserResponse if isinstance(_created_by_user, Unset): created_by_user = UNSET else: diff --git a/rootly_sdk/models/shift_coverage_request_list.py b/rootly_sdk/models/shift_coverage_request_list.py index 59327bd2..2b73e0c5 100644 --- a/rootly_sdk/models/shift_coverage_request_list.py +++ b/rootly_sdk/models/shift_coverage_request_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class ShiftCoverageRequestList: """ Attributes: - data (list[ShiftCoverageRequestListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['ShiftCoverageRequestListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ShiftCoverageRequestListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ShiftCoverageRequestListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_coverage_request_list = cls( data=data, diff --git a/rootly_sdk/models/shift_coverage_request_list_data_item.py b/rootly_sdk/models/shift_coverage_request_list_data_item.py index a7c95baa..a919ad5e 100644 --- a/rootly_sdk/models/shift_coverage_request_list_data_item.py +++ b/rootly_sdk/models/shift_coverage_request_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ShiftCoverageRequestListDataItem: id: str type_: ShiftCoverageRequestListDataItemType - attributes: ShiftCoverageRequest + attributes: "ShiftCoverageRequest" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/shift_coverage_request_response.py b/rootly_sdk/models/shift_coverage_request_response.py index 8157d142..33e4ac04 100644 --- a/rootly_sdk/models/shift_coverage_request_response.py +++ b/rootly_sdk/models/shift_coverage_request_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ShiftCoverageRequestResponse: """ Attributes: data (ShiftCoverageRequestResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ShiftCoverageRequestResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ShiftCoverageRequestResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ShiftCoverageRequestResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_coverage_request_response = cls( data=data, diff --git a/rootly_sdk/models/shift_coverage_request_response_data.py b/rootly_sdk/models/shift_coverage_request_response_data.py index e81cffef..367166f5 100644 --- a/rootly_sdk/models/shift_coverage_request_response_data.py +++ b/rootly_sdk/models/shift_coverage_request_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ShiftCoverageRequestResponseData: id: str type_: ShiftCoverageRequestResponseDataType - attributes: ShiftCoverageRequest + attributes: "ShiftCoverageRequest" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/shift_list.py b/rootly_sdk/models/shift_list.py index 211abcdd..29673dab 100644 --- a/rootly_sdk/models/shift_list.py +++ b/rootly_sdk/models/shift_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,28 +19,27 @@ class ShiftList: """ Attributes: - data (list[ShiftListDataItem]): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['ShiftListDataItem']): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ShiftListDataItem] - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ShiftListDataItem"] + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -78,20 +75,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_list = cls( data=data, diff --git a/rootly_sdk/models/shift_list_data_item.py b/rootly_sdk/models/shift_list_data_item.py index fb83466c..430d4e47 100644 --- a/rootly_sdk/models/shift_list_data_item.py +++ b/rootly_sdk/models/shift_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class ShiftListDataItem: id (str): Unique ID of the shift type_ (ShiftListDataItemType): attributes (Shift): - relationships (ShiftRelationships | Unset): + relationships (Union[Unset, ShiftRelationships]): """ id: str type_: ShiftListDataItemType - attributes: Shift - relationships: ShiftRelationships | Unset = UNSET + attributes: "Shift" + relationships: Union[Unset, "ShiftRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = Shift.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: ShiftRelationships | Unset + relationships: Unset | ShiftRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/shift_override.py b/rootly_sdk/models/shift_override.py index b96b91fe..93b17a4c 100644 --- a/rootly_sdk/models/shift_override.py +++ b/rootly_sdk/models/shift_override.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +15,14 @@ class ShiftOverride: Attributes: shift_id (str): ID of shift created_by_user_id (int): User who created the override - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ shift_id: str created_by_user_id: int - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/shift_override_response.py b/rootly_sdk/models/shift_override_response.py index ee694604..4c8f6d9d 100644 --- a/rootly_sdk/models/shift_override_response.py +++ b/rootly_sdk/models/shift_override_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class ShiftOverrideResponse: """ Attributes: data (ShiftOverrideResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ShiftOverrideResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ShiftOverrideResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ShiftOverrideResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_override_response = cls( data=data, diff --git a/rootly_sdk/models/shift_override_response_data.py b/rootly_sdk/models/shift_override_response_data.py index c49176ef..30c2fcd8 100644 --- a/rootly_sdk/models/shift_override_response_data.py +++ b/rootly_sdk/models/shift_override_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ShiftOverrideResponseData: id: str type_: ShiftOverrideResponseDataType - attributes: ShiftOverride + attributes: "ShiftOverride" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/shift_relationships.py b/rootly_sdk/models/shift_relationships.py index bd1f2776..0c6fc19b 100644 --- a/rootly_sdk/models/shift_relationships.py +++ b/rootly_sdk/models/shift_relationships.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,27 +19,26 @@ class ShiftRelationships: """ Attributes: - shift_override (ShiftRelationshipsShiftOverride | Unset): - user (ShiftRelationshipsUser | Unset): - assignee (ShiftRelationshipsAssignee | Unset): Assignee can be either a User or Schedule + shift_override (Union[Unset, ShiftRelationshipsShiftOverride]): + user (Union[Unset, ShiftRelationshipsUser]): + assignee (Union[Unset, ShiftRelationshipsAssignee]): Assignee can be either a User or Schedule """ - shift_override: ShiftRelationshipsShiftOverride | Unset = UNSET - user: ShiftRelationshipsUser | Unset = UNSET - assignee: ShiftRelationshipsAssignee | Unset = UNSET + shift_override: Union[Unset, "ShiftRelationshipsShiftOverride"] = UNSET + user: Union[Unset, "ShiftRelationshipsUser"] = UNSET + assignee: Union[Unset, "ShiftRelationshipsAssignee"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - shift_override: dict[str, Any] | Unset = UNSET + shift_override: Unset | dict[str, Any] = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() - user: dict[str, Any] | Unset = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - assignee: dict[str, Any] | Unset = UNSET + assignee: Unset | dict[str, Any] = UNSET if not isinstance(self.assignee, Unset): assignee = self.assignee.to_dict() @@ -65,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _shift_override = d.pop("shift_override", UNSET) - shift_override: ShiftRelationshipsShiftOverride | Unset + shift_override: Unset | ShiftRelationshipsShiftOverride if isinstance(_shift_override, Unset): shift_override = UNSET else: shift_override = ShiftRelationshipsShiftOverride.from_dict(_shift_override) _user = d.pop("user", UNSET) - user: ShiftRelationshipsUser | Unset + user: Unset | ShiftRelationshipsUser if isinstance(_user, Unset): user = UNSET else: user = ShiftRelationshipsUser.from_dict(_user) _assignee = d.pop("assignee", UNSET) - assignee: ShiftRelationshipsAssignee | Unset + assignee: Unset | ShiftRelationshipsAssignee if isinstance(_assignee, Unset): assignee = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_assignee.py b/rootly_sdk/models/shift_relationships_assignee.py index 8c75aa9a..fc798a60 100644 --- a/rootly_sdk/models/shift_relationships_assignee.py +++ b/rootly_sdk/models/shift_relationships_assignee.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +18,16 @@ class ShiftRelationshipsAssignee: """Assignee can be either a User or Schedule Attributes: - data (None | ShiftRelationshipsAssigneeDataType0 | Unset): + data (Union['ShiftRelationshipsAssigneeDataType0', None, Unset]): """ - data: None | ShiftRelationshipsAssigneeDataType0 | Unset = UNSET + data: Union["ShiftRelationshipsAssigneeDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_assignee_data_type_0 import ShiftRelationshipsAssigneeDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsAssigneeDataType0): @@ -51,7 +49,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | ShiftRelationshipsAssigneeDataType0 | Unset: + def _parse_data(data: object) -> Union["ShiftRelationshipsAssigneeDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -62,9 +60,9 @@ def _parse_data(data: object) -> None | ShiftRelationshipsAssigneeDataType0 | Un data_type_0 = ShiftRelationshipsAssigneeDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ShiftRelationshipsAssigneeDataType0 | Unset, data) + return cast(Union["ShiftRelationshipsAssigneeDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py index 6d1a4577..aeb1080c 100644 --- a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class ShiftRelationshipsAssigneeDataType0: """ Attributes: - id (str | Unset): - type_ (str | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, str]): """ - id: str | Unset = UNSET - type_: str | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/shift_relationships_shift_override.py b/rootly_sdk/models/shift_relationships_shift_override.py index 843e25e3..d90fc42e 100644 --- a/rootly_sdk/models/shift_relationships_shift_override.py +++ b/rootly_sdk/models/shift_relationships_shift_override.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class ShiftRelationshipsShiftOverride: """ Attributes: - data (None | ShiftRelationshipsShiftOverrideDataType0 | Unset): + data (Union['ShiftRelationshipsShiftOverrideDataType0', None, Unset]): """ - data: None | ShiftRelationshipsShiftOverrideDataType0 | Unset = UNSET + data: Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_shift_override_data_type_0 import ShiftRelationshipsShiftOverrideDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsShiftOverrideDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | ShiftRelationshipsShiftOverrideDataType0 | Unset: + def _parse_data(data: object) -> Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | ShiftRelationshipsShiftOverrideDataType0 data_type_0 = ShiftRelationshipsShiftOverrideDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ShiftRelationshipsShiftOverrideDataType0 | Unset, data) + return cast(Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py b/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py index d5650162..914df41a 100644 --- a/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class ShiftRelationshipsShiftOverrideDataType0: """ Attributes: - id (str | Unset): - type_ (ShiftRelationshipsShiftOverrideDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type]): """ - id: str | Unset = UNSET - type_: ShiftRelationshipsShiftOverrideDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | ShiftRelationshipsShiftOverrideDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: ShiftRelationshipsShiftOverrideDataType0Type | Unset + type_: Unset | ShiftRelationshipsShiftOverrideDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_user.py b/rootly_sdk/models/shift_relationships_user.py index 0e550589..b8b6e5f6 100644 --- a/rootly_sdk/models/shift_relationships_user.py +++ b/rootly_sdk/models/shift_relationships_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class ShiftRelationshipsUser: """ Attributes: - data (None | ShiftRelationshipsUserDataType0 | Unset): + data (Union['ShiftRelationshipsUserDataType0', None, Unset]): """ - data: None | ShiftRelationshipsUserDataType0 | Unset = UNSET + data: Union["ShiftRelationshipsUserDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_user_data_type_0 import ShiftRelationshipsUserDataType0 - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsUserDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | ShiftRelationshipsUserDataType0 | Unset: + def _parse_data(data: object) -> Union["ShiftRelationshipsUserDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | ShiftRelationshipsUserDataType0 | Unset: data_type_0 = ShiftRelationshipsUserDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ShiftRelationshipsUserDataType0 | Unset, data) + return cast(Union["ShiftRelationshipsUserDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/shift_relationships_user_data_type_0.py b/rootly_sdk/models/shift_relationships_user_data_type_0.py index edc4b248..d7a7fea9 100644 --- a/rootly_sdk/models/shift_relationships_user_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_user_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,18 +17,18 @@ class ShiftRelationshipsUserDataType0: """ Attributes: - id (str | Unset): - type_ (ShiftRelationshipsUserDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, ShiftRelationshipsUserDataType0Type]): """ - id: str | Unset = UNSET - type_: ShiftRelationshipsUserDataType0Type | Unset = UNSET + id: Unset | str = UNSET + type_: Unset | ShiftRelationshipsUserDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: ShiftRelationshipsUserDataType0Type | Unset + type_: Unset | ShiftRelationshipsUserDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/simple_trigger_params.py b/rootly_sdk/models/simple_trigger_params.py index 75b0f282..de2934e1 100644 --- a/rootly_sdk/models/simple_trigger_params.py +++ b/rootly_sdk/models/simple_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -24,17 +22,17 @@ class SimpleTriggerParams: """ Attributes: trigger_type (SimpleTriggerParamsTriggerType): - triggers (list[SimpleTriggerParamsTriggersItem] | Unset): + triggers (Union[Unset, list[SimpleTriggerParamsTriggersItem]]): """ trigger_type: SimpleTriggerParamsTriggerType - triggers: list[SimpleTriggerParamsTriggersItem] | Unset = UNSET + triggers: Unset | list[SimpleTriggerParamsTriggersItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: @@ -58,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) trigger_type = check_simple_trigger_params_trigger_type(d.pop("trigger_type")) + triggers = [] _triggers = d.pop("triggers", UNSET) - triggers: list[SimpleTriggerParamsTriggersItem] | Unset = UNSET - if _triggers is not UNSET: - triggers = [] - for triggers_item_data in _triggers: - triggers_item = check_simple_trigger_params_triggers_item(triggers_item_data) + for triggers_item_data in _triggers or []: + triggers_item = check_simple_trigger_params_triggers_item(triggers_item_data) - triggers.append(triggers_item) + triggers.append(triggers_item) simple_trigger_params = cls( trigger_type=trigger_type, diff --git a/rootly_sdk/models/sla.py b/rootly_sdk/models/sla.py index cd69fc88..97f74a91 100644 --- a/rootly_sdk/models/sla.py +++ b/rootly_sdk/models/sla.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -31,22 +29,23 @@ class Sla: completion_deadline_parent_status (str): The incident parent status that triggers the completion deadline created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the SLA - description (None | str | Unset): A description of the SLA - position (int | Unset): Position of the SLA for ordering - entity_type (SlaEntityType | Unset): The entity type this SLA applies to - manager_role_id (None | Unset | UUID): The ID of the manager incident role. Exactly one of `manager_role_id` or - `manager_user_id` must be provided. - manager_user_id (int | None | Unset): The ID of the manager user. Exactly one of `manager_role_id` or + slug (Union[Unset, str]): The slug of the SLA + description (Union[None, Unset, str]): A description of the SLA + position (Union[Unset, int]): Position of the SLA for ordering + entity_type (Union[Unset, SlaEntityType]): The entity type this SLA applies to + manager_role_id (Union[None, UUID, Unset]): The ID of the manager incident role. Exactly one of + `manager_role_id` or `manager_user_id` must be provided. + manager_user_id (Union[None, Unset, int]): The ID of the manager user. Exactly one of `manager_role_id` or `manager_user_id` must be provided. - assignment_deadline_sub_status_id (None | Unset | UUID): Sub-status for the assignment deadline. Required when - custom lifecycle statuses are enabled on the team. - assignment_skip_weekends (bool | Unset): Whether to skip weekends when calculating the assignment deadline - completion_deadline_sub_status_id (None | Unset | UUID): Sub-status for the completion deadline. Required when - custom lifecycle statuses are enabled on the team. - completion_skip_weekends (bool | Unset): Whether to skip weekends when calculating the completion deadline - conditions (list[SlaConditionsItem] | Unset): Conditions that determine which incidents this SLA applies to - notification_configurations (list[SlaNotificationConfigurationsItem] | Unset): Notification timing + assignment_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the assignment deadline. Required + when custom lifecycle statuses are enabled on the team. + assignment_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the assignment deadline + completion_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the completion deadline. Required + when custom lifecycle statuses are enabled on the team. + completion_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the completion deadline + conditions (Union[Unset, list['SlaConditionsItem']]): Conditions that determine which incidents this SLA applies + to + notification_configurations (Union[Unset, list['SlaNotificationConfigurationsItem']]): Notification timing configurations """ @@ -58,22 +57,21 @@ class Sla: completion_deadline_parent_status: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | Unset = UNSET - entity_type: SlaEntityType | Unset = UNSET - manager_role_id: None | Unset | UUID = UNSET - manager_user_id: int | None | Unset = UNSET - assignment_deadline_sub_status_id: None | Unset | UUID = UNSET - assignment_skip_weekends: bool | Unset = UNSET - completion_deadline_sub_status_id: None | Unset | UUID = UNSET - completion_skip_weekends: bool | Unset = UNSET - conditions: list[SlaConditionsItem] | Unset = UNSET - notification_configurations: list[SlaNotificationConfigurationsItem] | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + position: Unset | int = UNSET + entity_type: Unset | SlaEntityType = UNSET + manager_role_id: None | UUID | Unset = UNSET + manager_user_id: None | Unset | int = UNSET + assignment_deadline_sub_status_id: None | UUID | Unset = UNSET + assignment_skip_weekends: Unset | bool = UNSET + completion_deadline_sub_status_id: None | UUID | Unset = UNSET + completion_skip_weekends: Unset | bool = UNSET + conditions: Unset | list["SlaConditionsItem"] = UNSET + notification_configurations: Unset | list["SlaNotificationConfigurationsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name condition_match_type: str = self.condition_match_type @@ -92,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -100,11 +98,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - entity_type: str | Unset = UNSET + entity_type: Unset | str = UNSET if not isinstance(self.entity_type, Unset): entity_type = self.entity_type - manager_role_id: None | str | Unset + manager_role_id: None | Unset | str if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -112,13 +110,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: int | None | Unset + manager_user_id: None | Unset | int if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_sub_status_id: None | str | Unset + assignment_deadline_sub_status_id: None | Unset | str if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -128,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: None | str | Unset + completion_deadline_sub_status_id: None | Unset | str if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -138,14 +136,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: list[dict[str, Any]] | Unset = UNSET + notification_configurations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -217,25 +215,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) _entity_type = d.pop("entity_type", UNSET) - entity_type: SlaEntityType | Unset + entity_type: Unset | SlaEntityType if isinstance(_entity_type, Unset): entity_type = UNSET else: entity_type = check_sla_entity_type(_entity_type) - def _parse_manager_role_id(data: object) -> None | Unset | UUID: + def _parse_manager_role_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -246,22 +244,22 @@ def _parse_manager_role_id(data: object) -> None | Unset | UUID: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> int | None | Unset: + def _parse_manager_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -272,9 +270,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -282,7 +280,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -293,9 +291,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -303,25 +301,21 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[SlaConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = SlaConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = SlaConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) + notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - notification_configurations: list[SlaNotificationConfigurationsItem] | Unset = UNSET - if _notification_configurations is not UNSET: - notification_configurations = [] - for notification_configurations_item_data in _notification_configurations: - notification_configurations_item = SlaNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + for notification_configurations_item_data in _notification_configurations or []: + notification_configurations_item = SlaNotificationConfigurationsItem.from_dict( + notification_configurations_item_data + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) sla = cls( name=name, diff --git a/rootly_sdk/models/sla_conditions_item.py b/rootly_sdk/models/sla_conditions_item.py index 9a5b164e..cdaffff6 100644 --- a/rootly_sdk/models/sla_conditions_item.py +++ b/rootly_sdk/models/sla_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -20,36 +18,36 @@ class SlaConditionsItem: """ Attributes: - id (UUID | Unset): Unique ID of the condition - position (int | Unset): The position of the condition - conditionable_type (SlaConditionsItemConditionableType | Unset): The type of condition - property_ (None | str | Unset): The property to evaluate (for built-in field conditions) - operator (str | Unset): The comparison operator - values (list[str] | None | Unset): The values to compare against - form_field_id (None | Unset | UUID): The ID of the form field (for custom field conditions) + id (Union[Unset, UUID]): Unique ID of the condition + position (Union[Unset, int]): The position of the condition + conditionable_type (Union[Unset, SlaConditionsItemConditionableType]): The type of condition + property_ (Union[None, Unset, str]): The property to evaluate (for built-in field conditions) + operator (Union[Unset, str]): The comparison operator + values (Union[None, Unset, list[str]]): The values to compare against + form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) """ - id: UUID | Unset = UNSET - position: int | Unset = UNSET - conditionable_type: SlaConditionsItemConditionableType | Unset = UNSET - property_: None | str | Unset = UNSET - operator: str | Unset = UNSET - values: list[str] | None | Unset = UNSET - form_field_id: None | Unset | UUID = UNSET + id: Unset | UUID = UNSET + position: Unset | int = UNSET + conditionable_type: Unset | SlaConditionsItemConditionableType = UNSET + property_: None | Unset | str = UNSET + operator: Unset | str = UNSET + values: None | Unset | list[str] = UNSET + form_field_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) position = self.position - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - property_: None | str | Unset + property_: None | Unset | str if isinstance(self.property_, Unset): property_ = UNSET else: @@ -57,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - values: list[str] | None | Unset + values: None | Unset | list[str] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | str | Unset + form_field_id: None | Unset | str if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -98,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -107,24 +105,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: SlaConditionsItemConditionableType | Unset + conditionable_type: Unset | SlaConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: conditionable_type = check_sla_conditions_item_conditionable_type(_conditionable_type) - def _parse_property_(data: object) -> None | str | Unset: + def _parse_property_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_ = _parse_property_(d.pop("property", UNSET)) operator = d.pop("operator", UNSET) - def _parse_values(data: object) -> list[str] | None | Unset: + def _parse_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -135,13 +133,13 @@ def _parse_values(data: object) -> list[str] | None | Unset: values_type_0 = cast(list[str], data) return values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | Unset | UUID: + def _parse_form_field_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -152,9 +150,9 @@ def _parse_form_field_id(data: object) -> None | Unset | UUID: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/sla_list.py b/rootly_sdk/models/sla_list.py index 50204fc5..0294d0ef 100644 --- a/rootly_sdk/models/sla_list.py +++ b/rootly_sdk/models/sla_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class SlaList: """ Attributes: - data (list[SlaListDataItem]): + data (list['SlaListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[SlaListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["SlaListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sla_list = cls( data=data, diff --git a/rootly_sdk/models/sla_list_data_item.py b/rootly_sdk/models/sla_list_data_item.py index 9810e984..850b573f 100644 --- a/rootly_sdk/models/sla_list_data_item.py +++ b/rootly_sdk/models/sla_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SlaListDataItem: id: str type_: SlaListDataItemType - attributes: Sla + attributes: "Sla" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/sla_notification_configurations_item.py b/rootly_sdk/models/sla_notification_configurations_item.py index dfb47329..0bb4b920 100644 --- a/rootly_sdk/models/sla_notification_configurations_item.py +++ b/rootly_sdk/models/sla_notification_configurations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID @@ -20,27 +18,27 @@ class SlaNotificationConfigurationsItem: """ Attributes: - id (UUID | Unset): Unique ID of the notification configuration - offset_type (SlaNotificationConfigurationsItemOffsetType | Unset): When to send the notification relative to the - deadline - offset_days (int | Unset): Number of days offset from the deadline - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the notification configuration + offset_type (Union[Unset, SlaNotificationConfigurationsItemOffsetType]): When to send the notification relative + to the deadline + offset_days (Union[Unset, int]): Number of days offset from the deadline + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - id: UUID | Unset = UNSET - offset_type: SlaNotificationConfigurationsItemOffsetType | Unset = UNSET - offset_days: int | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Unset | UUID = UNSET + offset_type: Unset | SlaNotificationConfigurationsItemOffsetType = UNSET + offset_days: Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - offset_type: str | Unset = UNSET + offset_type: Unset | str = UNSET if not isinstance(self.offset_type, Unset): offset_type = self.offset_type @@ -70,14 +68,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _offset_type = d.pop("offset_type", UNSET) - offset_type: SlaNotificationConfigurationsItemOffsetType | Unset + offset_type: Unset | SlaNotificationConfigurationsItemOffsetType if isinstance(_offset_type, Unset): offset_type = UNSET else: diff --git a/rootly_sdk/models/sla_response.py b/rootly_sdk/models/sla_response.py index 8876ead5..c884fbe7 100644 --- a/rootly_sdk/models/sla_response.py +++ b/rootly_sdk/models/sla_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class SlaResponse: """ Attributes: data (SlaResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: SlaResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "SlaResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = SlaResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sla_response = cls( data=data, diff --git a/rootly_sdk/models/sla_response_data.py b/rootly_sdk/models/sla_response_data.py index df5ff9fc..4e671418 100644 --- a/rootly_sdk/models/sla_response_data.py +++ b/rootly_sdk/models/sla_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SlaResponseData: id: str type_: SlaResponseDataType - attributes: Sla + attributes: "Sla" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/slack_channel.py b/rootly_sdk/models/slack_channel.py index 845201cd..07a344c3 100644 --- a/rootly_sdk/models/slack_channel.py +++ b/rootly_sdk/models/slack_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params.py b/rootly_sdk/models/snapshot_datadog_graph_task_params.py index 2781d577..f4a21240 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,43 +25,42 @@ class SnapshotDatadogGraphTaskParams: """ Attributes: past_duration (str): in format '1 minute', '30 days', '3 months', etc Example: 1 hour. - task_type (SnapshotDatadogGraphTaskParamsTaskType | Unset): - dashboards (list[SnapshotDatadogGraphTaskParamsDashboardsItem] | Unset): - metric_queries (list[str] | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, SnapshotDatadogGraphTaskParamsTaskType]): + dashboards (Union[Unset, list['SnapshotDatadogGraphTaskParamsDashboardsItem']]): + metric_queries (Union[Unset, list[str]]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem']]): """ past_duration: str - task_type: SnapshotDatadogGraphTaskParamsTaskType | Unset = UNSET - dashboards: list[SnapshotDatadogGraphTaskParamsDashboardsItem] | Unset = UNSET - metric_queries: list[str] | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | SnapshotDatadogGraphTaskParamsTaskType = UNSET + dashboards: Unset | list["SnapshotDatadogGraphTaskParamsDashboardsItem"] = UNSET + metric_queries: Unset | list[str] = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - past_duration = self.past_duration - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - dashboards: list[dict[str, Any]] | Unset = UNSET + dashboards: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.dashboards, Unset): dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - metric_queries: list[str] | Unset = UNSET + metric_queries: Unset | list[str] = UNSET if not isinstance(self.metric_queries, Unset): metric_queries = self.metric_queries post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -103,35 +100,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: SnapshotDatadogGraphTaskParamsTaskType | Unset + task_type: Unset | SnapshotDatadogGraphTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_snapshot_datadog_graph_task_params_task_type(_task_type) + dashboards = [] _dashboards = d.pop("dashboards", UNSET) - dashboards: list[SnapshotDatadogGraphTaskParamsDashboardsItem] | Unset = UNSET - if _dashboards is not UNSET: - dashboards = [] - for dashboards_item_data in _dashboards: - dashboards_item = SnapshotDatadogGraphTaskParamsDashboardsItem.from_dict(dashboards_item_data) + for dashboards_item_data in _dashboards or []: + dashboards_item = SnapshotDatadogGraphTaskParamsDashboardsItem.from_dict(dashboards_item_data) - dashboards.append(dashboards_item) + dashboards.append(dashboards_item) metric_queries = cast(list[str], d.pop("metric_queries", UNSET)) post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_datadog_graph_task_params = cls( past_duration=past_duration, diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py index 9c746203..7b7b6330 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotDatadogGraphTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py index 1e3ef6f9..ea37cf49 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py index 48b44fbd..96877abd 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,32 +26,31 @@ class SnapshotGrafanaDashboardTaskParams: """ Attributes: - dashboards (list[SnapshotGrafanaDashboardTaskParamsDashboardsItem]): - task_type (SnapshotGrafanaDashboardTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset): + dashboards (list['SnapshotGrafanaDashboardTaskParamsDashboardsItem']): + task_type (Union[Unset, SnapshotGrafanaDashboardTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem']]): """ - dashboards: list[SnapshotGrafanaDashboardTaskParamsDashboardsItem] - task_type: SnapshotGrafanaDashboardTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset = UNSET + dashboards: list["SnapshotGrafanaDashboardTaskParamsDashboardsItem"] + task_type: Unset | SnapshotGrafanaDashboardTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -94,7 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: SnapshotGrafanaDashboardTaskParamsTaskType | Unset + task_type: Unset | SnapshotGrafanaDashboardTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,16 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_grafana_dashboard_task_params = cls( dashboards=dashboards, diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py index 7b0c3437..4c028f49 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotGrafanaDashboardTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py index cfa584d1..0edaa27c 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params.py b/rootly_sdk/models/snapshot_looker_look_task_params.py index 967ee38b..87fb439c 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,32 +24,31 @@ class SnapshotLookerLookTaskParams: """ Attributes: - dashboards (list[SnapshotLookerLookTaskParamsDashboardsItem]): - task_type (SnapshotLookerLookTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset): + dashboards (list['SnapshotLookerLookTaskParamsDashboardsItem']): + task_type (Union[Unset, SnapshotLookerLookTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotLookerLookTaskParamsPostToSlackChannelsItem']]): """ - dashboards: list[SnapshotLookerLookTaskParamsDashboardsItem] - task_type: SnapshotLookerLookTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset = UNSET + dashboards: list["SnapshotLookerLookTaskParamsDashboardsItem"] + task_type: Unset | SnapshotLookerLookTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotLookerLookTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: SnapshotLookerLookTaskParamsTaskType | Unset + task_type: Unset | SnapshotLookerLookTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -98,16 +95,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotLookerLookTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotLookerLookTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_looker_look_task_params = cls( dashboards=dashboards, diff --git a/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py index 8f376d5f..3a5baf68 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotLookerLookTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py index 919bbb01..fde08d8f 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotLookerLookTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py index be80e08d..aa99c427 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,31 +29,30 @@ class SnapshotNewRelicGraphTaskParams: Attributes: metric_query (str): metric_type (SnapshotNewRelicGraphTaskParamsMetricType): - task_type (SnapshotNewRelicGraphTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem']]): """ metric_query: str metric_type: SnapshotNewRelicGraphTaskParamsMetricType - task_type: SnapshotNewRelicGraphTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | SnapshotNewRelicGraphTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - metric_query = self.metric_query metric_type: str = self.metric_type - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -91,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: metric_type = check_snapshot_new_relic_graph_task_params_metric_type(d.pop("metric_type")) _task_type = d.pop("task_type", UNSET) - task_type: SnapshotNewRelicGraphTaskParamsTaskType | Unset + task_type: Unset | SnapshotNewRelicGraphTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -99,16 +96,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_new_relic_graph_task_params = cls( metric_query=metric_query, diff --git a/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py index 143318a5..b56e5eee 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snooze_alert.py b/rootly_sdk/models/snooze_alert.py index d4b37fda..186fac63 100644 --- a/rootly_sdk/models/snooze_alert.py +++ b/rootly_sdk/models/snooze_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class SnoozeAlert: data (SnoozeAlertData): """ - data: SnoozeAlertData + data: "SnoozeAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/snooze_alert_data.py b/rootly_sdk/models/snooze_alert_data.py index 32aaae38..bf68c5f4 100644 --- a/rootly_sdk/models/snooze_alert_data.py +++ b/rootly_sdk/models/snooze_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class SnoozeAlertData: """ type_: SnoozeAlertDataType - attributes: SnoozeAlertDataAttributes + attributes: "SnoozeAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/snooze_alert_data_attributes.py b/rootly_sdk/models/snooze_alert_data_attributes.py index 812d1f44..9fc61d54 100644 --- a/rootly_sdk/models/snooze_alert_data_attributes.py +++ b/rootly_sdk/models/snooze_alert_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/start_session_request.py b/rootly_sdk/models/start_session_request.py index bc7434a4..53697c40 100644 --- a/rootly_sdk/models/start_session_request.py +++ b/rootly_sdk/models/start_session_request.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,20 +14,20 @@ class StartSessionRequest: """ Attributes: - platform (StartSessionRequestPlatform | Unset): Meeting platform - title (None | str | Unset): Human-readable label for the recording session + platform (Union[Unset, StartSessionRequestPlatform]): Meeting platform + title (Union[None, Unset, str]): Human-readable label for the recording session """ - platform: StartSessionRequestPlatform | Unset = UNSET - title: None | str | Unset = UNSET + platform: Unset | StartSessionRequestPlatform = UNSET + title: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - platform: str | Unset = UNSET + platform: Unset | str = UNSET if not isinstance(self.platform, Unset): platform = self.platform - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -49,18 +47,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _platform = d.pop("platform", UNSET) - platform: StartSessionRequestPlatform | Unset + platform: Unset | StartSessionRequestPlatform if isinstance(_platform, Unset): platform = UNSET else: platform = check_start_session_request_platform(_platform) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) diff --git a/rootly_sdk/models/start_session_response.py b/rootly_sdk/models/start_session_response.py index 330d0ce5..91ebd275 100644 --- a/rootly_sdk/models/start_session_response.py +++ b/rootly_sdk/models/start_session_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class StartSessionResponse: """ Attributes: - data (StartSessionResponseData | Unset): + data (Union[Unset, StartSessionResponseData]): """ - data: StartSessionResponseData | Unset = UNSET + data: Union[Unset, "StartSessionResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: StartSessionResponseData | Unset + data: Unset | StartSessionResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/start_session_response_data.py b/rootly_sdk/models/start_session_response_data.py index 50fc32db..c110c2da 100644 --- a/rootly_sdk/models/start_session_response_data.py +++ b/rootly_sdk/models/start_session_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/status.py b/rootly_sdk/models/status.py index 629cb1f0..4059997d 100644 --- a/rootly_sdk/models/status.py +++ b/rootly_sdk/models/status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,8 +18,8 @@ class Status: enabled (bool): created_at (str): updated_at (str): - slug (str | Unset): - description (None | str | Unset): + slug (Union[Unset, str]): + description (Union[None, Unset, str]): """ name: str @@ -29,8 +27,8 @@ class Status: enabled: bool created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/status_list.py b/rootly_sdk/models/status_list.py index 5f0e0083..56f94dd4 100644 --- a/rootly_sdk/models/status_list.py +++ b/rootly_sdk/models/status_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class StatusList: """ Attributes: - data (list[StatusListDataItem]): + data (list['StatusListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[StatusListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["StatusListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_list = cls( data=data, diff --git a/rootly_sdk/models/status_list_data_item.py b/rootly_sdk/models/status_list_data_item.py index 95d811a0..6b27a0a1 100644 --- a/rootly_sdk/models/status_list_data_item.py +++ b/rootly_sdk/models/status_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusListDataItem: id: str type_: StatusListDataItemType - attributes: Status + attributes: "Status" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page.py b/rootly_sdk/models/status_page.py index 310d9446..c6c47a56 100644 --- a/rootly_sdk/models/status_page.py +++ b/rootly_sdk/models/status_page.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,76 +36,76 @@ class StatusPage: title (str): The title of the status page created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the status page - public_title (None | str | Unset): The public title of the status page - description (None | str | Unset): The description of the status page - public_description (None | str | Unset): The public description of the status page - header_color (None | str | Unset): The color of the header. Eg. "#0061F2" - footer_color (None | str | Unset): The color of the footer. Eg. "#1F2F41" - allow_search_engine_index (bool | None | Unset): Allow search engines to include your public status page in + slug (Union[Unset, str]): The slug of the status page + public_title (Union[None, Unset, str]): The public title of the status page + description (Union[None, Unset, str]): The description of the status page + public_description (Union[None, Unset, str]): The public description of the status page + header_color (Union[None, Unset, str]): The color of the header. Eg. "#0061F2" + footer_color (Union[None, Unset, str]): The color of the footer. Eg. "#1F2F41" + allow_search_engine_index (Union[None, Unset, bool]): Allow search engines to include your public status page in search results - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (StatusPageShowUptimeLastDays | Unset): Show uptime over x days - success_message (None | str | Unset): Message showing when all components are operational - failure_message (None | str | Unset): Message showing when at least one component is not operational - authentication_method (StatusPageAuthenticationMethod | Unset): Authentication method Default: 'none'. - authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, StatusPageShowUptimeLastDays]): Show uptime over x days + success_message (Union[None, Unset, str]): Message showing when all components are operational + failure_message (Union[None, Unset, str]): Message showing when at least one component is not operational + authentication_method (Union[Unset, StatusPageAuthenticationMethod]): Authentication method Default: 'none'. + authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method instead) Default: False. - authentication_password (None | str | Unset): Authentication password - saml_idp_sso_service_url (None | str | Unset): SAML IdP SSO service URL - saml_idp_slo_service_url (None | str | Unset): SAML IdP SLO service URL - saml_idp_cert (None | str | Unset): SAML IdP certificate - saml_idp_cert_fingerprint (None | str | Unset): SAML IdP certificate fingerprint - saml_name_identifier_format (StatusPageSamlNameIdentifierFormat | Unset): SAML name identifier format - section_order (list[StatusPageSectionOrderType0Item] | None | Unset): Order of sections on the status page - website_url (None | str | Unset): Website URL - website_privacy_url (None | str | Unset): Website Privacy URL - website_support_url (None | str | Unset): Website Support URL - ga_tracking_id (None | str | Unset): Google Analytics tracking ID - time_zone (None | str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - public (bool | None | Unset): Make the status page accessible to the public - service_ids (list[str] | Unset): Services attached to the status page - functionality_ids (list[str] | Unset): Functionalities attached to the status page - external_domain_names (list[str] | Unset): External domain names attached to the status page - cname_records (None | StatusPageCnameRecordsType0 | Unset): CNAME records mapping external domain names to their - DNS target values. These are populated asynchronously after setting external_domain_names. - enabled (bool | None | Unset): Enabled / Disable the status page + authentication_password (Union[None, Unset, str]): Authentication password + saml_idp_sso_service_url (Union[None, Unset, str]): SAML IdP SSO service URL + saml_idp_slo_service_url (Union[None, Unset, str]): SAML IdP SLO service URL + saml_idp_cert (Union[None, Unset, str]): SAML IdP certificate + saml_idp_cert_fingerprint (Union[None, Unset, str]): SAML IdP certificate fingerprint + saml_name_identifier_format (Union[Unset, StatusPageSamlNameIdentifierFormat]): SAML name identifier format + section_order (Union[None, Unset, list[StatusPageSectionOrderType0Item]]): Order of sections on the status page + website_url (Union[None, Unset, str]): Website URL + website_privacy_url (Union[None, Unset, str]): Website Privacy URL + website_support_url (Union[None, Unset, str]): Website Support URL + ga_tracking_id (Union[None, Unset, str]): Google Analytics tracking ID + time_zone (Union[None, Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + public (Union[None, Unset, bool]): Make the status page accessible to the public + service_ids (Union[Unset, list[str]]): Services attached to the status page + functionality_ids (Union[Unset, list[str]]): Functionalities attached to the status page + external_domain_names (Union[Unset, list[str]]): External domain names attached to the status page + cname_records (Union['StatusPageCnameRecordsType0', None, Unset]): CNAME records mapping external domain names + to their DNS target values. These are populated asynchronously after setting external_domain_names. + enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ title: str created_at: str updated_at: str - slug: str | Unset = UNSET - public_title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - header_color: None | str | Unset = UNSET - footer_color: None | str | Unset = UNSET - allow_search_engine_index: bool | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: StatusPageShowUptimeLastDays | Unset = UNSET - success_message: None | str | Unset = UNSET - failure_message: None | str | Unset = UNSET - authentication_method: StatusPageAuthenticationMethod | Unset = "none" - authentication_enabled: bool | None | Unset = False - authentication_password: None | str | Unset = UNSET - saml_idp_sso_service_url: None | str | Unset = UNSET - saml_idp_slo_service_url: None | str | Unset = UNSET - saml_idp_cert: None | str | Unset = UNSET - saml_idp_cert_fingerprint: None | str | Unset = UNSET - saml_name_identifier_format: StatusPageSamlNameIdentifierFormat | Unset = UNSET - section_order: list[StatusPageSectionOrderType0Item] | None | Unset = UNSET - website_url: None | str | Unset = UNSET - website_privacy_url: None | str | Unset = UNSET - website_support_url: None | str | Unset = UNSET - ga_tracking_id: None | str | Unset = UNSET - time_zone: None | str | Unset = "Etc/UTC" - public: bool | None | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - external_domain_names: list[str] | Unset = UNSET - cname_records: None | StatusPageCnameRecordsType0 | Unset = UNSET - enabled: bool | None | Unset = UNSET + slug: Unset | str = UNSET + public_title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + header_color: None | Unset | str = UNSET + footer_color: None | Unset | str = UNSET + allow_search_engine_index: None | Unset | bool = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | StatusPageShowUptimeLastDays = UNSET + success_message: None | Unset | str = UNSET + failure_message: None | Unset | str = UNSET + authentication_method: Unset | StatusPageAuthenticationMethod = "none" + authentication_enabled: None | Unset | bool = False + authentication_password: None | Unset | str = UNSET + saml_idp_sso_service_url: None | Unset | str = UNSET + saml_idp_slo_service_url: None | Unset | str = UNSET + saml_idp_cert: None | Unset | str = UNSET + saml_idp_cert_fingerprint: None | Unset | str = UNSET + saml_name_identifier_format: Unset | StatusPageSamlNameIdentifierFormat = UNSET + section_order: None | Unset | list[StatusPageSectionOrderType0Item] = UNSET + website_url: None | Unset | str = UNSET + website_privacy_url: None | Unset | str = UNSET + website_support_url: None | Unset | str = UNSET + ga_tracking_id: None | Unset | str = UNSET + time_zone: None | Unset | str = "Etc/UTC" + public: None | Unset | bool = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + external_domain_names: Unset | list[str] = UNSET + cname_records: Union["StatusPageCnameRecordsType0", None, Unset] = UNSET + enabled: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -121,109 +119,109 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - public_title: None | str | Unset + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | str | Unset + header_color: None | Unset | str if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | str | Unset + footer_color: None | Unset | str if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: bool | None | Unset + allow_search_engine_index: None | Unset | bool if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | str | Unset + success_message: None | Unset | str if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | str | Unset + failure_message: None | Unset | str if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: str | Unset = UNSET + authentication_method: Unset | str = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: bool | None | Unset + authentication_enabled: None | Unset | bool if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | str | Unset + authentication_password: None | Unset | str if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | str | Unset + saml_idp_sso_service_url: None | Unset | str if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: None | str | Unset + saml_idp_slo_service_url: None | Unset | str if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: None | str | Unset + saml_idp_cert: None | Unset | str if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_idp_cert_fingerprint: None | str | Unset + saml_idp_cert_fingerprint: None | Unset | str if isinstance(self.saml_idp_cert_fingerprint, Unset): saml_idp_cert_fingerprint = UNSET else: saml_idp_cert_fingerprint = self.saml_idp_cert_fingerprint - saml_name_identifier_format: str | Unset = UNSET + saml_name_identifier_format: Unset | str = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: list[str] | None | Unset + section_order: None | Unset | list[str] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -235,55 +233,55 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - website_url: None | str | Unset + website_url: None | Unset | str if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | str | Unset + website_privacy_url: None | Unset | str if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | str | Unset + website_support_url: None | Unset | str if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | str | Unset + ga_tracking_id: None | Unset | str if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: bool | None | Unset + public: None | Unset | bool if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - external_domain_names: list[str] | Unset = UNSET + external_domain_names: Unset | list[str] = UNSET if not isinstance(self.external_domain_names, Unset): external_domain_names = self.external_domain_names - cname_records: dict[str, Any] | None | Unset + cname_records: None | Unset | dict[str, Any] if isinstance(self.cname_records, Unset): cname_records = UNSET elif isinstance(self.cname_records, StatusPageCnameRecordsType0): @@ -291,7 +289,7 @@ def to_dict(self) -> dict[str, Any]: else: cname_records = self.cname_records - enabled: bool | None | Unset + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -384,163 +382,163 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | str | Unset: + def _parse_header_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | str | Unset: + def _parse_footer_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: + def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: StatusPageShowUptimeLastDays | Unset + show_uptime_last_days: Unset | StatusPageShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_status_page_show_uptime_last_days(_show_uptime_last_days) - def _parse_success_message(data: object) -> None | str | Unset: + def _parse_success_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | str | Unset: + def _parse_failure_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: StatusPageAuthenticationMethod | Unset + authentication_method: Unset | StatusPageAuthenticationMethod if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_status_page_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> bool | None | Unset: + def _parse_authentication_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | str | Unset: + def _parse_authentication_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_slo_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> None | str | Unset: + def _parse_saml_idp_cert(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) - def _parse_saml_idp_cert_fingerprint(data: object) -> None | str | Unset: + def _parse_saml_idp_cert_fingerprint(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_cert_fingerprint = _parse_saml_idp_cert_fingerprint(d.pop("saml_idp_cert_fingerprint", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: StatusPageSamlNameIdentifierFormat | Unset + saml_name_identifier_format: Unset | StatusPageSamlNameIdentifierFormat if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: saml_name_identifier_format = check_status_page_saml_name_identifier_format(_saml_name_identifier_format) - def _parse_section_order(data: object) -> list[StatusPageSectionOrderType0Item] | None | Unset: + def _parse_section_order(data: object) -> None | Unset | list[StatusPageSectionOrderType0Item]: if data is None: return data if isinstance(data, Unset): @@ -558,63 +556,63 @@ def _parse_section_order(data: object) -> list[StatusPageSectionOrderType0Item] section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[StatusPageSectionOrderType0Item] | None | Unset, data) + return cast(None | Unset | list[StatusPageSectionOrderType0Item], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_website_url(data: object) -> None | str | Unset: + def _parse_website_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | str | Unset: + def _parse_website_privacy_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | str | Unset: + def _parse_website_support_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | str | Unset: + def _parse_ga_tracking_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> bool | None | Unset: + def _parse_public(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) public = _parse_public(d.pop("public", UNSET)) @@ -624,7 +622,7 @@ def _parse_public(data: object) -> bool | None | Unset: external_domain_names = cast(list[str], d.pop("external_domain_names", UNSET)) - def _parse_cname_records(data: object) -> None | StatusPageCnameRecordsType0 | Unset: + def _parse_cname_records(data: object) -> Union["StatusPageCnameRecordsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -635,18 +633,18 @@ def _parse_cname_records(data: object) -> None | StatusPageCnameRecordsType0 | U cname_records_type_0 = StatusPageCnameRecordsType0.from_dict(data) return cname_records_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | StatusPageCnameRecordsType0 | Unset, data) + return cast(Union["StatusPageCnameRecordsType0", None, Unset], data) cname_records = _parse_cname_records(d.pop("cname_records", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_announcement.py b/rootly_sdk/models/status_page_announcement.py new file mode 100644 index 00000000..db5f70ea --- /dev/null +++ b/rootly_sdk/models/status_page_announcement.py @@ -0,0 +1,121 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatusPageAnnouncement") + + +@_attrs_define +class StatusPageAnnouncement: + """ + Attributes: + status_page_id (str): ID of the status page the announcement was posted to + title (str): Title of the announcement + body (str): Body of the announcement + published_at (str): Date the announcement was published + created_at (str): Date of creation + updated_at (str): Date of last update + user_id (Union[None, Unset, int]): ID of the user who posted the announcement + """ + + status_page_id: str + title: str + body: str + published_at: str + created_at: str + updated_at: str + user_id: None | Unset | int = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_id = self.status_page_id + + title = self.title + + body = self.body + + published_at = self.published_at + + created_at = self.created_at + + updated_at = self.updated_at + + user_id: None | Unset | int + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "title": title, + "body": body, + "published_at": published_at, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_id = d.pop("status_page_id") + + title = d.pop("title") + + body = d.pop("body") + + published_at = d.pop("published_at") + + created_at = d.pop("created_at") + + updated_at = d.pop("updated_at") + + def _parse_user_id(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + status_page_announcement = cls( + status_page_id=status_page_id, + title=title, + body=body, + published_at=published_at, + created_at=created_at, + updated_at=updated_at, + user_id=user_id, + ) + + status_page_announcement.additional_properties = d + return status_page_announcement + + @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/rootly_sdk/models/status_page_announcement_list.py b/rootly_sdk/models/status_page_announcement_list.py new file mode 100644 index 00000000..bc302093 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_announcement_list_data_item import StatusPageAnnouncementListDataItem + + +T = TypeVar("T", bound="StatusPageAnnouncementList") + + +@_attrs_define +class StatusPageAnnouncementList: + """ + Attributes: + data (list['StatusPageAnnouncementListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["StatusPageAnnouncementListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_announcement_list_data_item import StatusPageAnnouncementListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageAnnouncementListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_announcement_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_announcement_list.additional_properties = d + return status_page_announcement_list + + @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/rootly_sdk/models/status_page_announcement_list_data_item.py b/rootly_sdk/models/status_page_announcement_list_data_item.py new file mode 100644 index 00000000..49f72003 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_announcement_list_data_item_type import ( + StatusPageAnnouncementListDataItemType, + check_status_page_announcement_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_announcement import StatusPageAnnouncement + + +T = TypeVar("T", bound="StatusPageAnnouncementListDataItem") + + +@_attrs_define +class StatusPageAnnouncementListDataItem: + """ + Attributes: + id (str): Unique ID of the status page announcement + type_ (StatusPageAnnouncementListDataItemType): + attributes (StatusPageAnnouncement): + """ + + id: str + type_: StatusPageAnnouncementListDataItemType + attributes: "StatusPageAnnouncement" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_announcement import StatusPageAnnouncement + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_announcement_list_data_item_type(d.pop("type")) + + attributes = StatusPageAnnouncement.from_dict(d.pop("attributes")) + + status_page_announcement_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_announcement_list_data_item.additional_properties = d + return status_page_announcement_list_data_item + + @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/rootly_sdk/models/status_page_announcement_list_data_item_type.py b/rootly_sdk/models/status_page_announcement_list_data_item_type.py new file mode 100644 index 00000000..e0454e03 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_list_data_item_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageAnnouncementListDataItemType = Literal["status_page_announcements"] + +STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageAnnouncementListDataItemType] = { + "status_page_announcements", +} + + +def check_status_page_announcement_list_data_item_type( + value: str | None, +) -> StatusPageAnnouncementListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES: + return cast(StatusPageAnnouncementListDataItemType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_announcement_response.py b/rootly_sdk/models/status_page_announcement_response.py new file mode 100644 index 00000000..cc87ac39 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_announcement_response_data import StatusPageAnnouncementResponseData + + +T = TypeVar("T", bound="StatusPageAnnouncementResponse") + + +@_attrs_define +class StatusPageAnnouncementResponse: + """ + Attributes: + data (StatusPageAnnouncementResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "StatusPageAnnouncementResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_announcement_response_data import StatusPageAnnouncementResponseData + + d = dict(src_dict) + data = StatusPageAnnouncementResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_announcement_response = cls( + data=data, + included=included, + ) + + status_page_announcement_response.additional_properties = d + return status_page_announcement_response + + @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/rootly_sdk/models/status_page_announcement_response_data.py b/rootly_sdk/models/status_page_announcement_response_data.py new file mode 100644 index 00000000..07c7fe72 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_announcement_response_data_type import ( + StatusPageAnnouncementResponseDataType, + check_status_page_announcement_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_announcement import StatusPageAnnouncement + + +T = TypeVar("T", bound="StatusPageAnnouncementResponseData") + + +@_attrs_define +class StatusPageAnnouncementResponseData: + """ + Attributes: + id (str): Unique ID of the status page announcement + type_ (StatusPageAnnouncementResponseDataType): + attributes (StatusPageAnnouncement): + """ + + id: str + type_: StatusPageAnnouncementResponseDataType + attributes: "StatusPageAnnouncement" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_announcement import StatusPageAnnouncement + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_announcement_response_data_type(d.pop("type")) + + attributes = StatusPageAnnouncement.from_dict(d.pop("attributes")) + + status_page_announcement_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_announcement_response_data.additional_properties = d + return status_page_announcement_response_data + + @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/rootly_sdk/models/status_page_announcement_response_data_type.py b/rootly_sdk/models/status_page_announcement_response_data_type.py new file mode 100644 index 00000000..b1cc6f2e --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_response_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageAnnouncementResponseDataType = Literal["status_page_announcements"] + +STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES: set[StatusPageAnnouncementResponseDataType] = { + "status_page_announcements", +} + + +def check_status_page_announcement_response_data_type( + value: str | None, +) -> StatusPageAnnouncementResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES: + return cast(StatusPageAnnouncementResponseDataType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_cname_records_type_0.py b/rootly_sdk/models/status_page_cname_records_type_0.py index 372a2510..1993df34 100644 --- a/rootly_sdk/models/status_page_cname_records_type_0.py +++ b/rootly_sdk/models/status_page_cname_records_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,7 +17,6 @@ class StatusPageCnameRecordsType0: additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/status_page_component.py b/rootly_sdk/models/status_page_component.py new file mode 100644 index 00000000..e6b86be7 --- /dev/null +++ b/rootly_sdk/models/status_page_component.py @@ -0,0 +1,207 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.status_page_component_status import StatusPageComponentStatus, check_status_page_component_status +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatusPageComponent") + + +@_attrs_define +class StatusPageComponent: + """ + Attributes: + status_page_id (str): + position (int): Position of the component + created_at (datetime.datetime): Date of creation + updated_at (datetime.datetime): Date of last update + status_page_component_group_id (Union[None, Unset, str]): ID of the component group the component belongs to + name (Union[None, Unset, str]): Name of the component (derived from the source for catalog-backed components) + description (Union[None, Unset, str]): Description of the component (derived from the source for catalog-backed + components) + source_type (Union[None, Unset, str]): Catalog source type backing the component (null for ad-hoc components) + source_id (Union[None, Unset, str]): ID of the catalog source backing the component (null for ad-hoc components) + status (Union[Unset, StatusPageComponentStatus]): Latest recorded status of the component + """ + + status_page_id: str + position: int + created_at: datetime.datetime + updated_at: datetime.datetime + status_page_component_group_id: None | Unset | str = UNSET + name: None | Unset | str = UNSET + description: None | Unset | str = UNSET + source_type: None | Unset | str = UNSET + source_id: None | Unset | str = UNSET + status: Unset | StatusPageComponentStatus = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_id = self.status_page_id + + position = self.position + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + status_page_component_group_id: None | Unset | str + if isinstance(self.status_page_component_group_id, Unset): + status_page_component_group_id = UNSET + else: + status_page_component_group_id = self.status_page_component_group_id + + name: None | Unset | str + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: None | Unset | str + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + source_type: None | Unset | str + if isinstance(self.source_type, Unset): + source_type = UNSET + else: + source_type = self.source_type + + source_id: None | Unset | str + if isinstance(self.source_id, Unset): + source_id = UNSET + else: + source_id = self.source_id + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "position": position, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if status_page_component_group_id is not UNSET: + field_dict["status_page_component_group_id"] = status_page_component_group_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if source_type is not UNSET: + field_dict["source_type"] = source_type + if source_id is not UNSET: + field_dict["source_id"] = source_id + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_id = d.pop("status_page_id") + + position = d.pop("position") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_status_page_component_group_id(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + status_page_component_group_id = _parse_status_page_component_group_id( + d.pop("status_page_component_group_id", UNSET) + ) + + def _parse_name(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_source_type(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + source_type = _parse_source_type(d.pop("source_type", UNSET)) + + def _parse_source_id(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + source_id = _parse_source_id(d.pop("source_id", UNSET)) + + _status = d.pop("status", UNSET) + status: Unset | StatusPageComponentStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = check_status_page_component_status(_status) + + status_page_component = cls( + status_page_id=status_page_id, + position=position, + created_at=created_at, + updated_at=updated_at, + status_page_component_group_id=status_page_component_group_id, + name=name, + description=description, + source_type=source_type, + source_id=source_id, + status=status, + ) + + status_page_component.additional_properties = d + return status_page_component + + @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/rootly_sdk/models/status_page_component_group.py b/rootly_sdk/models/status_page_component_group.py new file mode 100644 index 00000000..f1847065 --- /dev/null +++ b/rootly_sdk/models/status_page_component_group.py @@ -0,0 +1,124 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatusPageComponentGroup") + + +@_attrs_define +class StatusPageComponentGroup: + """ + Attributes: + status_page_id (str): + name (str): Name of the component group + position (int): Position of the group on the status page's top-level list + created_at (datetime.datetime): Date of creation + updated_at (datetime.datetime): Date of last update + description (Union[None, Unset, str]): Description of the component group + collapsed_by_default (Union[Unset, bool]): Whether the group renders collapsed on the public page + """ + + status_page_id: str + name: str + position: int + created_at: datetime.datetime + updated_at: datetime.datetime + description: None | Unset | str = UNSET + collapsed_by_default: Unset | bool = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_id = self.status_page_id + + name = self.name + + position = self.position + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + description: None | Unset | str + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + collapsed_by_default = self.collapsed_by_default + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "name": name, + "position": position, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if collapsed_by_default is not UNSET: + field_dict["collapsed_by_default"] = collapsed_by_default + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_id = d.pop("status_page_id") + + name = d.pop("name") + + position = d.pop("position") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + description = _parse_description(d.pop("description", UNSET)) + + collapsed_by_default = d.pop("collapsed_by_default", UNSET) + + status_page_component_group = cls( + status_page_id=status_page_id, + name=name, + position=position, + created_at=created_at, + updated_at=updated_at, + description=description, + collapsed_by_default=collapsed_by_default, + ) + + status_page_component_group.additional_properties = d + return status_page_component_group + + @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/rootly_sdk/models/status_page_component_group_list.py b/rootly_sdk/models/status_page_component_group_list.py new file mode 100644 index 00000000..75c0e109 --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_group_list_data_item import StatusPageComponentGroupListDataItem + + +T = TypeVar("T", bound="StatusPageComponentGroupList") + + +@_attrs_define +class StatusPageComponentGroupList: + """ + Attributes: + data (list['StatusPageComponentGroupListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["StatusPageComponentGroupListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_group_list_data_item import StatusPageComponentGroupListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageComponentGroupListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_group_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_component_group_list.additional_properties = d + return status_page_component_group_list + + @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/rootly_sdk/models/status_page_component_group_list_data_item.py b/rootly_sdk/models/status_page_component_group_list_data_item.py new file mode 100644 index 00000000..b1dc0e4a --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_group_list_data_item_type import ( + StatusPageComponentGroupListDataItemType, + check_status_page_component_group_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component_group import StatusPageComponentGroup + + +T = TypeVar("T", bound="StatusPageComponentGroupListDataItem") + + +@_attrs_define +class StatusPageComponentGroupListDataItem: + """ + Attributes: + id (str): Unique ID of the status page component group + type_ (StatusPageComponentGroupListDataItemType): + attributes (StatusPageComponentGroup): + """ + + id: str + type_: StatusPageComponentGroupListDataItemType + attributes: "StatusPageComponentGroup" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component_group import StatusPageComponentGroup + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_group_list_data_item_type(d.pop("type")) + + attributes = StatusPageComponentGroup.from_dict(d.pop("attributes")) + + status_page_component_group_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_group_list_data_item.additional_properties = d + return status_page_component_group_list_data_item + + @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/rootly_sdk/models/status_page_component_group_list_data_item_type.py b/rootly_sdk/models/status_page_component_group_list_data_item_type.py new file mode 100644 index 00000000..3825d6e3 --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_list_data_item_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageComponentGroupListDataItemType = Literal["status_page_component_groups"] + +STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageComponentGroupListDataItemType] = { + "status_page_component_groups", +} + + +def check_status_page_component_group_list_data_item_type( + value: str | None, +) -> StatusPageComponentGroupListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES: + return cast(StatusPageComponentGroupListDataItemType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_component_group_response.py b/rootly_sdk/models/status_page_component_group_response.py new file mode 100644 index 00000000..1a0db82b --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_group_response_data import StatusPageComponentGroupResponseData + + +T = TypeVar("T", bound="StatusPageComponentGroupResponse") + + +@_attrs_define +class StatusPageComponentGroupResponse: + """ + Attributes: + data (StatusPageComponentGroupResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "StatusPageComponentGroupResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_group_response_data import StatusPageComponentGroupResponseData + + d = dict(src_dict) + data = StatusPageComponentGroupResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_group_response = cls( + data=data, + included=included, + ) + + status_page_component_group_response.additional_properties = d + return status_page_component_group_response + + @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/rootly_sdk/models/status_page_component_group_response_data.py b/rootly_sdk/models/status_page_component_group_response_data.py new file mode 100644 index 00000000..b7a04aef --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_group_response_data_type import ( + StatusPageComponentGroupResponseDataType, + check_status_page_component_group_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component_group import StatusPageComponentGroup + + +T = TypeVar("T", bound="StatusPageComponentGroupResponseData") + + +@_attrs_define +class StatusPageComponentGroupResponseData: + """ + Attributes: + id (str): Unique ID of the status page component group + type_ (StatusPageComponentGroupResponseDataType): + attributes (StatusPageComponentGroup): + """ + + id: str + type_: StatusPageComponentGroupResponseDataType + attributes: "StatusPageComponentGroup" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component_group import StatusPageComponentGroup + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_group_response_data_type(d.pop("type")) + + attributes = StatusPageComponentGroup.from_dict(d.pop("attributes")) + + status_page_component_group_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_group_response_data.additional_properties = d + return status_page_component_group_response_data + + @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/rootly_sdk/models/status_page_component_group_response_data_type.py b/rootly_sdk/models/status_page_component_group_response_data_type.py new file mode 100644 index 00000000..20f6e77a --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_response_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageComponentGroupResponseDataType = Literal["status_page_component_groups"] + +STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES: set[StatusPageComponentGroupResponseDataType] = { + "status_page_component_groups", +} + + +def check_status_page_component_group_response_data_type( + value: str | None, +) -> StatusPageComponentGroupResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES: + return cast(StatusPageComponentGroupResponseDataType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_component_list.py b/rootly_sdk/models/status_page_component_list.py new file mode 100644 index 00000000..7104d30e --- /dev/null +++ b/rootly_sdk/models/status_page_component_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_list_data_item import StatusPageComponentListDataItem + + +T = TypeVar("T", bound="StatusPageComponentList") + + +@_attrs_define +class StatusPageComponentList: + """ + Attributes: + data (list['StatusPageComponentListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["StatusPageComponentListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_list_data_item import StatusPageComponentListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageComponentListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_component_list.additional_properties = d + return status_page_component_list + + @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/rootly_sdk/models/status_page_component_list_data_item.py b/rootly_sdk/models/status_page_component_list_data_item.py new file mode 100644 index 00000000..40cc9b1b --- /dev/null +++ b/rootly_sdk/models/status_page_component_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_list_data_item_type import ( + StatusPageComponentListDataItemType, + check_status_page_component_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component import StatusPageComponent + + +T = TypeVar("T", bound="StatusPageComponentListDataItem") + + +@_attrs_define +class StatusPageComponentListDataItem: + """ + Attributes: + id (str): Unique ID of the status page component + type_ (StatusPageComponentListDataItemType): + attributes (StatusPageComponent): + """ + + id: str + type_: StatusPageComponentListDataItemType + attributes: "StatusPageComponent" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component import StatusPageComponent + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_list_data_item_type(d.pop("type")) + + attributes = StatusPageComponent.from_dict(d.pop("attributes")) + + status_page_component_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_list_data_item.additional_properties = d + return status_page_component_list_data_item + + @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/rootly_sdk/models/status_page_component_list_data_item_type.py b/rootly_sdk/models/status_page_component_list_data_item_type.py new file mode 100644 index 00000000..a5c205cd --- /dev/null +++ b/rootly_sdk/models/status_page_component_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +StatusPageComponentListDataItemType = Literal["status_page_components"] + +STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageComponentListDataItemType] = { + "status_page_components", +} + + +def check_status_page_component_list_data_item_type(value: str | None) -> StatusPageComponentListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES: + return cast(StatusPageComponentListDataItemType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_component_response.py b/rootly_sdk/models/status_page_component_response.py new file mode 100644 index 00000000..5330bd92 --- /dev/null +++ b/rootly_sdk/models/status_page_component_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_response_data import StatusPageComponentResponseData + + +T = TypeVar("T", bound="StatusPageComponentResponse") + + +@_attrs_define +class StatusPageComponentResponse: + """ + Attributes: + data (StatusPageComponentResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "StatusPageComponentResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_response_data import StatusPageComponentResponseData + + d = dict(src_dict) + data = StatusPageComponentResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_response = cls( + data=data, + included=included, + ) + + status_page_component_response.additional_properties = d + return status_page_component_response + + @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/rootly_sdk/models/status_page_component_response_data.py b/rootly_sdk/models/status_page_component_response_data.py new file mode 100644 index 00000000..5226ae07 --- /dev/null +++ b/rootly_sdk/models/status_page_component_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_response_data_type import ( + StatusPageComponentResponseDataType, + check_status_page_component_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component import StatusPageComponent + + +T = TypeVar("T", bound="StatusPageComponentResponseData") + + +@_attrs_define +class StatusPageComponentResponseData: + """ + Attributes: + id (str): Unique ID of the status page component + type_ (StatusPageComponentResponseDataType): + attributes (StatusPageComponent): + """ + + id: str + type_: StatusPageComponentResponseDataType + attributes: "StatusPageComponent" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component import StatusPageComponent + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_response_data_type(d.pop("type")) + + attributes = StatusPageComponent.from_dict(d.pop("attributes")) + + status_page_component_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_response_data.additional_properties = d + return status_page_component_response_data + + @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/rootly_sdk/models/status_page_component_response_data_type.py b/rootly_sdk/models/status_page_component_response_data_type.py new file mode 100644 index 00000000..53cc391c --- /dev/null +++ b/rootly_sdk/models/status_page_component_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +StatusPageComponentResponseDataType = Literal["status_page_components"] + +STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES: set[StatusPageComponentResponseDataType] = { + "status_page_components", +} + + +def check_status_page_component_response_data_type(value: str | None) -> StatusPageComponentResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES: + return cast(StatusPageComponentResponseDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_component_status.py b/rootly_sdk/models/status_page_component_status.py new file mode 100644 index 00000000..44bf5402 --- /dev/null +++ b/rootly_sdk/models/status_page_component_status.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +StatusPageComponentStatus = Literal[ + "degraded_performance", "impacted", "maintenance", "major_outage", "operational", "partial_outage" +] + +STATUS_PAGE_COMPONENT_STATUS_VALUES: set[StatusPageComponentStatus] = { + "degraded_performance", + "impacted", + "maintenance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_status_page_component_status(value: str | None) -> StatusPageComponentStatus | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_STATUS_VALUES: + return cast(StatusPageComponentStatus, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/status_page_list.py b/rootly_sdk/models/status_page_list.py index 216a7858..7fa0f7d9 100644 --- a/rootly_sdk/models/status_page_list.py +++ b/rootly_sdk/models/status_page_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class StatusPageList: """ Attributes: - data (list[StatusPageListDataItem]): + data (list['StatusPageListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[StatusPageListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["StatusPageListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_list = cls( data=data, diff --git a/rootly_sdk/models/status_page_list_data_item.py b/rootly_sdk/models/status_page_list_data_item.py index 8269723b..e1f97706 100644 --- a/rootly_sdk/models/status_page_list_data_item.py +++ b/rootly_sdk/models/status_page_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusPageListDataItem: id: str type_: StatusPageListDataItemType - attributes: StatusPage + attributes: "StatusPage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page_response.py b/rootly_sdk/models/status_page_response.py index 68387501..62760d31 100644 --- a/rootly_sdk/models/status_page_response.py +++ b/rootly_sdk/models/status_page_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class StatusPageResponse: """ Attributes: data (StatusPageResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: StatusPageResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "StatusPageResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = StatusPageResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_response_data.py b/rootly_sdk/models/status_page_response_data.py index 0b9f0474..84a57c52 100644 --- a/rootly_sdk/models/status_page_response_data.py +++ b/rootly_sdk/models/status_page_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusPageResponseData: id: str type_: StatusPageResponseDataType - attributes: StatusPage + attributes: "StatusPage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page_template.py b/rootly_sdk/models/status_page_template.py index 082b8b2b..993227c1 100644 --- a/rootly_sdk/models/status_page_template.py +++ b/rootly_sdk/models/status_page_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,12 +19,12 @@ class StatusPageTemplate: body (str): Description of the event the template will populate created_at (str): Date of creation updated_at (str): Date of last update - update_title (None | str | Unset): Title that will be used for the status page update - update_status (None | str | Unset): Status of the event the template will populate - kind (StatusPageTemplateKind | Unset): The kind of the status page template - should_notify_subscribers (bool | None | Unset): Controls if incident subscribers should be notified - enabled (bool | None | Unset): Enable / Disable the status page template - position (int | Unset): Position of the workflow task + update_title (Union[None, Unset, str]): Title that will be used for the status page update + update_status (Union[None, Unset, str]): Status of the event the template will populate + kind (Union[Unset, StatusPageTemplateKind]): The kind of the status page template + should_notify_subscribers (Union[None, Unset, bool]): Controls if incident subscribers should be notified + enabled (Union[None, Unset, bool]): Enable / Disable the status page template + position (Union[Unset, int]): Position of the workflow task """ status_page_id: str @@ -34,12 +32,12 @@ class StatusPageTemplate: body: str created_at: str updated_at: str - update_title: None | str | Unset = UNSET - update_status: None | str | Unset = UNSET - kind: StatusPageTemplateKind | Unset = UNSET - should_notify_subscribers: bool | None | Unset = UNSET - enabled: bool | None | Unset = UNSET - position: int | Unset = UNSET + update_title: None | Unset | str = UNSET + update_status: None | Unset | str = UNSET + kind: Unset | StatusPageTemplateKind = UNSET + should_notify_subscribers: None | Unset | bool = UNSET + enabled: None | Unset | bool = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,29 +51,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - update_title: None | str | Unset + update_title: None | Unset | str if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: None | str | Unset + update_status: None | Unset | str if isinstance(self.update_status, Unset): update_status = UNSET else: update_status = self.update_status - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: bool | None | Unset + should_notify_subscribers: None | Unset | bool if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: should_notify_subscribers = self.should_notify_subscribers - enabled: bool | None | Unset + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -122,46 +120,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_update_title(data: object) -> None | str | Unset: + def _parse_update_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) - def _parse_update_status(data: object) -> None | str | Unset: + def _parse_update_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_status = _parse_update_status(d.pop("update_status", UNSET)) _kind = d.pop("kind", UNSET) - kind: StatusPageTemplateKind | Unset + kind: Unset | StatusPageTemplateKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_status_page_template_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_template_list.py b/rootly_sdk/models/status_page_template_list.py index 8eec7a41..e99a7e7a 100644 --- a/rootly_sdk/models/status_page_template_list.py +++ b/rootly_sdk/models/status_page_template_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class StatusPageTemplateList: """ Attributes: - data (list[StatusPageTemplateListDataItem]): + data (list['StatusPageTemplateListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[StatusPageTemplateListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["StatusPageTemplateListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_template_list = cls( data=data, diff --git a/rootly_sdk/models/status_page_template_list_data_item.py b/rootly_sdk/models/status_page_template_list_data_item.py index 4073c903..9a0b4d49 100644 --- a/rootly_sdk/models/status_page_template_list_data_item.py +++ b/rootly_sdk/models/status_page_template_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class StatusPageTemplateListDataItem: id: str type_: StatusPageTemplateListDataItemType - attributes: StatusPageTemplate + attributes: "StatusPageTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page_template_response.py b/rootly_sdk/models/status_page_template_response.py index 4c1b4eda..70f7dfc2 100644 --- a/rootly_sdk/models/status_page_template_response.py +++ b/rootly_sdk/models/status_page_template_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class StatusPageTemplateResponse: """ Attributes: data (StatusPageTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: StatusPageTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "StatusPageTemplateResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = StatusPageTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_template_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_template_response_data.py b/rootly_sdk/models/status_page_template_response_data.py index 5134cc54..b79e157e 100644 --- a/rootly_sdk/models/status_page_template_response_data.py +++ b/rootly_sdk/models/status_page_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class StatusPageTemplateResponseData: id: str type_: StatusPageTemplateResponseDataType - attributes: StatusPageTemplate + attributes: "StatusPageTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_response.py b/rootly_sdk/models/status_response.py index 3dc0cb9c..cf5eaa4a 100644 --- a/rootly_sdk/models/status_response.py +++ b/rootly_sdk/models/status_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class StatusResponse: """ Attributes: data (StatusResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: StatusResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "StatusResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = StatusResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_response = cls( data=data, diff --git a/rootly_sdk/models/status_response_data.py b/rootly_sdk/models/status_response_data.py index e99a2a6d..973536c0 100644 --- a/rootly_sdk/models/status_response_data.py +++ b/rootly_sdk/models/status_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusResponseData: id: str type_: StatusResponseDataType - attributes: Status + attributes: "Status" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/sub_status.py b/rootly_sdk/models/sub_status.py index 6018ef9b..890672f8 100644 --- a/rootly_sdk/models/sub_status.py +++ b/rootly_sdk/models/sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,18 +18,18 @@ class SubStatus: parent_status (SubStatusParentStatus): created_at (str): updated_at (str): - slug (str | Unset): - description (None | str | Unset): - position (int | None | Unset): + slug (Union[Unset, str]): + description (Union[None, Unset, str]): + position (Union[None, Unset, int]): """ name: str parent_status: SubStatusParentStatus created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -89,21 +87,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/sub_status_list.py b/rootly_sdk/models/sub_status_list.py index 4ee3da17..e9eaec8c 100644 --- a/rootly_sdk/models/sub_status_list.py +++ b/rootly_sdk/models/sub_status_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class SubStatusList: """ Attributes: - data (list[SubStatusListDataItem]): + data (list['SubStatusListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[SubStatusListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["SubStatusListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sub_status_list = cls( data=data, diff --git a/rootly_sdk/models/sub_status_list_data_item.py b/rootly_sdk/models/sub_status_list_data_item.py index 0c2ad36a..364a7b4e 100644 --- a/rootly_sdk/models/sub_status_list_data_item.py +++ b/rootly_sdk/models/sub_status_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SubStatusListDataItem: id: str type_: SubStatusListDataItemType - attributes: SubStatus + attributes: "SubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/sub_status_response.py b/rootly_sdk/models/sub_status_response.py index b6929ea4..06ad1b35 100644 --- a/rootly_sdk/models/sub_status_response.py +++ b/rootly_sdk/models/sub_status_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class SubStatusResponse: """ Attributes: data (SubStatusResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: SubStatusResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "SubStatusResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = SubStatusResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sub_status_response = cls( data=data, diff --git a/rootly_sdk/models/sub_status_response_data.py b/rootly_sdk/models/sub_status_response_data.py index fabf203f..7766e6a6 100644 --- a/rootly_sdk/models/sub_status_response_data.py +++ b/rootly_sdk/models/sub_status_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SubStatusResponseData: id: str type_: SubStatusResponseDataType - attributes: SubStatus + attributes: "SubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/team.py b/rootly_sdk/models/team.py index e8403ea1..84566f7a 100644 --- a/rootly_sdk/models/team.py +++ b/rootly_sdk/models/team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,74 +26,80 @@ class Team: name (str): The name of the team created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): - managed_by (TeamManagedBy | Unset): How this team is managed (provenance): web, api, terraform, etc. Read-only. - description (None | str | Unset): The description of the team - notify_emails (list[str] | None | Unset): Emails to attach to the team - color (None | str | Unset): The hex color of the team - position (int | None | Unset): Position of the team - backstage_id (None | str | Unset): The Backstage entity id associated to this team. eg: + slug (Union[Unset, str]): + managed_by (Union[Unset, TeamManagedBy]): How this team is managed (provenance): web, api, terraform, etc. Read- + only. + description (Union[None, Unset, str]): The description of the team + public_description (Union[None, Unset, str]): The status page description of the team + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the team + color (Union[None, Unset, str]): The hex color of the team + position (Union[None, Unset, int]): Position of the team + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this team. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this team - pagerduty_id (None | str | Unset): The PagerDuty group id associated to this team - pagerduty_service_id (None | str | Unset): The PagerDuty service id associated to this team - opsgenie_id (None | str | Unset): The Opsgenie group id associated to this team - victor_ops_id (None | str | Unset): The VictorOps group id associated to this team - pagertree_id (None | str | Unset): The PagerTree group id associated to this team - cortex_id (None | str | Unset): The Cortex group id associated to this team - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this team - user_ids (list[int] | None | Unset): The user ids of the members of this team. - admin_ids (list[int] | None | Unset): The user ids of the admins of this team. These users must also be present - in user_ids attribute. - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alerts_email_address (None | str | Unset): Email generated to send alerts to - alert_urgency_id (None | str | Unset): The alert urgency id of the team - slack_channels (list[TeamSlackChannelsType0Item] | None | Unset): Slack Channels associated with this team - slack_aliases (list[TeamSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this team - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | TeamAlertBroadcastChannelType0 | Unset): Slack channel to broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | TeamIncidentBroadcastChannelType0 | Unset): Slack channel to broadcast + external_id (Union[None, Unset, str]): The external id associated to this team + pagerduty_id (Union[None, Unset, str]): The PagerDuty group id associated to this team + pagerduty_service_id (Union[None, Unset, str]): The PagerDuty service id associated to this team + opsgenie_id (Union[None, Unset, str]): The Opsgenie group id associated to this team + victor_ops_id (Union[None, Unset, str]): The VictorOps group id associated to this team + pagertree_id (Union[None, Unset, str]): The PagerTree group id associated to this team + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this team + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this team + user_ids (Union[None, Unset, list[int]]): The user ids of the members of this team. + admin_ids (Union[None, Unset, list[int]]): The user ids of the admins of this team. These users must also be + present in user_ids attribute. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alerts_email_address (Union[None, Unset, str]): Email generated to send alerts to + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the team + slack_channels (Union[None, Unset, list['TeamSlackChannelsType0Item']]): Slack Channels associated with this + team + slack_aliases (Union[None, Unset, list['TeamSlackAliasesType0Item']]): Slack Aliases associated with this team + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['TeamAlertBroadcastChannelType0', None, Unset]): Slack channel to broadcast + alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['TeamIncidentBroadcastChannelType0', None, Unset]): Slack channel to broadcast incidents to - auto_add_members_when_attached (bool | None | Unset): Auto add members to incident channel when team is attached - auto_add_members_scope (TeamAutoAddMembersScope | Unset): Visibility-scoped auto-add behavior. Only present when - the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When set, it overrides - `auto_add_members_when_attached`. - properties (list[TeamPropertiesType0Item] | None | Unset): Array of property values for this team. + auto_add_members_when_attached (Union[None, Unset, bool]): Auto add members to incident channel when team is + attached + auto_add_members_scope (Union[Unset, TeamAutoAddMembersScope]): Visibility-scoped auto-add behavior. Only + present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When set, it + overrides `auto_add_members_when_attached`. + properties (Union[None, Unset, list['TeamPropertiesType0Item']]): Array of property values for this team. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: TeamManagedBy | Unset = UNSET - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - user_ids: list[int] | None | Unset = UNSET - admin_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alerts_email_address: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - slack_channels: list[TeamSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[TeamSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | TeamAlertBroadcastChannelType0 | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | TeamIncidentBroadcastChannelType0 | Unset = UNSET - auto_add_members_when_attached: bool | None | Unset = UNSET - auto_add_members_scope: TeamAutoAddMembersScope | Unset = UNSET - properties: list[TeamPropertiesType0Item] | None | Unset = UNSET + slug: Unset | str = UNSET + managed_by: Unset | TeamManagedBy = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + user_ids: None | Unset | list[int] = UNSET + admin_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alerts_email_address: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["TeamSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["TeamSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET + alert_broadcast_channel: Union["TeamAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET + incident_broadcast_channel: Union["TeamIncidentBroadcastChannelType0", None, Unset] = UNSET + auto_add_members_when_attached: None | Unset | bool = UNSET + auto_add_members_scope: Unset | TeamAutoAddMembersScope = UNSET + properties: None | Unset | list["TeamPropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -110,17 +114,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -129,73 +139,73 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | str | Unset + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: list[int] | None | Unset + user_ids: None | Unset | list[int] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -204,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: list[int] | None | Unset + admin_ids: None | Unset | list[int] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -213,25 +223,25 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: None | str | Unset + alerts_email_address: None | Unset | str if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -243,7 +253,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -255,13 +265,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, TeamAlertBroadcastChannelType0): @@ -269,13 +279,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, TeamIncidentBroadcastChannelType0): @@ -283,17 +293,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: bool | None | Unset + auto_add_members_when_attached: None | Unset | bool if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: str | Unset = UNSET + auto_add_members_scope: Unset | str = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: list[dict[str, Any]] | None | Unset + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -320,6 +330,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["managed_by"] = managed_by if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -393,22 +405,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: TeamManagedBy | Unset + managed_by: Unset | TeamManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_team_managed_by(_managed_by) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -419,112 +440,112 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> list[int] | None | Unset: + def _parse_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -535,13 +556,13 @@ def _parse_user_ids(data: object) -> list[int] | None | Unset: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> list[int] | None | Unset: + def _parse_admin_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -552,40 +573,40 @@ def _parse_admin_ids(data: object) -> list[int] | None | Unset: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> None | str | Unset: + def _parse_alerts_email_address(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> list[TeamSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> None | Unset | list["TeamSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -601,13 +622,13 @@ def _parse_slack_channels(data: object) -> list[TeamSlackChannelsType0Item] | No slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["TeamSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[TeamSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> None | Unset | list["TeamSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -623,22 +644,22 @@ def _parse_slack_aliases(data: object) -> list[TeamSlackAliasesType0Item] | None slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["TeamSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) - def _parse_alert_broadcast_channel(data: object) -> None | TeamAlertBroadcastChannelType0 | Unset: + def _parse_alert_broadcast_channel(data: object) -> Union["TeamAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -649,22 +670,22 @@ def _parse_alert_broadcast_channel(data: object) -> None | TeamAlertBroadcastCha alert_broadcast_channel_type_0 = TeamAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | TeamAlertBroadcastChannelType0 | Unset, data) + return cast(Union["TeamAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) - def _parse_incident_broadcast_channel(data: object) -> None | TeamIncidentBroadcastChannelType0 | Unset: + def _parse_incident_broadcast_channel(data: object) -> Union["TeamIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -675,31 +696,31 @@ def _parse_incident_broadcast_channel(data: object) -> None | TeamIncidentBroadc incident_broadcast_channel_type_0 = TeamIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | TeamIncidentBroadcastChannelType0 | Unset, data) + return cast(Union["TeamIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: + def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: TeamAutoAddMembersScope | Unset + auto_add_members_scope: Unset | TeamAutoAddMembersScope if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_team_auto_add_members_scope(_auto_add_members_scope) - def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> None | Unset | list["TeamPropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -715,9 +736,9 @@ def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Un properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamPropertiesType0Item] | None | Unset, data) + return cast(None | Unset | list["TeamPropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) @@ -728,6 +749,7 @@ def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Un slug=slug, managed_by=managed_by, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py index 137ccd8f..091dde36 100644 --- a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class TeamAlertBroadcastChannelType0: """Slack channel to broadcast alerts to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py index 787a395f..43046eb0 100644 --- a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class TeamIncidentBroadcastChannelType0: """Slack channel to broadcast incidents to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/team_list.py b/rootly_sdk/models/team_list.py index 7980ecc0..614907f6 100644 --- a/rootly_sdk/models/team_list.py +++ b/rootly_sdk/models/team_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class TeamList: """ Attributes: - data (list[TeamListDataItem]): + data (list['TeamListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[TeamListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["TeamListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) team_list = cls( data=data, diff --git a/rootly_sdk/models/team_list_data_item.py b/rootly_sdk/models/team_list_data_item.py index b96b9d0e..836ccae2 100644 --- a/rootly_sdk/models/team_list_data_item.py +++ b/rootly_sdk/models/team_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class TeamListDataItem: id: str type_: TeamListDataItemType - attributes: Team + attributes: "Team" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/team_properties_type_0_item.py b/rootly_sdk/models/team_properties_type_0_item.py index c184a5a0..be192ceb 100644 --- a/rootly_sdk/models/team_properties_type_0_item.py +++ b/rootly_sdk/models/team_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/team_response.py b/rootly_sdk/models/team_response.py index 4055376a..ec639c53 100644 --- a/rootly_sdk/models/team_response.py +++ b/rootly_sdk/models/team_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class TeamResponse: """ Attributes: data (TeamResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: TeamResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "TeamResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = TeamResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) team_response = cls( data=data, diff --git a/rootly_sdk/models/team_response_data.py b/rootly_sdk/models/team_response_data.py index 16ecf771..50e1b9a5 100644 --- a/rootly_sdk/models/team_response_data.py +++ b/rootly_sdk/models/team_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class TeamResponseData: id: str type_: TeamResponseDataType - attributes: Team + attributes: "Team" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/team_slack_aliases_type_0_item.py b/rootly_sdk/models/team_slack_aliases_type_0_item.py index 5dfb959c..e489c76a 100644 --- a/rootly_sdk/models/team_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/team_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/team_slack_channels_type_0_item.py b/rootly_sdk/models/team_slack_channels_type_0_item.py index 9f85b005..f91186df 100644 --- a/rootly_sdk/models/team_slack_channels_type_0_item.py +++ b/rootly_sdk/models/team_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/tiptap_block_schema.py b/rootly_sdk/models/tiptap_block_schema.py index 4b4f48e3..e0255e8f 100644 --- a/rootly_sdk/models/tiptap_block_schema.py +++ b/rootly_sdk/models/tiptap_block_schema.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,21 +19,20 @@ class TiptapBlockSchema: """TipTap block component schema for post mortem templates Attributes: - followup_component (TiptapBlockSchemaFollowupComponent | Unset): Followup component block - timeline_component (TiptapBlockSchemaTimelineComponent | Unset): Timeline component block + followup_component (Union[Unset, TiptapBlockSchemaFollowupComponent]): Followup component block + timeline_component (Union[Unset, TiptapBlockSchemaTimelineComponent]): Timeline component block """ - followup_component: TiptapBlockSchemaFollowupComponent | Unset = UNSET - timeline_component: TiptapBlockSchemaTimelineComponent | Unset = UNSET + followup_component: Union[Unset, "TiptapBlockSchemaFollowupComponent"] = UNSET + timeline_component: Union[Unset, "TiptapBlockSchemaTimelineComponent"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - followup_component: dict[str, Any] | Unset = UNSET + followup_component: Unset | dict[str, Any] = UNSET if not isinstance(self.followup_component, Unset): followup_component = self.followup_component.to_dict() - timeline_component: dict[str, Any] | Unset = UNSET + timeline_component: Unset | dict[str, Any] = UNSET if not isinstance(self.timeline_component, Unset): timeline_component = self.timeline_component.to_dict() @@ -56,14 +53,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _followup_component = d.pop("followup_component", UNSET) - followup_component: TiptapBlockSchemaFollowupComponent | Unset + followup_component: Unset | TiptapBlockSchemaFollowupComponent if isinstance(_followup_component, Unset): followup_component = UNSET else: followup_component = TiptapBlockSchemaFollowupComponent.from_dict(_followup_component) _timeline_component = d.pop("timeline_component", UNSET) - timeline_component: TiptapBlockSchemaTimelineComponent | Unset + timeline_component: Unset | TiptapBlockSchemaTimelineComponent if isinstance(_timeline_component, Unset): timeline_component = UNSET else: diff --git a/rootly_sdk/models/tiptap_block_schema_followup_component.py b/rootly_sdk/models/tiptap_block_schema_followup_component.py index 8220706b..d233714d 100644 --- a/rootly_sdk/models/tiptap_block_schema_followup_component.py +++ b/rootly_sdk/models/tiptap_block_schema_followup_component.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,18 +21,18 @@ class TiptapBlockSchemaFollowupComponent: html (str): HTML representation:
Example:
. - data_sort (TiptapBlockSchemaFollowupComponentDataSort | Unset): Sort order for followups. Valid values: + data_sort (Union[Unset, TiptapBlockSchemaFollowupComponentDataSort]): Sort order for followups. Valid values: due_date, status, priority Default: 'due_date'. """ html: str - data_sort: TiptapBlockSchemaFollowupComponentDataSort | Unset = "due_date" + data_sort: Unset | TiptapBlockSchemaFollowupComponentDataSort = "due_date" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: html = self.html - data_sort: str | Unset = UNSET + data_sort: Unset | str = UNSET if not isinstance(self.data_sort, Unset): data_sort = self.data_sort @@ -56,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: html = d.pop("html") _data_sort = d.pop("data_sort", UNSET) - data_sort: TiptapBlockSchemaFollowupComponentDataSort | Unset + data_sort: Unset | TiptapBlockSchemaFollowupComponentDataSort if isinstance(_data_sort, Unset): data_sort = UNSET else: diff --git a/rootly_sdk/models/tiptap_block_schema_timeline_component.py b/rootly_sdk/models/tiptap_block_schema_timeline_component.py index a8ec7f99..8eef08fc 100644 --- a/rootly_sdk/models/tiptap_block_schema_timeline_component.py +++ b/rootly_sdk/models/tiptap_block_schema_timeline_component.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/trigger_workflow_task_params.py b/rootly_sdk/models/trigger_workflow_task_params.py index e80d9bed..cfae5e0b 100644 --- a/rootly_sdk/models/trigger_workflow_task_params.py +++ b/rootly_sdk/models/trigger_workflow_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -37,27 +35,25 @@ class TriggerWorkflowTaskParams: :slug, :sequential_id, :pagerduty_incident_id, :opsgenie_incident_id, :victor_ops_incident_id, :jira_issue_id, :asana_task_id, :shortcut_task_id, :linear_issue_id, :zendesk_ticket_id, :motion_task_id, :trello_card_id, :airtable_record_id, :shortcut_story_id, :github_issue_id, :freshservice_ticket_id, :freshservice_task_id, - :clickup_task_id]", "(post_mortem) kind can only match [:id]", "(action_item) kind can only match [:id, - :jira_issue_id, :asana_task_id, :shortcut_task_id, :linear_issue_id, :zendesk_ticket_id, :motion_task_id, - :trello_card_id, :airtable_record_id, :shortcut_story_id, :github_issue_id, :freshservice_ticket_id, - :freshservice_task_id, :clickup_task_id]", "(pulse) kind can only match [:id]", "(alert) kind can only match - [:id]"] Default: 'id'. + :clickup_task_id]", "(action_item) kind can only match [:id, :jira_issue_id, :asana_task_id, :shortcut_task_id, + :linear_issue_id, :zendesk_ticket_id, :motion_task_id, :trello_card_id, :airtable_record_id, :shortcut_story_id, + :github_issue_id, :freshservice_ticket_id, :freshservice_task_id, :clickup_task_id]", "(post_mortem) kind can + only match [:id]", "(pulse) kind can only match [:id]", "(alert) kind can only match [:id]"] Default: 'id'. resource (TriggerWorkflowTaskParamsResource): workflow (TriggerWorkflowTaskParamsWorkflow): - task_type (TriggerWorkflowTaskParamsTaskType | Unset): - check_workflow_conditions (bool | Unset): + task_type (Union[Unset, TriggerWorkflowTaskParamsTaskType]): + check_workflow_conditions (Union[Unset, bool]): """ - resource: TriggerWorkflowTaskParamsResource - workflow: TriggerWorkflowTaskParamsWorkflow + resource: "TriggerWorkflowTaskParamsResource" + workflow: "TriggerWorkflowTaskParamsWorkflow" kind: TriggerWorkflowTaskParamsKind = "incident" attribute_to_query_by: TriggerWorkflowTaskParamsAttributeToQueryBy = "id" - task_type: TriggerWorkflowTaskParamsTaskType | Unset = UNSET - check_workflow_conditions: bool | Unset = UNSET + task_type: Unset | TriggerWorkflowTaskParamsTaskType = UNSET + check_workflow_conditions: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str = self.kind attribute_to_query_by: str = self.attribute_to_query_by @@ -66,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: workflow = self.workflow.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -104,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: workflow = TriggerWorkflowTaskParamsWorkflow.from_dict(d.pop("workflow")) _task_type = d.pop("task_type", UNSET) - task_type: TriggerWorkflowTaskParamsTaskType | Unset + task_type: Unset | TriggerWorkflowTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/trigger_workflow_task_params_resource.py b/rootly_sdk/models/trigger_workflow_task_params_resource.py index 79d16a80..00c4d41f 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_resource.py +++ b/rootly_sdk/models/trigger_workflow_task_params_resource.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class TriggerWorkflowTaskParamsResource: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/trigger_workflow_task_params_workflow.py b/rootly_sdk/models/trigger_workflow_task_params_workflow.py index c4ad90c9..4eb056c6 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_workflow.py +++ b/rootly_sdk/models/trigger_workflow_task_params_workflow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class TriggerWorkflowTaskParamsWorkflow: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/tweet_twitter_message_task_params.py b/rootly_sdk/models/tweet_twitter_message_task_params.py index 9c9498a3..41f13fc8 100644 --- a/rootly_sdk/models/tweet_twitter_message_task_params.py +++ b/rootly_sdk/models/tweet_twitter_message_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,17 +18,17 @@ class TweetTwitterMessageTaskParams: """ Attributes: message (str): - task_type (TweetTwitterMessageTaskParamsTaskType | Unset): + task_type (Union[Unset, TweetTwitterMessageTaskParamsTaskType]): """ message: str - task_type: TweetTwitterMessageTaskParamsTaskType | Unset = UNSET + task_type: Unset | TweetTwitterMessageTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -52,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: TweetTwitterMessageTaskParamsTaskType | Unset + task_type: Unset | TweetTwitterMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/unassign_role_from_user.py b/rootly_sdk/models/unassign_role_from_user.py index a24c2f9a..3475de0e 100644 --- a/rootly_sdk/models/unassign_role_from_user.py +++ b/rootly_sdk/models/unassign_role_from_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UnassignRoleFromUser: data (UnassignRoleFromUserData): """ - data: UnassignRoleFromUserData + data: "UnassignRoleFromUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/unassign_role_from_user_data.py b/rootly_sdk/models/unassign_role_from_user_data.py index 5b70d1d0..8771ae9c 100644 --- a/rootly_sdk/models/unassign_role_from_user_data.py +++ b/rootly_sdk/models/unassign_role_from_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UnassignRoleFromUserData: """ type_: UnassignRoleFromUserDataType - attributes: UnassignRoleFromUserDataAttributes + attributes: "UnassignRoleFromUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/unassign_role_from_user_data_attributes.py b/rootly_sdk/models/unassign_role_from_user_data_attributes.py index b936640f..6f79ddc6 100644 --- a/rootly_sdk/models/unassign_role_from_user_data_attributes.py +++ b/rootly_sdk/models/unassign_role_from_user_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +12,12 @@ class UnassignRoleFromUserDataAttributes: """ Attributes: - user_id (str | Unset): ID of user you wish to remove as assigned user from this incident - incident_role_id (str | Unset): ID of the incident role + user_id (Union[Unset, str]): ID of user you wish to remove as assigned user from this incident + incident_role_id (Union[Unset, str]): ID of the incident role """ - user_id: str | Unset = UNSET - incident_role_id: str | Unset = UNSET + user_id: Unset | str = UNSET + incident_role_id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_action_item_task_params.py b/rootly_sdk/models/update_action_item_task_params.py index 11036577..f7d9e4bd 100644 --- a/rootly_sdk/models/update_action_item_task_params.py +++ b/rootly_sdk/models/update_action_item_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,41 +36,41 @@ class UpdateActionItemTaskParams: query_value (str): Value that attribute_to_query_by to uses to match against attribute_to_query_by (UpdateActionItemTaskParamsAttributeToQueryBy): Attribute of the action item to match against Default: 'id'. - task_type (UpdateActionItemTaskParamsTaskType | Unset): - summary (str | Unset): Brief description of the action item - assigned_to_user_id (str | Unset): [DEPRECATED] Use assigned_to_user attribute instead. The user id this action - item is assigned to - assigned_to_user (UpdateActionItemTaskParamsAssignedToUser | Unset): The user this action item is assigned to - group_ids (list[str] | None | Unset): - description (str | Unset): The action item description - priority (UpdateActionItemTaskParamsPriority | Unset): The action item priority - status (UpdateActionItemTaskParamsStatus | Unset): The action item status - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateActionItemTaskParamsTaskType]): + summary (Union[Unset, str]): Brief description of the action item + assigned_to_user_id (Union[Unset, str]): [DEPRECATED] Use assigned_to_user attribute instead. The user id this + action item is assigned to + assigned_to_user (Union[Unset, UpdateActionItemTaskParamsAssignedToUser]): The user this action item is + assigned to + group_ids (Union[None, Unset, list[str]]): + description (Union[Unset, str]): The action item description + priority (Union[Unset, UpdateActionItemTaskParamsPriority]): The action item priority + status (Union[Unset, UpdateActionItemTaskParamsStatus]): The action item status + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - post_to_incident_timeline (bool | Unset): + post_to_incident_timeline (Union[Unset, bool]): """ query_value: str attribute_to_query_by: UpdateActionItemTaskParamsAttributeToQueryBy = "id" - task_type: UpdateActionItemTaskParamsTaskType | Unset = UNSET - summary: str | Unset = UNSET - assigned_to_user_id: str | Unset = UNSET - assigned_to_user: UpdateActionItemTaskParamsAssignedToUser | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - description: str | Unset = UNSET - priority: UpdateActionItemTaskParamsPriority | Unset = UNSET - status: UpdateActionItemTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET + task_type: Unset | UpdateActionItemTaskParamsTaskType = UNSET + summary: Unset | str = UNSET + assigned_to_user_id: Unset | str = UNSET + assigned_to_user: Union[Unset, "UpdateActionItemTaskParamsAssignedToUser"] = UNSET + group_ids: None | Unset | list[str] = UNSET + description: Unset | str = UNSET + priority: Unset | UpdateActionItemTaskParamsPriority = UNSET + status: Unset | UpdateActionItemTaskParamsStatus = UNSET + custom_fields_mapping: None | Unset | str = UNSET + post_to_incident_timeline: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - query_value = self.query_value attribute_to_query_by: str = self.attribute_to_query_by - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -80,11 +78,11 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: dict[str, Any] | Unset = UNSET + assigned_to_user: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -95,15 +93,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -154,7 +152,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _task_type = d.pop("task_type", UNSET) - task_type: UpdateActionItemTaskParamsTaskType | Unset + task_type: Unset | UpdateActionItemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -165,13 +163,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: UpdateActionItemTaskParamsAssignedToUser | Unset + assigned_to_user: Unset | UpdateActionItemTaskParamsAssignedToUser if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: assigned_to_user = UpdateActionItemTaskParamsAssignedToUser.from_dict(_assigned_to_user) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -182,34 +180,34 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateActionItemTaskParamsPriority | Unset + priority: Unset | UpdateActionItemTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_action_item_task_params_priority(_priority) _status = d.pop("status", UNSET) - status: UpdateActionItemTaskParamsStatus | Unset + status: Unset | UpdateActionItemTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_action_item_task_params_status(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py b/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py index 215e2fc0..e3bd45eb 100644 --- a/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py +++ b/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateActionItemTaskParamsAssignedToUser: """The user this action item is assigned to Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_airtable_table_record_task_params.py b/rootly_sdk/models/update_airtable_table_record_task_params.py index 59509bfc..5df66fe6 100644 --- a/rootly_sdk/models/update_airtable_table_record_task_params.py +++ b/rootly_sdk/models/update_airtable_table_record_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,16 +20,16 @@ class UpdateAirtableTableRecordTaskParams: base_key (str): The base key table_name (str): The table name record_id (str): The record id - task_type (UpdateAirtableTableRecordTaskParamsTaskType | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ base_key: str table_name: str record_id: str - task_type: UpdateAirtableTableRecordTaskParamsTaskType | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Unset | UpdateAirtableTableRecordTaskParamsTaskType = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,11 +39,11 @@ def to_dict(self) -> dict[str, Any]: record_id = self.record_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -77,18 +75,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_id = d.pop("record_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateAirtableTableRecordTaskParamsTaskType | Unset + task_type: Unset | UpdateAirtableTableRecordTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_airtable_table_record_task_params_task_type(_task_type) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_alert.py b/rootly_sdk/models/update_alert.py index 323f3c5c..761a488e 100644 --- a/rootly_sdk/models/update_alert.py +++ b/rootly_sdk/models/update_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlert: data (UpdateAlertData): """ - data: UpdateAlertData + data: "UpdateAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_data.py b/rootly_sdk/models/update_alert_data.py index 730a1655..2caed9f1 100644 --- a/rootly_sdk/models/update_alert_data.py +++ b/rootly_sdk/models/update_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertData: """ type_: UpdateAlertDataType - attributes: UpdateAlertDataAttributes + attributes: "UpdateAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_data_attributes.py b/rootly_sdk/models/update_alert_data_attributes.py index 0822a489..849255f4 100644 --- a/rootly_sdk/models/update_alert_data_attributes.py +++ b/rootly_sdk/models/update_alert_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -28,46 +26,48 @@ class UpdateAlertDataAttributes: """ Attributes: - noise (UpdateAlertDataAttributesNoise | Unset): Whether the alert is marked as noise - source (str | Unset): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults to - `api`. - summary (str | Unset): The summary of the alert - description (None | str | Unset): The description of the alert - service_ids (list[str] | None | Unset): The Service IDs to attach to the alert - group_ids (list[str] | None | Unset): The Group IDs to attach to the alert - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the alert - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the alert - started_at (datetime.datetime | None | Unset): Alert start datetime - ended_at (datetime.datetime | None | Unset): Alert end datetime - external_id (None | str | Unset): External ID - external_url (None | str | Unset): External Url - alert_urgency_id (None | str | Unset): The ID of the alert urgency - labels (list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset): - data (None | Unset | UpdateAlertDataAttributesDataType0): Additional data - deduplication_key (None | str | Unset): Alerts sharing the same deduplication key are treated as a single alert. - alert_field_values_attributes (list[None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0] | - Unset): Custom alert field values to create with the alert + noise (Union[Unset, UpdateAlertDataAttributesNoise]): Whether the alert is marked as noise + source (Union[Unset, str]): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults + to `api`. + summary (Union[Unset, str]): The summary of the alert + description (Union[None, Unset, str]): The description of the alert + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the alert + group_ids (Union[None, Unset, list[str]]): The Group IDs to attach to the alert + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the alert + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the alert + started_at (Union[None, Unset, datetime.datetime]): Alert start datetime + ended_at (Union[None, Unset, datetime.datetime]): Alert end datetime + external_id (Union[None, Unset, str]): External ID + external_url (Union[None, Unset, str]): External Url + alert_urgency_id (Union[None, Unset, str]): The ID of the alert urgency + labels (Union[Unset, list[Union['UpdateAlertDataAttributesLabelsItemType0', None]]]): + data (Union['UpdateAlertDataAttributesDataType0', None, Unset]): Additional data + deduplication_key (Union[None, Unset, str]): Alerts sharing the same deduplication key are treated as a single + alert. + alert_field_values_attributes (Union[Unset, + list[Union['UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0', None]]]): Custom alert field values + to create with the alert """ - noise: UpdateAlertDataAttributesNoise | Unset = UNSET - source: str | Unset = UNSET - summary: str | Unset = UNSET - description: None | str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_id: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - labels: list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset = UNSET - data: None | Unset | UpdateAlertDataAttributesDataType0 = UNSET - deduplication_key: None | str | Unset = UNSET - alert_field_values_attributes: list[None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0] | Unset = ( - UNSET - ) + noise: Unset | UpdateAlertDataAttributesNoise = UNSET + source: Unset | str = UNSET + summary: Unset | str = UNSET + description: None | Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_id: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + labels: Unset | list[Union["UpdateAlertDataAttributesLabelsItemType0", None]] = UNSET + data: Union["UpdateAlertDataAttributesDataType0", None, Unset] = UNSET + deduplication_key: None | Unset | str = UNSET + alert_field_values_attributes: ( + Unset | list[Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_alert_data_attributes_data_type_0 import UpdateAlertDataAttributesDataType0 from ..models.update_alert_data_attributes_labels_item_type_0 import UpdateAlertDataAttributesLabelsItemType0 - noise: str | Unset = UNSET + noise: Unset | str = UNSET if not isinstance(self.noise, Unset): noise = self.noise @@ -84,13 +84,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -126,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -134,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -142,36 +142,36 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: None | dict[str, Any] if isinstance(labels_item_data, UpdateAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdateAlertDataAttributesDataType0): @@ -179,17 +179,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: None | str | Unset + deduplication_key: None | Unset | str if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: list[dict[str, Any] | None] | Unset = UNSET + alert_field_values_attributes: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.alert_field_values_attributes, Unset): alert_field_values_attributes = [] for alert_field_values_attributes_item_data in self.alert_field_values_attributes: - alert_field_values_attributes_item: dict[str, Any] | None + alert_field_values_attributes_item: None | dict[str, Any] if isinstance( alert_field_values_attributes_item_data, UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, @@ -249,7 +249,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _noise = d.pop("noise", UNSET) - noise: UpdateAlertDataAttributesNoise | Unset + noise: Unset | UpdateAlertDataAttributesNoise if isinstance(_noise, Unset): noise = UNSET else: @@ -259,16 +259,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -279,13 +279,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -296,13 +296,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -313,13 +313,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -330,13 +330,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -347,13 +347,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -364,63 +364,61 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> None | UpdateAlertDataAttributesLabelsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = UpdateAlertDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["UpdateAlertDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = UpdateAlertDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdateAlertDataAttributesLabelsItemType0, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdateAlertDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) - def _parse_data(data: object) -> None | Unset | UpdateAlertDataAttributesDataType0: + def _parse_data(data: object) -> Union["UpdateAlertDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -431,51 +429,47 @@ def _parse_data(data: object) -> None | Unset | UpdateAlertDataAttributesDataTyp data_type_0 = UpdateAlertDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertDataAttributesDataType0, data) + return cast(Union["UpdateAlertDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> None | str | Unset: + def _parse_deduplication_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) + alert_field_values_attributes = [] _alert_field_values_attributes = d.pop("alert_field_values_attributes", UNSET) - alert_field_values_attributes: ( - list[None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0] | Unset - ) = UNSET - if _alert_field_values_attributes is not UNSET: - alert_field_values_attributes = [] - for alert_field_values_attributes_item_data in _alert_field_values_attributes: - - def _parse_alert_field_values_attributes_item( - data: object, - ) -> None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - alert_field_values_attributes_item_type_0 = ( - UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) - ) - - return alert_field_values_attributes_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, data) - - alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( - alert_field_values_attributes_item_data - ) - - alert_field_values_attributes.append(alert_field_values_attributes_item) + for alert_field_values_attributes_item_data in _alert_field_values_attributes or []: + + def _parse_alert_field_values_attributes_item( + data: object, + ) -> Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + alert_field_values_attributes_item_type_0 = ( + UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) + ) + + return alert_field_values_attributes_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None], data) + + alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( + alert_field_values_attributes_item_data + ) + + alert_field_values_attributes.append(alert_field_values_attributes_item) update_alert_data_attributes = cls( noise=noise, diff --git a/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py b/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py index ff427941..f34dfe8e 100644 --- a/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_alert_data_attributes_data_type_0.py b/rootly_sdk/models/update_alert_data_attributes_data_type_0.py index 29405f27..300227e7 100644 --- a/rootly_sdk/models/update_alert_data_attributes_data_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateAlertDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py b/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py index 52b1e2d8..369b1029 100644 --- a/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,7 +12,7 @@ class UpdateAlertDataAttributesLabelsItemType0: """ Attributes: key (str): Key of the tag - value (bool | float | str): Value of the tag + value (Union[bool, float, str]): Value of the tag """ key: str diff --git a/rootly_sdk/models/update_alert_event.py b/rootly_sdk/models/update_alert_event.py index 6e00bcc1..7e1573dc 100644 --- a/rootly_sdk/models/update_alert_event.py +++ b/rootly_sdk/models/update_alert_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,11 +19,10 @@ class UpdateAlertEvent: data (UpdateAlertEventData): """ - data: UpdateAlertEventData + data: "UpdateAlertEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_event_data.py b/rootly_sdk/models/update_alert_event_data.py index dde651dc..9c5af1dd 100644 --- a/rootly_sdk/models/update_alert_event_data.py +++ b/rootly_sdk/models/update_alert_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertEventData: """ type_: UpdateAlertEventDataType - attributes: UpdateAlertEventDataAttributes + attributes: "UpdateAlertEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_event_data_attributes.py b/rootly_sdk/models/update_alert_event_data_attributes.py index 82b7f634..03b49195 100644 --- a/rootly_sdk/models/update_alert_event_data_attributes.py +++ b/rootly_sdk/models/update_alert_event_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,11 +13,11 @@ class UpdateAlertEventDataAttributes: """ Attributes: details (str): Note message. - user_id (int | Unset): Author of the note. + user_id (Union[Unset, int]): Author of the note. """ details: str - user_id: int | Unset = UNSET + user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: details = self.details diff --git a/rootly_sdk/models/update_alert_field.py b/rootly_sdk/models/update_alert_field.py index 06649e62..fa71ba3b 100644 --- a/rootly_sdk/models/update_alert_field.py +++ b/rootly_sdk/models/update_alert_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertField: data (UpdateAlertFieldData): """ - data: UpdateAlertFieldData + data: "UpdateAlertFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_field_data.py b/rootly_sdk/models/update_alert_field_data.py index e2ed53d9..3eb15a6f 100644 --- a/rootly_sdk/models/update_alert_field_data.py +++ b/rootly_sdk/models/update_alert_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertFieldData: """ type_: UpdateAlertFieldDataType - attributes: UpdateAlertFieldDataAttributes + attributes: "UpdateAlertFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_field_data_attributes.py b/rootly_sdk/models/update_alert_field_data_attributes.py index 67e5080a..cee07f25 100644 --- a/rootly_sdk/models/update_alert_field_data_attributes.py +++ b/rootly_sdk/models/update_alert_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -14,17 +12,28 @@ class UpdateAlertFieldDataAttributes: """ Attributes: - name (str | Unset): The name of the alert field + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the alert field """ - name: str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name @@ -33,9 +42,20 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) update_alert_field_data_attributes = cls( + slug=slug, name=name, ) diff --git a/rootly_sdk/models/update_alert_group.py b/rootly_sdk/models/update_alert_group.py index d37bfcee..6576d80b 100644 --- a/rootly_sdk/models/update_alert_group.py +++ b/rootly_sdk/models/update_alert_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertGroup: data (UpdateAlertGroupData): """ - data: UpdateAlertGroupData + data: "UpdateAlertGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_group_data.py b/rootly_sdk/models/update_alert_group_data.py index 3e166626..f39cb79b 100644 --- a/rootly_sdk/models/update_alert_group_data.py +++ b/rootly_sdk/models/update_alert_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertGroupData: """ type_: UpdateAlertGroupDataType - attributes: UpdateAlertGroupDataAttributes + attributes: "UpdateAlertGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_group_data_attributes.py b/rootly_sdk/models/update_alert_group_data_attributes.py index 65cd73df..cb9224ed 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes.py +++ b/rootly_sdk/models/update_alert_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,38 +30,46 @@ class UpdateAlertGroupDataAttributes: """ Attributes: - name (str | Unset): The name of the alert group - description (None | str | Unset): The description of the alert group - time_window (int | Unset): The length of time an Alert Group should stay open and accept new alerts - targets (list[UpdateAlertGroupDataAttributesTargetsItem] | Unset): - attributes (list[UpdateAlertGroupDataAttributesAttributesItem] | Unset): This field is deprecated. Please use - the `conditions` field instead, `attributes` will be removed in the future. - group_by_alert_title (UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset): [DEPRECATED] Whether the alerts - should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced alert - grouping instead. - group_by_alert_urgency (UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset): [DEPRECATED] Whether the - alerts should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with advanced + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the alert group + description (Union[None, Unset, str]): The description of the alert group + time_window (Union[Unset, int]): The length of time an Alert Group should stay open and accept new alerts + targets (Union[Unset, list['UpdateAlertGroupDataAttributesTargetsItem']]): + attributes (Union[Unset, list['UpdateAlertGroupDataAttributesAttributesItem']]): This field is deprecated. + Please use the `conditions` field instead, `attributes` will be removed in the future. + group_by_alert_title (Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertTitle]): [DEPRECATED] Whether the + alerts should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced alert grouping instead. - condition_type (UpdateAlertGroupDataAttributesConditionType | Unset): Group alerts when ANY or ALL of the fields - are matching. - conditions (list[UpdateAlertGroupDataAttributesConditionsItem] | Unset): + group_by_alert_urgency (Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertUrgency]): [DEPRECATED] Whether + the alerts should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with + advanced alert grouping instead. + condition_type (Union[Unset, UpdateAlertGroupDataAttributesConditionType]): Group alerts when ANY or ALL of the + fields are matching. + conditions (Union[Unset, list['UpdateAlertGroupDataAttributesConditionsItem']]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - time_window: int | Unset = UNSET - targets: list[UpdateAlertGroupDataAttributesTargetsItem] | Unset = UNSET - attributes: list[UpdateAlertGroupDataAttributesAttributesItem] | Unset = UNSET - group_by_alert_title: UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset = UNSET - group_by_alert_urgency: UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset = UNSET - condition_type: UpdateAlertGroupDataAttributesConditionType | Unset = UNSET - conditions: list[UpdateAlertGroupDataAttributesConditionsItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + time_window: Unset | int = UNSET + targets: Unset | list["UpdateAlertGroupDataAttributesTargetsItem"] = UNSET + attributes: Unset | list["UpdateAlertGroupDataAttributesAttributesItem"] = UNSET + group_by_alert_title: Unset | UpdateAlertGroupDataAttributesGroupByAlertTitle = UNSET + group_by_alert_urgency: Unset | UpdateAlertGroupDataAttributesGroupByAlertUrgency = UNSET + condition_type: Unset | UpdateAlertGroupDataAttributesConditionType = UNSET + conditions: Unset | list["UpdateAlertGroupDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -71,33 +77,33 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: list[dict[str, Any]] | Unset = UNSET + targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: list[dict[str, Any]] | Unset = UNSET + attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - group_by_alert_title: int | Unset = UNSET + group_by_alert_title: Unset | int = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: int | Unset = UNSET + group_by_alert_urgency: Unset | int = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -107,6 +113,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -139,46 +147,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_alert_group_data_attributes_targets_item import UpdateAlertGroupDataAttributesTargetsItem d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) time_window = d.pop("time_window", UNSET) + targets = [] _targets = d.pop("targets", UNSET) - targets: list[UpdateAlertGroupDataAttributesTargetsItem] | Unset = UNSET - if _targets is not UNSET: - targets = [] - for targets_item_data in _targets: - targets_item = UpdateAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) + for targets_item_data in _targets or []: + targets_item = UpdateAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) - targets.append(targets_item) + targets.append(targets_item) + attributes = [] _attributes = d.pop("attributes", UNSET) - attributes: list[UpdateAlertGroupDataAttributesAttributesItem] | Unset = UNSET - if _attributes is not UNSET: - attributes = [] - for attributes_item_data in _attributes: - attributes_item = UpdateAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) + for attributes_item_data in _attributes or []: + attributes_item = UpdateAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) - attributes.append(attributes_item) + attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset + group_by_alert_title: Unset | UpdateAlertGroupDataAttributesGroupByAlertTitle if isinstance(_group_by_alert_title, Unset): group_by_alert_title = UNSET else: group_by_alert_title = check_update_alert_group_data_attributes_group_by_alert_title(_group_by_alert_title) _group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - group_by_alert_urgency: UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset + group_by_alert_urgency: Unset | UpdateAlertGroupDataAttributesGroupByAlertUrgency if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -187,22 +201,21 @@ def _parse_description(data: object) -> None | str | Unset: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateAlertGroupDataAttributesConditionType | Unset + condition_type: Unset | UpdateAlertGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_alert_group_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[UpdateAlertGroupDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = UpdateAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = UpdateAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) update_alert_group_data_attributes = cls( + slug=slug, name=name, description=description, time_window=time_window, diff --git a/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py b/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py index 6ab7e774..b6248ab5 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class UpdateAlertGroupDataAttributesAttributesItem: """ Attributes: - json_path (str | Unset): The JSON path to the value to group by. + json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: str | Unset = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py index 75f5bd3a..57211825 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -31,31 +29,32 @@ class UpdateAlertGroupDataAttributesConditionsItem: field property_field_condition_type (UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_name (str | Unset): The name of the property field. If the property field type is selected as - 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' and - 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the property - field name should be supplied in JSON Path syntax. - property_field_value (str | Unset): The value of the property field. Can be null if the property field condition - type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Need to be passed if the property - field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition. Only need to be - set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property + property_field_name (Union[Unset, str]): The name of the property field. If the property field type is selected + as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' + and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the + property field name should be supplied in JSON Path syntax. + property_field_value (Union[Unset, str]): The value of the property field. Can be null if the property field + condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Need to be passed if the + property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is + 'alert_urgency' + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition. Only need to + be set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset): The type of the - conditionable - conditionable_id (str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is the ID - of the alert field. + conditionable_type (Union[Unset, UpdateAlertGroupDataAttributesConditionsItemConditionableType]): The type of + the conditionable + conditionable_id (Union[Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, this is + the ID of the alert field. """ property_field_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - property_field_name: str | Unset = UNSET - property_field_value: str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset = UNSET - conditionable_id: str | Unset = UNSET + property_field_name: Unset | str = UNSET + property_field_value: Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | UpdateAlertGroupDataAttributesConditionsItemConditionableType = UNSET + conditionable_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,11 +66,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -80,7 +79,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type @@ -128,7 +127,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -139,14 +138,14 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset + conditionable_type: Unset | UpdateAlertGroupDataAttributesConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: diff --git a/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py b/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py index 19e5bad6..8d67ea3a 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/update_alert_retrigger_rule.py b/rootly_sdk/models/update_alert_retrigger_rule.py new file mode 100644 index 00000000..67a9c719 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData + + +T = TypeVar("T", bound="UpdateAlertRetriggerRule") + + +@_attrs_define +class UpdateAlertRetriggerRule: + """ + Attributes: + data (UpdateAlertRetriggerRuleData): + """ + + data: "UpdateAlertRetriggerRuleData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData + + d = dict(src_dict) + data = UpdateAlertRetriggerRuleData.from_dict(d.pop("data")) + + update_alert_retrigger_rule = cls( + data=data, + ) + + update_alert_retrigger_rule.additional_properties = d + return update_alert_retrigger_rule + + @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/rootly_sdk/models/update_alert_retrigger_rule_data.py b/rootly_sdk/models/update_alert_retrigger_rule_data.py new file mode 100644 index 00000000..c7d5f159 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_alert_retrigger_rule_data_type import ( + UpdateAlertRetriggerRuleDataType, + check_update_alert_retrigger_rule_data_type, +) + +if TYPE_CHECKING: + from ..models.update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes + + +T = TypeVar("T", bound="UpdateAlertRetriggerRuleData") + + +@_attrs_define +class UpdateAlertRetriggerRuleData: + """ + Attributes: + type_ (UpdateAlertRetriggerRuleDataType): + attributes (UpdateAlertRetriggerRuleDataAttributes): + """ + + type_: UpdateAlertRetriggerRuleDataType + attributes: "UpdateAlertRetriggerRuleDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes + + d = dict(src_dict) + type_ = check_update_alert_retrigger_rule_data_type(d.pop("type")) + + attributes = UpdateAlertRetriggerRuleDataAttributes.from_dict(d.pop("attributes")) + + update_alert_retrigger_rule_data = cls( + type_=type_, + attributes=attributes, + ) + + update_alert_retrigger_rule_data.additional_properties = d + return update_alert_retrigger_rule_data + + @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/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py new file mode 100644 index 00000000..af85c35c --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py @@ -0,0 +1,121 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_alert_retrigger_rule_data_attributes_match_mode import ( + UpdateAlertRetriggerRuleDataAttributesMatchMode, + check_update_alert_retrigger_rule_data_attributes_match_mode, +) +from ..models.update_alert_retrigger_rule_data_attributes_timeout_minutes import ( + UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes, + check_update_alert_retrigger_rule_data_attributes_timeout_minutes, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_alert_retrigger_rule_data_attributes_conditions_item import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItem, + ) + + +T = TypeVar("T", bound="UpdateAlertRetriggerRuleDataAttributes") + + +@_attrs_define +class UpdateAlertRetriggerRuleDataAttributes: + """ + Attributes: + name (Union[Unset, str]): A human-readable name for the rule + match_mode (Union[Unset, UpdateAlertRetriggerRuleDataAttributesMatchMode]): Whether all or any of the conditions + must match + timeout_minutes (Union[Unset, UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes]): Re-trigger the alert this + many minutes after acknowledgment. Null means never re-trigger. + position (Union[Unset, int]): The position of the rule for ordering evaluation + conditions (Union[Unset, list['UpdateAlertRetriggerRuleDataAttributesConditionsItem']]): The full desired set of + conditions; replaces the rule's existing conditions. An empty array applies to every alert. + """ + + name: Unset | str = UNSET + match_mode: Unset | UpdateAlertRetriggerRuleDataAttributesMatchMode = UNSET + timeout_minutes: Unset | UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes = UNSET + position: Unset | int = UNSET + conditions: Unset | list["UpdateAlertRetriggerRuleDataAttributesConditionsItem"] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + match_mode: Unset | str = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + timeout_minutes: Unset | int = UNSET + if not isinstance(self.timeout_minutes, Unset): + timeout_minutes = self.timeout_minutes + + position = self.position + + conditions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.conditions, Unset): + conditions = [] + for conditions_item_data in self.conditions: + conditions_item = conditions_item_data.to_dict() + conditions.append(conditions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if position is not UNSET: + field_dict["position"] = position + if conditions is not UNSET: + field_dict["conditions"] = conditions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_retrigger_rule_data_attributes_conditions_item import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItem, + ) + + d = dict(src_dict) + name = d.pop("name", UNSET) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: Unset | UpdateAlertRetriggerRuleDataAttributesMatchMode + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_update_alert_retrigger_rule_data_attributes_match_mode(_match_mode) + + _timeout_minutes = d.pop("timeout_minutes", UNSET) + timeout_minutes: Unset | UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes + if isinstance(_timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = check_update_alert_retrigger_rule_data_attributes_timeout_minutes(_timeout_minutes) + + position = d.pop("position", UNSET) + + conditions = [] + _conditions = d.pop("conditions", UNSET) + for conditions_item_data in _conditions or []: + conditions_item = UpdateAlertRetriggerRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + + conditions.append(conditions_item) + + update_alert_retrigger_rule_data_attributes = cls( + name=name, + match_mode=match_mode, + timeout_minutes=timeout_minutes, + position=position, + conditions=conditions, + ) + + return update_alert_retrigger_rule_data_attributes diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py new file mode 100644 index 00000000..ff89af99 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemKind, + check_update_alert_retrigger_rule_data_attributes_conditions_item_kind, +) +from ..models.update_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator, + check_update_alert_retrigger_rule_data_attributes_conditions_item_operator, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAlertRetriggerRuleDataAttributesConditionsItem") + + +@_attrs_define +class UpdateAlertRetriggerRuleDataAttributesConditionsItem: + """ + Attributes: + kind (UpdateAlertRetriggerRuleDataAttributesConditionsItemKind): The operand the condition matches on. Native + operands (urgency, source, service, group) match by record; alert_field/payload match a field value. + operator (UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator): How the operand is compared. Native + operands support is_one_of/is_not_one_of/is_set/is_not_set; alert_field/payload additionally support the + string/regex operators. + record_ids (Union[Unset, list[UUID]]): For urgency/service/group/source conditions: the IDs of the matched + records (AlertUrgency, Service, Group, or Alerts::Source). + values (Union[Unset, list[str]]): For source conditions: non-integration source aliases (e.g. manual, api). For + alert_field/payload conditions: the values to compare against. + property_field_name (Union[Unset, str]): For alert_field conditions: the alert field id. For payload conditions: + a JSON Path (e.g. $.priority). + """ + + kind: UpdateAlertRetriggerRuleDataAttributesConditionsItemKind + operator: UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator + record_ids: Unset | list[UUID] = UNSET + values: Unset | list[str] = UNSET + property_field_name: Unset | str = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + operator: str = self.operator + + record_ids: Unset | list[str] = UNSET + if not isinstance(self.record_ids, Unset): + record_ids = [] + for record_ids_item_data in self.record_ids: + record_ids_item = str(record_ids_item_data) + record_ids.append(record_ids_item) + + values: Unset | list[str] = UNSET + if not isinstance(self.values, Unset): + values = self.values + + property_field_name = self.property_field_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "kind": kind, + "operator": operator, + } + ) + if record_ids is not UNSET: + field_dict["record_ids"] = record_ids + if values is not UNSET: + field_dict["values"] = values + if property_field_name is not UNSET: + field_dict["property_field_name"] = property_field_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_update_alert_retrigger_rule_data_attributes_conditions_item_kind(d.pop("kind")) + + operator = check_update_alert_retrigger_rule_data_attributes_conditions_item_operator(d.pop("operator")) + + record_ids = [] + _record_ids = d.pop("record_ids", UNSET) + for record_ids_item_data in _record_ids or []: + record_ids_item = UUID(record_ids_item_data) + + record_ids.append(record_ids_item) + + values = cast(list[str], d.pop("values", UNSET)) + + property_field_name = d.pop("property_field_name", UNSET) + + update_alert_retrigger_rule_data_attributes_conditions_item = cls( + kind=kind, + operator=operator, + record_ids=record_ids, + values=values, + property_field_name=property_field_name, + ) + + update_alert_retrigger_rule_data_attributes_conditions_item.additional_properties = d + return update_alert_retrigger_rule_data_attributes_conditions_item + + @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/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py new file mode 100644 index 00000000..f4d391e8 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py @@ -0,0 +1,28 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesConditionsItemKind = Literal[ + "alert_field", "group", "payload", "service", "source", "urgency" +] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: set[ + UpdateAlertRetriggerRuleDataAttributesConditionsItemKind +] = { + "alert_field", + "group", + "payload", + "service", + "source", + "urgency", +} + + +def check_update_alert_retrigger_rule_data_attributes_conditions_item_kind( + value: str | None, +) -> UpdateAlertRetriggerRuleDataAttributesConditionsItemKind | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesConditionsItemKind, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py new file mode 100644 index 00000000..6cb950d3 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py @@ -0,0 +1,39 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator = Literal[ + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: set[ + UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator +] = { + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +} + + +def check_update_alert_retrigger_rule_data_attributes_conditions_item_operator( + value: str | None, +) -> UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py new file mode 100644 index 00000000..9951e871 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesMatchMode = Literal["match-all-rules", "match-any-rule"] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: set[UpdateAlertRetriggerRuleDataAttributesMatchMode] = { + "match-all-rules", + "match-any-rule", +} + + +def check_update_alert_retrigger_rule_data_attributes_match_mode( + value: str | None, +) -> UpdateAlertRetriggerRuleDataAttributesMatchMode | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesMatchMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py new file mode 100644 index 00000000..3625f499 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py @@ -0,0 +1,34 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes = Literal[ + 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: set[ + UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes +] = { + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_update_alert_retrigger_rule_data_attributes_timeout_minutes( + value: int, +) -> UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes: + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_type.py b/rootly_sdk/models/update_alert_retrigger_rule_data_type.py new file mode 100644 index 00000000..d27c23e1 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataType = Literal["alert_retrigger_rules"] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: set[UpdateAlertRetriggerRuleDataType] = { + "alert_retrigger_rules", +} + + +def check_update_alert_retrigger_rule_data_type(value: str | None) -> UpdateAlertRetriggerRuleDataType | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: + return cast(UpdateAlertRetriggerRuleDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_route.py b/rootly_sdk/models/update_alert_route.py index 61ae04b2..05914582 100644 --- a/rootly_sdk/models/update_alert_route.py +++ b/rootly_sdk/models/update_alert_route.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertRoute: data (UpdateAlertRouteData): """ - data: UpdateAlertRouteData + data: "UpdateAlertRouteData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_route_data.py b/rootly_sdk/models/update_alert_route_data.py index 562adaa1..a962d3d6 100644 --- a/rootly_sdk/models/update_alert_route_data.py +++ b/rootly_sdk/models/update_alert_route_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertRouteData: """ type_: UpdateAlertRouteDataType - attributes: UpdateAlertRouteDataAttributes + attributes: "UpdateAlertRouteDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_route_data_attributes.py b/rootly_sdk/models/update_alert_route_data_attributes.py index 21b85825..69d9ef89 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes.py +++ b/rootly_sdk/models/update_alert_route_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -19,40 +17,39 @@ class UpdateAlertRouteDataAttributes: """ Attributes: - name (str | Unset): The name of the alert route - enabled (bool | Unset): Whether the alert route is enabled - alerts_source_ids (list[UUID] | Unset): - owning_team_ids (list[UUID] | Unset): - rules (list[UpdateAlertRouteDataAttributesRulesItem] | Unset): + name (Union[Unset, str]): The name of the alert route + enabled (Union[Unset, bool]): Whether the alert route is enabled + alerts_source_ids (Union[Unset, list[UUID]]): + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['UpdateAlertRouteDataAttributesRulesItem']]): """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - alerts_source_ids: list[UUID] | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[UpdateAlertRouteDataAttributesRulesItem] | Unset = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + alerts_source_ids: Unset | list[UUID] = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["UpdateAlertRouteDataAttributesRulesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name enabled = self.enabled - alerts_source_ids: list[str] | Unset = UNSET + alerts_source_ids: Unset | list[str] = UNSET if not isinstance(self.alerts_source_ids, Unset): alerts_source_ids = [] for alerts_source_ids_item_data in self.alerts_source_ids: alerts_source_ids_item = str(alerts_source_ids_item_data) alerts_source_ids.append(alerts_source_ids_item) - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -84,32 +81,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + alerts_source_ids = [] _alerts_source_ids = d.pop("alerts_source_ids", UNSET) - alerts_source_ids: list[UUID] | Unset = UNSET - if _alerts_source_ids is not UNSET: - alerts_source_ids = [] - for alerts_source_ids_item_data in _alerts_source_ids: - alerts_source_ids_item = UUID(alerts_source_ids_item_data) + for alerts_source_ids_item_data in _alerts_source_ids or []: + alerts_source_ids_item = UUID(alerts_source_ids_item_data) - alerts_source_ids.append(alerts_source_ids_item) + alerts_source_ids.append(alerts_source_ids_item) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[UpdateAlertRouteDataAttributesRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = UpdateAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = UpdateAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) update_alert_route_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py index ec7a1935..086dd93d 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class UpdateAlertRouteDataAttributesRulesItem: """ Attributes: name (str): The name of the alert routing rule - destinations (list[UpdateAlertRouteDataAttributesRulesItemDestinationsItem]): - condition_groups (list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem]): - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. + destinations (list['UpdateAlertRouteDataAttributesRulesItemDestinationsItem']): + condition_groups (list['UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem']): + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. """ name: str - destinations: list[UpdateAlertRouteDataAttributesRulesItemDestinationsItem] - condition_groups: list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem] - position: int | Unset = UNSET - fallback_rule: bool | Unset = False + destinations: list["UpdateAlertRouteDataAttributesRulesItemDestinationsItem"] + condition_groups: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem"] + position: Unset | int = UNSET + fallback_rule: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name destinations = [] diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py index 5128c9ce..69d9514c 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,16 +19,15 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - conditions (list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem]): - position (int | Unset): The position of the condition group + conditions (list['UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']): + position (Union[Unset, int]): The position of the condition group """ - conditions: list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] - position: int | Unset = UNSET + conditions: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index 6ede7018..3e3d2b07 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -31,27 +29,28 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: property_field_condition_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - property_field_name (str | Unset): The name of the property field - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + property_field_name (Union[Unset, str]): The name of the property field + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, + UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ property_field_condition_type: ( UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET + property_field_name: Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET conditionable_type: ( - UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + Unset | UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType ) = UNSET - conditionable_id: None | Unset | UUID = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -85,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -133,16 +132,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -153,13 +152,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -170,15 +169,15 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + Unset | UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -187,7 +186,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -198,9 +197,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py index 3e112e79..c14eb5d0 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/update_alert_routing_rule.py b/rootly_sdk/models/update_alert_routing_rule.py index 9025c22f..ab1de97b 100644 --- a/rootly_sdk/models/update_alert_routing_rule.py +++ b/rootly_sdk/models/update_alert_routing_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertRoutingRule: data (UpdateAlertRoutingRuleData): """ - data: UpdateAlertRoutingRuleData + data: "UpdateAlertRoutingRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_routing_rule_data.py b/rootly_sdk/models/update_alert_routing_rule_data.py index 8b939ad3..e4aafaf3 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data.py +++ b/rootly_sdk/models/update_alert_routing_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateAlertRoutingRuleData: """ type_: UpdateAlertRoutingRuleDataType - attributes: UpdateAlertRoutingRuleDataAttributes + attributes: "UpdateAlertRoutingRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py index f055cba6..181ae760 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -28,57 +26,56 @@ class UpdateAlertRoutingRuleDataAttributes: """ Attributes: - name (str | Unset): The name of the alert routing rule - enabled (bool | Unset): Whether the alert routing rule is enabled - alerts_source_id (UUID | Unset): The ID of the alerts source - position (int | Unset): The position of the alert routing rule for ordering evaluation - owning_team_ids (list[UUID] | Unset): The IDs of the teams that own the alert routing rule - condition_type (UpdateAlertRoutingRuleDataAttributesConditionType | Unset): The type of condition for the alert - routing rule - conditions (list[UpdateAlertRoutingRuleDataAttributesConditionsItem] | Unset): - destination (UpdateAlertRoutingRuleDataAttributesDestination | Unset): + name (Union[Unset, str]): The name of the alert routing rule + enabled (Union[Unset, bool]): Whether the alert routing rule is enabled + alerts_source_id (Union[Unset, UUID]): The ID of the alerts source + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + owning_team_ids (Union[Unset, list[UUID]]): The IDs of the teams that own the alert routing rule + condition_type (Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionType]): The type of condition for the + alert routing rule + conditions (Union[Unset, list['UpdateAlertRoutingRuleDataAttributesConditionsItem']]): + destination (Union[Unset, UpdateAlertRoutingRuleDataAttributesDestination]): """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - alerts_source_id: UUID | Unset = UNSET - position: int | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - condition_type: UpdateAlertRoutingRuleDataAttributesConditionType | Unset = UNSET - conditions: list[UpdateAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET - destination: UpdateAlertRoutingRuleDataAttributesDestination | Unset = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + alerts_source_id: Unset | UUID = UNSET + position: Unset | int = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + condition_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionType = UNSET + conditions: Unset | list["UpdateAlertRoutingRuleDataAttributesConditionsItem"] = UNSET + destination: Union[Unset, "UpdateAlertRoutingRuleDataAttributesDestination"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name enabled = self.enabled - alerts_source_id: str | Unset = UNSET + alerts_source_id: Unset | str = UNSET if not isinstance(self.alerts_source_id, Unset): alerts_source_id = str(self.alerts_source_id) position = self.position - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - destination: dict[str, Any] | Unset = UNSET + destination: Unset | dict[str, Any] = UNSET if not isinstance(self.destination, Unset): destination = self.destination.to_dict() @@ -119,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _alerts_source_id = d.pop("alerts_source_id", UNSET) - alerts_source_id: UUID | Unset + alerts_source_id: Unset | UUID if isinstance(_alerts_source_id, Unset): alerts_source_id = UNSET else: @@ -127,33 +124,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateAlertRoutingRuleDataAttributesConditionType | Unset + condition_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_alert_routing_rule_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[UpdateAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = UpdateAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = UpdateAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) _destination = d.pop("destination", UNSET) - destination: UpdateAlertRoutingRuleDataAttributesDestination | Unset + destination: Unset | UpdateAlertRoutingRuleDataAttributesDestination if isinstance(_destination, Unset): destination = UNSET else: diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py index 307d337f..4c4aa987 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -24,53 +22,54 @@ class UpdateAlertRoutingRuleDataAttributesConditionsItem: """ Attributes: - id (UUID | Unset): The ID of the alert routing rule condition - property_field_type (UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset): The type of - the property field - property_field_name (str | Unset): The name of the property field. If the property field type is selected as - 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' and - 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the property - field name should be supplied in JSON Path syntax. - property_field_condition_type (UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | - Unset): The condition type of the property field - property_field_value (None | str | Unset): The value of the property field. Can be null if the property field - condition type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Used if the property field + id (Union[Unset, UUID]): The ID of the alert routing rule condition + property_field_type (Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType]): The + type of the property field + property_field_name (Union[Unset, str]): The name of the property field. If the property field type is selected + as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' + and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the + property field name should be supplied in JSON Path syntax. + property_field_condition_type (Union[Unset, + UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType]): The condition type of the + property field + property_field_value (Union[None, Unset, str]): The value of the property field. Can be null if the property + field condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Used if the property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' """ - id: UUID | Unset = UNSET - property_field_type: UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset = UNSET - property_field_name: str | Unset = UNSET + id: Unset | UUID = UNSET + property_field_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType = UNSET + property_field_name: Unset | str = UNSET property_field_condition_type: ( - UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | Unset + Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType ) = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_type: str | Unset = UNSET + property_field_type: Unset | str = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type property_field_name = self.property_field_name - property_field_condition_type: str | Unset = UNSET + property_field_condition_type: Unset | str = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type - property_field_value: None | str | Unset + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -96,14 +95,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _property_field_type = d.pop("property_field_type", UNSET) - property_field_type: UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset + property_field_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType if isinstance(_property_field_type, Unset): property_field_type = UNSET else: @@ -115,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_condition_type = d.pop("property_field_condition_type", UNSET) property_field_condition_type: ( - UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | Unset + Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType ) if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET @@ -126,12 +125,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py index 4354e978..f573dc7e 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID @@ -20,21 +18,21 @@ class UpdateAlertRoutingRuleDataAttributesDestination: """ Attributes: - target_type (UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset): The type of the target. Please - contact support if you encounter issues using `Functionality` as a target type. - target_id (UUID | Unset): The ID of the target + target_type (Union[Unset, UpdateAlertRoutingRuleDataAttributesDestinationTargetType]): The type of the target. + Please contact support if you encounter issues using `Functionality` as a target type. + target_id (Union[Unset, UUID]): The ID of the target """ - target_type: UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset = UNSET - target_id: UUID | Unset = UNSET + target_type: Unset | UpdateAlertRoutingRuleDataAttributesDestinationTargetType = UNSET + target_id: Unset | UUID = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - target_type: str | Unset = UNSET + target_type: Unset | str = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: str | Unset = UNSET + target_id: Unset | str = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) @@ -52,14 +50,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _target_type = d.pop("target_type", UNSET) - target_type: UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset + target_type: Unset | UpdateAlertRoutingRuleDataAttributesDestinationTargetType if isinstance(_target_type, Unset): target_type = UNSET else: target_type = check_update_alert_routing_rule_data_attributes_destination_target_type(_target_type) _target_id = d.pop("target_id", UNSET) - target_id: UUID | Unset + target_id: Unset | UUID if isinstance(_target_id, Unset): target_id = UNSET else: diff --git a/rootly_sdk/models/update_alert_urgency.py b/rootly_sdk/models/update_alert_urgency.py index 61a7770d..4ab66a74 100644 --- a/rootly_sdk/models/update_alert_urgency.py +++ b/rootly_sdk/models/update_alert_urgency.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertUrgency: data (UpdateAlertUrgencyData): """ - data: UpdateAlertUrgencyData + data: "UpdateAlertUrgencyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_urgency_data.py b/rootly_sdk/models/update_alert_urgency_data.py index 73a3352e..0e1ffff3 100644 --- a/rootly_sdk/models/update_alert_urgency_data.py +++ b/rootly_sdk/models/update_alert_urgency_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertUrgencyData: """ type_: UpdateAlertUrgencyDataType - attributes: UpdateAlertUrgencyDataAttributes + attributes: "UpdateAlertUrgencyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_urgency_data_attributes.py b/rootly_sdk/models/update_alert_urgency_data_attributes.py index 0099ccef..f9137d5c 100644 --- a/rootly_sdk/models/update_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/update_alert_urgency_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,26 +12,35 @@ class UpdateAlertUrgencyDataAttributes: """ Attributes: - name (str | Unset): The name of the alert urgency - description (str | Unset): The description of the alert urgency - position (int | None | Unset): Position of the alert urgency + name (Union[Unset, str]): The name of the alert urgency + description (Union[Unset, str]): The description of the alert urgency + position (Union[None, Unset, int]): Position of the alert urgency + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts of this urgency after N + minutes; null inherits the workspace default, negative = never. """ - name: str | Unset = UNSET - description: str | Unset = UNSET - position: int | None | Unset = UNSET + name: Unset | str = UNSET + description: Unset | str = UNSET + position: None | Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position + retrigger_timeout_minutes: None | Unset | int + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -43,6 +50,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if position is not UNSET: field_dict["position"] = position + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes return field_dict @@ -53,19 +62,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + update_alert_urgency_data_attributes = cls( name=name, description=description, position=position, + retrigger_timeout_minutes=retrigger_timeout_minutes, ) return update_alert_urgency_data_attributes diff --git a/rootly_sdk/models/update_alerts_source.py b/rootly_sdk/models/update_alerts_source.py index 92d0852d..2c27342d 100644 --- a/rootly_sdk/models/update_alerts_source.py +++ b/rootly_sdk/models/update_alerts_source.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertsSource: data (UpdateAlertsSourceData): """ - data: UpdateAlertsSourceData + data: "UpdateAlertsSourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alerts_source_data.py b/rootly_sdk/models/update_alerts_source_data.py index cdc6c508..c7409215 100644 --- a/rootly_sdk/models/update_alerts_source_data.py +++ b/rootly_sdk/models/update_alerts_source_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertsSourceData: """ type_: UpdateAlertsSourceDataType - attributes: UpdateAlertsSourceDataAttributes + attributes: "UpdateAlertsSourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alerts_source_data_attributes.py b/rootly_sdk/models/update_alerts_source_data_attributes.py index 9d4512ab..514858bd 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -40,48 +38,55 @@ class UpdateAlertsSourceDataAttributes: """ Attributes: - name (str | Unset): The name of the alert source - enabled (bool | Unset): Whether the alert source is enabled. Disabled sources do not create alerts from incoming - events. - source_type (UpdateAlertsSourceDataAttributesSourceType | Unset): The alert source type - alert_urgency_id (str | Unset): ID for the default alert urgency assigned to this alert source - deduplicate_alerts_by_key (bool | Unset): Toggle alert deduplication using deduplication key. If enabled, + name (Union[Unset, str]): The name of the alert source + enabled (Union[Unset, bool]): Whether the alert source is enabled. Disabled sources do not create alerts from + incoming events. + source_type (Union[Unset, UpdateAlertsSourceDataAttributesSourceType]): The alert source type + alert_urgency_id (Union[Unset, str]): ID for the default alert urgency assigned to this alert source + deduplicate_alerts_by_key (Union[Unset, bool]): Toggle alert deduplication using deduplication key. If enabled, deduplication_key_kind and deduplication_key_path are required. - deduplication_key_kind (UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset): Kind of deduplication - key. - deduplication_key_path (None | str | Unset): Path to deduplication key. This is a JSON Path to extract the + deduplication_key_kind (Union[Unset, UpdateAlertsSourceDataAttributesDeduplicationKeyKind]): Kind of + deduplication key. + deduplication_key_path (Union[None, Unset, str]): Path to deduplication key. This is a JSON Path to extract the deduplication key from the request body. - deduplication_key_regexp (None | str | Unset): Regular expression to extract key from value found at key path. - owner_group_ids (list[str] | Unset): List of team IDs that will own the alert source - alert_template_attributes (None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0): - alert_source_urgency_rules_attributes - (list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset): List of rules that define - the conditions under which the alert urgency will be set automatically based on the alert payload - sourceable_attributes (None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0): Provide - additional attributes for generic_webhook alerts source - resolution_rule_attributes (None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0): - Provide additional attributes for email alerts source - alert_source_fields_attributes (list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset): - List of alert fields to be added to the alert source. Note: This attribute requires the alert field feature to - be enabled on your account. Contact Rootly customer support if you need assistance with this feature. + deduplication_key_regexp (Union[None, Unset, str]): Regular expression to extract key from value found at key + path. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that will own the alert source + alert_template_attributes (Union['UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0', None, Unset]): + alert_source_urgency_rules_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem']]): List of rules that define the + conditions under which the alert urgency will be set automatically based on the alert payload + sourceable_attributes (Union['UpdateAlertsSourceDataAttributesSourceableAttributesType0', None, Unset]): Provide + additional attributes for the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` + apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + resolution_rule_attributes (Union['UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0', None, + Unset]): Provide additional attributes for email alerts source + alert_source_fields_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem']]): List of alert fields to be added to + the alert source. Note: This attribute requires the alert field feature to be enabled on your account. Contact + Rootly customer support if you need assistance with this feature. """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - source_type: UpdateAlertsSourceDataAttributesSourceType | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - deduplicate_alerts_by_key: bool | Unset = UNSET - deduplication_key_kind: UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset = UNSET - deduplication_key_path: None | str | Unset = UNSET - deduplication_key_regexp: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - alert_template_attributes: None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0 = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + source_type: Unset | UpdateAlertsSourceDataAttributesSourceType = UNSET + alert_urgency_id: Unset | str = UNSET + deduplicate_alerts_by_key: Unset | bool = UNSET + deduplication_key_kind: Unset | UpdateAlertsSourceDataAttributesDeduplicationKeyKind = UNSET + deduplication_key_path: None | Unset | str = UNSET + deduplication_key_regexp: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + alert_template_attributes: Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset] = ( + UNSET + ) alert_source_urgency_rules_attributes: ( - list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset + Unset | list["UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] ) = UNSET - sourceable_attributes: None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0 = UNSET - resolution_rule_attributes: None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0 = UNSET - alert_source_fields_attributes: list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = ( + sourceable_attributes: Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET + resolution_rule_attributes: Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = ( + UNSET + ) + alert_source_fields_attributes: Unset | list["UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] = ( UNSET ) @@ -100,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: str | Unset = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -108,27 +113,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: str | Unset = UNSET + deduplication_key_kind: Unset | str = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | str | Unset + deduplication_key_path: None | Unset | str if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | str | Unset + deduplication_key_regexp: None | Unset | str if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: dict[str, Any] | None | Unset + alert_template_attributes: None | Unset | dict[str, Any] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -136,14 +141,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: dict[str, Any] | None | Unset + sourceable_attributes: None | Unset | dict[str, Any] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, UpdateAlertsSourceDataAttributesSourceableAttributesType0): @@ -151,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: dict[str, Any] | None | Unset + resolution_rule_attributes: None | Unset | dict[str, Any] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -159,7 +164,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: @@ -224,7 +229,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: UpdateAlertsSourceDataAttributesSourceType | Unset + source_type: Unset | UpdateAlertsSourceDataAttributesSourceType if isinstance(_source_type, Unset): source_type = UNSET else: @@ -235,7 +240,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset + deduplication_key_kind: Unset | UpdateAlertsSourceDataAttributesDeduplicationKeyKind if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -243,21 +248,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> None | str | Unset: + def _parse_deduplication_key_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: + def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -265,7 +270,7 @@ def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: def _parse_alert_template_attributes( data: object, - ) -> None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: + ) -> Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -278,30 +283,26 @@ def _parse_alert_template_attributes( ) return alert_template_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0, data) + return cast(Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset], data) alert_template_attributes = _parse_alert_template_attributes(d.pop("alert_template_attributes", UNSET)) + alert_source_urgency_rules_attributes = [] _alert_source_urgency_rules_attributes = d.pop("alert_source_urgency_rules_attributes", UNSET) - alert_source_urgency_rules_attributes: ( - list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset - ) = UNSET - if _alert_source_urgency_rules_attributes is not UNSET: - alert_source_urgency_rules_attributes = [] - for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes: - alert_source_urgency_rules_attributes_item = ( - UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( - alert_source_urgency_rules_attributes_item_data - ) + for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes or []: + alert_source_urgency_rules_attributes_item = ( + UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( + alert_source_urgency_rules_attributes_item_data ) + ) - alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) + alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) def _parse_sourceable_attributes( data: object, - ) -> None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0: + ) -> Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -312,15 +313,15 @@ def _parse_sourceable_attributes( sourceable_attributes_type_0 = UpdateAlertsSourceDataAttributesSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0, data) + return cast(Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset], data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) def _parse_resolution_rule_attributes( data: object, - ) -> None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: + ) -> Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -333,26 +334,22 @@ def _parse_resolution_rule_attributes( ) return resolution_rule_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0, data) + return cast(Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset], data) resolution_rule_attributes = _parse_resolution_rule_attributes(d.pop("resolution_rule_attributes", UNSET)) + alert_source_fields_attributes = [] _alert_source_fields_attributes = d.pop("alert_source_fields_attributes", UNSET) - alert_source_fields_attributes: ( - list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset - ) = UNSET - if _alert_source_fields_attributes is not UNSET: - alert_source_fields_attributes = [] - for alert_source_fields_attributes_item_data in _alert_source_fields_attributes: - alert_source_fields_attributes_item = ( - UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( - alert_source_fields_attributes_item_data - ) + for alert_source_fields_attributes_item_data in _alert_source_fields_attributes or []: + alert_source_fields_attributes_item = ( + UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( + alert_source_fields_attributes_item_data ) + ) - alert_source_fields_attributes.append(alert_source_fields_attributes_item) + alert_source_fields_attributes.append(alert_source_fields_attributes_item) update_alerts_source_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py index e08e80c0..954963ad 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,19 +13,19 @@ class UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: """ Attributes: - alert_field_id (str | Unset): The ID of the alert field - template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for - evaluation + alert_field_id (Union[Unset, str]): The ID of the alert field + template_body (Union[None, Unset, str]): Liquid expression to extract a specific value from the alert's payload + for evaluation """ - alert_field_id: str | Unset = UNSET - template_body: None | str | Unset = UNSET + alert_field_id: Unset | str = UNSET + template_body: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | str | Unset + template_body: None | Unset | str if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -48,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> None | str | Unset: + def _parse_template_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py index 8dbf2010..4542ac61 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,56 +25,57 @@ class UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: """ Attributes: - json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for - evaluation - operator (UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset): Comparison - operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + json_path (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload + for evaluation + operator (Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator]): + Comparison operator used to evaluate the extracted value against the specified condition + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset): The kind of the + conditionable_type (Union[Unset, + UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind]): The kind of the conditionable - alert_urgency_id (str | Unset): The ID of the alert urgency + alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: None | str | Unset = UNSET - operator: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET + json_path: None | Unset | str = UNSET + operator: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = UNSET + value: Unset | str = UNSET conditionable_type: ( - UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset + Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType ) = UNSET - conditionable_id: None | str | Unset = UNSET - kind: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET - alert_urgency_id: str | Unset = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind = UNSET + alert_urgency_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | str | Unset + json_path: None | Unset | str if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: str | Unset = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -106,17 +105,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_json_path(data: object) -> None | str | Unset: + def _parse_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset + operator: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -128,7 +127,7 @@ def _parse_json_path(data: object) -> None | str | Unset: _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset + Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -137,17 +136,17 @@ def _parse_json_path(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset + kind: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py index 246b5909..9e04ab56 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: """ Attributes: - title (None | str | Unset): The alert title. - description (None | str | Unset): The alert description. - external_url (None | str | Unset): The alert URL. + title (Union[None, Unset, str]): The alert title. + description (Union[None, Unset, str]): The alert description. + external_url (Union[None, Unset, str]): The alert URL. """ - title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET + title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -60,30 +58,30 @@ 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_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py index 4a1700e5..2dce4d7d 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,75 +32,76 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (bool | Unset): Set this to true to enable the auto resolution rule - condition_type (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset): The type of - condition to evaluate to apply auto resolution rule - identifier_matchable_type (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType - | Unset): The type of the identifier matchable - identifier_matchable_id (None | str | Unset): The ID of the identifier matchable. If identifier_matchable_type - is AlertField, this is the ID of the alert field. - identifier_reference_kind (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind - | Unset): The kind of the identifier reference - identifier_json_path (None | str | Unset): JSON path expression to extract unique alert identifier used to match - triggered alerts with resolving alerts - identifier_value_regex (None | str | Unset): Regex group to further specify the part of the string used as a - unique identifier - conditions_attributes - (list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset): List of + enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule + condition_type (Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType]): The + type of condition to evaluate to apply auto resolution rule + identifier_matchable_type (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType]): The type of the + identifier matchable + identifier_matchable_id (Union[None, Unset, str]): The ID of the identifier matchable. If + identifier_matchable_type is AlertField, this is the ID of the alert field. + identifier_reference_kind (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind]): The kind of the + identifier reference + identifier_json_path (Union[None, Unset, str]): JSON path expression to extract unique alert identifier used to + match triggered alerts with resolving alerts + identifier_value_regex (Union[None, Unset, str]): Regex group to further specify the part of the string used as + a unique identifier + conditions_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem']]): List of conditions to evaluate for auto resolution """ - enabled: bool | Unset = UNSET - condition_type: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset = UNSET + enabled: Unset | bool = UNSET + condition_type: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = UNSET identifier_matchable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType ) = UNSET - identifier_matchable_id: None | str | Unset = UNSET + identifier_matchable_id: None | Unset | str = UNSET identifier_reference_kind: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind ) = UNSET - identifier_json_path: None | str | Unset = UNSET - identifier_value_regex: None | str | Unset = UNSET + identifier_json_path: None | Unset | str = UNSET + identifier_value_regex: None | Unset | str = UNSET conditions_attributes: ( - list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset + Unset | list["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: str | Unset = UNSET + identifier_matchable_type: Unset | str = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | str | Unset + identifier_matchable_id: None | Unset | str if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: str | Unset = UNSET + identifier_reference_kind: Unset | str = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | str | Unset + identifier_json_path: None | Unset | str if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | str | Unset + identifier_value_regex: None | Unset | str if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: list[dict[str, Any]] | Unset = UNSET + conditions_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -141,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset + condition_type: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -153,7 +152,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) identifier_matchable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType ) if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET @@ -164,18 +163,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> None | str | Unset: + def _parse_identifier_matchable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) identifier_reference_kind: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind ) if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET @@ -186,38 +185,34 @@ def _parse_identifier_matchable_id(data: object) -> None | str | Unset: ) ) - def _parse_identifier_json_path(data: object) -> None | str | Unset: + def _parse_identifier_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | str | Unset: + def _parse_identifier_value_regex(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) + conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - conditions_attributes: ( - list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset - ) = UNSET - if _conditions_attributes is not UNSET: - conditions_attributes = [] - for conditions_attributes_item_data in _conditions_attributes: - conditions_attributes_item = ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) + for conditions_attributes_item_data in _conditions_attributes or []: + conditions_attributes_item = ( + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( + conditions_attributes_item_data ) + ) - conditions_attributes.append(conditions_attributes_item) + conditions_attributes.append(conditions_attributes_item) update_alerts_source_data_attributes_resolution_rule_attributes_type_0 = cls( enabled=enabled, diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py index 0676be4b..c991994f 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,57 +25,58 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | - Unset): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + operator (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison + operator used to evaluate the extracted value against the specified condition + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type - (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset): The - kind of the conditionable + conditionable_type (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The + type of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind]): + The kind of the conditionable """ - field: None | str | Unset = UNSET - operator: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = ( + field: None | Unset | str = UNSET + operator: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = ( UNSET ) - value: str | Unset = UNSET + value: Unset | str = UNSET conditionable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType ) = UNSET - conditionable_id: None | str | Unset = UNSET - kind: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | str | Unset + field: None | Unset | str if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: str | Unset = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -103,17 +102,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_field(data: object) -> None | str | Unset: + def _parse_field(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset + operator: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -125,8 +124,8 @@ def _parse_field(data: object) -> None | str | Unset: _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - | Unset + Unset + | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -135,17 +134,17 @@ def _parse_field(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset + kind: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py index 29ebe687..c7bd0543 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -19,32 +17,32 @@ @_attrs_define class UpdateAlertsSourceDataAttributesSourceableAttributesType0: - """Provide additional attributes for generic_webhook alerts source - - Attributes: - auto_resolve (bool | Unset): Set this to true to auto-resolve alerts based on field_mappings_attributes - conditions - resolve_state (None | str | Unset): This value is matched with the value extracted from alerts payload using - JSON path in field_mappings_attributes - accept_threaded_emails (bool | Unset): Set this to false to reject threaded emails - field_mappings_attributes - (list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset): Specify - rules to auto resolve alerts + """Provide additional attributes for the underlying source. `auto_resolve`, `resolve_state` and + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + + Attributes: + auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + conditions + resolve_state (Union[None, Unset, str]): This value is matched with the value extracted from alerts payload + using JSON path in field_mappings_attributes + accept_threaded_emails (Union[Unset, bool]): Set this to false to reject threaded emails + field_mappings_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to + auto resolve alerts """ - auto_resolve: bool | Unset = UNSET - resolve_state: None | str | Unset = UNSET - accept_threaded_emails: bool | Unset = UNSET + auto_resolve: Unset | bool = UNSET + resolve_state: None | Unset | str = UNSET + accept_threaded_emails: Unset | bool = UNSET field_mappings_attributes: ( - list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset + Unset | list["UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - auto_resolve = self.auto_resolve - resolve_state: None | str | Unset + resolve_state: None | Unset | str if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET + field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -82,31 +80,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | str | Unset: + def _parse_resolve_state(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) accept_threaded_emails = d.pop("accept_threaded_emails", UNSET) + field_mappings_attributes = [] _field_mappings_attributes = d.pop("field_mappings_attributes", UNSET) - field_mappings_attributes: ( - list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset - ) = UNSET - if _field_mappings_attributes is not UNSET: - field_mappings_attributes = [] - for field_mappings_attributes_item_data in _field_mappings_attributes: - field_mappings_attributes_item = ( - UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data - ) + for field_mappings_attributes_item_data in _field_mappings_attributes or []: + field_mappings_attributes_item = ( + UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( + field_mappings_attributes_item_data ) + ) - field_mappings_attributes.append(field_mappings_attributes_item) + field_mappings_attributes.append(field_mappings_attributes_item) update_alerts_source_data_attributes_sourceable_attributes_type_0 = cls( auto_resolve=auto_resolve, diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py index f0794e79..e1ec5f6a 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,19 +17,19 @@ class UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset): + field (Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField]): Select the field on which the condition to be evaluated - json_path (str | Unset): JSON path expression to extract a specific value from the alert's payload for + json_path (Union[Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation. For `notification_target_id` only: if your account has opted in to Dynamic Notification Targets, this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET - json_path: str | Unset = UNSET + field: Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: str | Unset = UNSET + field: Unset | str = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset + field: Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/update_api_key.py b/rootly_sdk/models/update_api_key.py index 316cd68b..e1838445 100644 --- a/rootly_sdk/models/update_api_key.py +++ b/rootly_sdk/models/update_api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateApiKey: data (UpdateApiKeyData): """ - data: UpdateApiKeyData + data: "UpdateApiKeyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_api_key_data.py b/rootly_sdk/models/update_api_key_data.py index 984040f9..a680bdf7 100644 --- a/rootly_sdk/models/update_api_key_data.py +++ b/rootly_sdk/models/update_api_key_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateApiKeyData: """ type_: UpdateApiKeyDataType - attributes: UpdateApiKeyDataAttributes + attributes: "UpdateApiKeyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_api_key_data_attributes.py b/rootly_sdk/models/update_api_key_data_attributes.py index a3739511..56b49b6c 100644 --- a/rootly_sdk/models/update_api_key_data_attributes.py +++ b/rootly_sdk/models/update_api_key_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,25 +14,25 @@ class UpdateApiKeyDataAttributes: """ Attributes: - name (str | Unset): The name of the API key - description (None | str | Unset): A description of the API key - expires_at (datetime.datetime | None | Unset): The expiration date of the API key (ISO 8601) + name (Union[Unset, str]): The name of the API key + description (Union[None, Unset, str]): A description of the API key + expires_at (Union[None, Unset, datetime.datetime]): The expiration date of the API key (ISO 8601) """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - expires_at: datetime.datetime | None | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + expires_at: None | Unset | datetime.datetime = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - expires_at: None | str | Unset + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -59,16 +57,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: + def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: expires_at_type_0 = isoparse(data) return expires_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/update_asana_task_task_params.py b/rootly_sdk/models/update_asana_task_task_params.py index 8d8ed46c..87c64f6c 100644 --- a/rootly_sdk/models/update_asana_task_task_params.py +++ b/rootly_sdk/models/update_asana_task_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -29,36 +27,35 @@ class UpdateAsanaTaskTaskParams: Attributes: task_id (str): The task id completion (UpdateAsanaTaskTaskParamsCompletion): - task_type (UpdateAsanaTaskTaskParamsTaskType | Unset): - title (str | Unset): The task title - notes (str | Unset): - assign_user_email (str | Unset): The assigned user's email - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateAsanaTaskTaskParamsTaskType]): + title (Union[Unset, str]): The task title + notes (Union[Unset, str]): + assign_user_email (Union[Unset, str]): The assigned user's email + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - dependency_direction (UpdateAsanaTaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. - dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax + dependency_direction (Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection]): Default: 'blocking'. + dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax """ task_id: str - completion: UpdateAsanaTaskTaskParamsCompletion - task_type: UpdateAsanaTaskTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - notes: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - dependency_direction: UpdateAsanaTaskTaskParamsDependencyDirection | Unset = "blocking" - dependent_task_ids: list[str] | None | Unset = UNSET + completion: "UpdateAsanaTaskTaskParamsCompletion" + task_type: Unset | UpdateAsanaTaskTaskParamsTaskType = UNSET + title: Unset | str = UNSET + notes: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + dependency_direction: Unset | UpdateAsanaTaskTaskParamsDependencyDirection = "blocking" + dependent_task_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,17 +67,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: str | Unset = UNSET + dependency_direction: Unset | str = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: list[str] | None | Unset + dependent_task_ids: None | Unset | list[str] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -126,7 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateAsanaTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateAsanaTaskTaskParamsTaskType | Unset + task_type: Unset | UpdateAsanaTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -140,23 +137,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: UpdateAsanaTaskTaskParamsDependencyDirection | Unset + dependency_direction: Unset | UpdateAsanaTaskTaskParamsDependencyDirection if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_update_asana_task_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: + def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -167,9 +164,9 @@ def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/update_asana_task_task_params_completion.py b/rootly_sdk/models/update_asana_task_task_params_completion.py index 9ed49ae3..83952ce3 100644 --- a/rootly_sdk/models/update_asana_task_task_params_completion.py +++ b/rootly_sdk/models/update_asana_task_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateAsanaTaskTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_attached_alerts_task_params.py b/rootly_sdk/models/update_attached_alerts_task_params.py index eb67a79b..5220d7fb 100644 --- a/rootly_sdk/models/update_attached_alerts_task_params.py +++ b/rootly_sdk/models/update_attached_alerts_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -24,17 +22,17 @@ class UpdateAttachedAlertsTaskParams: """ Attributes: status (UpdateAttachedAlertsTaskParamsStatus): - task_type (UpdateAttachedAlertsTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateAttachedAlertsTaskParamsTaskType]): """ status: UpdateAttachedAlertsTaskParamsStatus - task_type: UpdateAttachedAlertsTaskParamsTaskType | Unset = UNSET + task_type: Unset | UpdateAttachedAlertsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_attached_alerts_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateAttachedAlertsTaskParamsTaskType | Unset + task_type: Unset | UpdateAttachedAlertsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_authorization.py b/rootly_sdk/models/update_authorization.py index 111de878..93414489 100644 --- a/rootly_sdk/models/update_authorization.py +++ b/rootly_sdk/models/update_authorization.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAuthorization: data (UpdateAuthorizationData): """ - data: UpdateAuthorizationData + data: "UpdateAuthorizationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_authorization_data.py b/rootly_sdk/models/update_authorization_data.py index b69c00db..ff68e054 100644 --- a/rootly_sdk/models/update_authorization_data.py +++ b/rootly_sdk/models/update_authorization_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAuthorizationData: """ type_: UpdateAuthorizationDataType - attributes: UpdateAuthorizationDataAttributes + attributes: "UpdateAuthorizationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_authorization_data_attributes.py b/rootly_sdk/models/update_authorization_data_attributes.py index a5e587cc..e0ed42b6 100644 --- a/rootly_sdk/models/update_authorization_data_attributes.py +++ b/rootly_sdk/models/update_authorization_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -18,13 +16,13 @@ class UpdateAuthorizationDataAttributes: """ Attributes: - permissions (list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset): + permissions (Union[Unset, list[UpdateAuthorizationDataAttributesPermissionsItem]]): """ - permissions: list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset = UNSET + permissions: Unset | list[UpdateAuthorizationDataAttributesPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: - permissions: list[str] | Unset = UNSET + permissions: Unset | list[str] = UNSET if not isinstance(self.permissions, Unset): permissions = [] for permissions_item_data in self.permissions: @@ -42,14 +40,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + permissions = [] _permissions = d.pop("permissions", UNSET) - permissions: list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset = UNSET - if _permissions is not UNSET: - permissions = [] - for permissions_item_data in _permissions: - permissions_item = check_update_authorization_data_attributes_permissions_item(permissions_item_data) + for permissions_item_data in _permissions or []: + permissions_item = check_update_authorization_data_attributes_permissions_item(permissions_item_data) - permissions.append(permissions_item) + permissions.append(permissions_item) update_authorization_data_attributes = cls( permissions=permissions, diff --git a/rootly_sdk/models/update_catalog.py b/rootly_sdk/models/update_catalog.py index ce690f10..9eeca011 100644 --- a/rootly_sdk/models/update_catalog.py +++ b/rootly_sdk/models/update_catalog.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalog: data (UpdateCatalogData): """ - data: UpdateCatalogData + data: "UpdateCatalogData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_checklist_template.py b/rootly_sdk/models/update_catalog_checklist_template.py index 5867865e..f1b29e91 100644 --- a/rootly_sdk/models/update_catalog_checklist_template.py +++ b/rootly_sdk/models/update_catalog_checklist_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogChecklistTemplate: data (UpdateCatalogChecklistTemplateData): """ - data: UpdateCatalogChecklistTemplateData + data: "UpdateCatalogChecklistTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_checklist_template_data.py b/rootly_sdk/models/update_catalog_checklist_template_data.py index a7ee5fc8..1254eb27 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCatalogChecklistTemplateData: """ type_: UpdateCatalogChecklistTemplateDataType - attributes: UpdateCatalogChecklistTemplateDataAttributes + attributes: "UpdateCatalogChecklistTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py index 9e6825b4..36041da9 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,41 +24,52 @@ class UpdateCatalogChecklistTemplateDataAttributes: """ Attributes: - name (str | Unset): The name of the checklist template - description (None | str | Unset): The description of the checklist template - fields (list[UpdateCatalogChecklistTemplateDataAttributesBuiltinField | - UpdateCatalogChecklistTemplateDataAttributesCustomField] | None | Unset): Template fields. Position is - determined by array order. Replaces all existing fields. - owners (list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset): Template owners. - Replaces all existing owners. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the checklist template + description (Union[None, Unset, str]): The description of the checklist template + fields (Union[None, Unset, list[Union['UpdateCatalogChecklistTemplateDataAttributesBuiltinField', + 'UpdateCatalogChecklistTemplateDataAttributesCustomField']]]): Template fields. Position is determined by array + order. Replaces all existing fields. + owners (Union[None, Unset, list['UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item']]): Template + owners. Replaces all existing owners. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET fields: ( - list[ - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ] - | None + None | Unset + | list[ + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] + ] ) = UNSET - owners: list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset = UNSET + owners: None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_catalog_checklist_template_data_attributes_builtin_field import ( UpdateCatalogChecklistTemplateDataAttributesBuiltinField, ) + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: list[dict[str, Any]] | None | Unset + fields: None | Unset | list[dict[str, Any]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -77,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: list[dict[str, Any]] | None | Unset + owners: None | Unset | list[dict[str, Any]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -92,6 +101,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -116,26 +127,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) def _parse_fields( data: object, ) -> ( - list[ - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ] - | None + None | Unset + | list[ + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] + ] ): if data is None: return data @@ -150,10 +173,10 @@ def _parse_fields( def _parse_fields_type_0_item( data: object, - ) -> ( - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ): + ) -> Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -162,7 +185,7 @@ def _parse_fields_type_0_item( ) return fields_type_0_item_builtin_field - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -177,15 +200,17 @@ def _parse_fields_type_0_item( fields_type_0.append(fields_type_0_item) return fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[ - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset, + None + | Unset + | list[ + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] + ], data, ) @@ -193,7 +218,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset: + ) -> None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -211,13 +236,14 @@ def _parse_owners( owners_type_0.append(owners_type_0_item) return owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"], data) owners = _parse_owners(d.pop("owners", UNSET)) update_catalog_checklist_template_data_attributes = cls( + slug=slug, name=name, description=description, fields=fields, diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py index 7e061904..f918a230 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py index 7831a8c9..9ff528c0 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class UpdateCatalogChecklistTemplateDataAttributesCustomField: Attributes: field_source (UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource): catalog_property_id (str): ID of the catalog property - field_key (str | Unset): Ignored for custom fields (auto-derived from catalog property) + field_key (Union[Unset, str]): Ignored for custom fields (auto-derived from catalog property) """ field_source: UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: str | Unset = UNSET + field_key: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py index d49718a9..073dcfb7 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_data.py b/rootly_sdk/models/update_catalog_data.py index 4cb95a7c..a7def769 100644 --- a/rootly_sdk/models/update_catalog_data.py +++ b/rootly_sdk/models/update_catalog_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCatalogData: """ type_: UpdateCatalogDataType - attributes: UpdateCatalogDataAttributes + attributes: "UpdateCatalogDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_data_attributes.py b/rootly_sdk/models/update_catalog_data_attributes.py index c8e6bdc2..35787e3d 100644 --- a/rootly_sdk/models/update_catalog_data_attributes.py +++ b/rootly_sdk/models/update_catalog_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,39 +16,48 @@ class UpdateCatalogDataAttributes: """ Attributes: - name (str | Unset): - description (None | str | Unset): - icon (UpdateCatalogDataAttributesIcon | Unset): - position (int | None | Unset): Default position of the catalog when displayed in a list. - external_id (None | str | Unset): An external identifier for this catalog. Must be unique within the team. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + description (Union[None, Unset, str]): + icon (Union[Unset, UpdateCatalogDataAttributesIcon]): + position (Union[None, Unset, int]): Default position of the catalog when displayed in a list. + external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - icon: UpdateCatalogDataAttributesIcon | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | UpdateCatalogDataAttributesIcon = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: str | Unset = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -59,6 +66,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -75,43 +84,54 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: UpdateCatalogDataAttributesIcon | Unset + icon: Unset | UpdateCatalogDataAttributesIcon if isinstance(_icon, Unset): icon = UNSET else: icon = check_update_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) update_catalog_data_attributes = cls( + slug=slug, name=name, description=description, icon=icon, diff --git a/rootly_sdk/models/update_catalog_entity.py b/rootly_sdk/models/update_catalog_entity.py index 192874f3..1d01990b 100644 --- a/rootly_sdk/models/update_catalog_entity.py +++ b/rootly_sdk/models/update_catalog_entity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogEntity: data (UpdateCatalogEntityData): """ - data: UpdateCatalogEntityData + data: "UpdateCatalogEntityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_entity_data.py b/rootly_sdk/models/update_catalog_entity_data.py index 1e0c6e1d..1ae7aec8 100644 --- a/rootly_sdk/models/update_catalog_entity_data.py +++ b/rootly_sdk/models/update_catalog_entity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCatalogEntityData: """ type_: UpdateCatalogEntityDataType - attributes: UpdateCatalogEntityDataAttributes + attributes: "UpdateCatalogEntityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_entity_data_attributes.py b/rootly_sdk/models/update_catalog_entity_data_attributes.py index d04a6a4c..f4039184 100644 --- a/rootly_sdk/models/update_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,52 +18,68 @@ class UpdateCatalogEntityDataAttributes: """ Attributes: - name (str | Unset): - description (None | str | Unset): - position (int | None | Unset): Default position of the item when displayed in a list. - backstage_id (None | str | Unset): The Backstage entity ID this catalog entity is linked to. - external_id (None | str | Unset): An external identifier for this catalog entity. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): The status page description of the catalog entity + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + backstage_id (Union[None, Unset, str]): The Backstage entity ID this catalog entity is linked to. + external_id (Union[None, Unset, str]): An external identifier for this catalog entity. Must be unique within the catalog. - properties (list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset): Array of property values for this - catalog entity + properties (Union[Unset, list['UpdateCatalogEntityDataAttributesPropertiesItem']]): Array of property values for + this catalog entity """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - properties: list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + properties: Unset | list["UpdateCatalogEntityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -75,10 +89,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if backstage_id is not UNSET: @@ -97,56 +115,75 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_catalog_entity_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, position=position, backstage_id=backstage_id, external_id=external_id, diff --git a/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py b/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py index 06dcaffd..001e4eb7 100644 --- a/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_entity_property.py b/rootly_sdk/models/update_catalog_entity_property.py index 9e9215a5..27f982f7 100644 --- a/rootly_sdk/models/update_catalog_entity_property.py +++ b/rootly_sdk/models/update_catalog_entity_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class UpdateCatalogEntityProperty: data (UpdateCatalogEntityPropertyData): """ - data: UpdateCatalogEntityPropertyData + data: "UpdateCatalogEntityPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_entity_property_data.py b/rootly_sdk/models/update_catalog_entity_property_data.py index d5d8a95a..c1b43386 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data.py +++ b/rootly_sdk/models/update_catalog_entity_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCatalogEntityPropertyData: """ type_: UpdateCatalogEntityPropertyDataType - attributes: UpdateCatalogEntityPropertyDataAttributes + attributes: "UpdateCatalogEntityPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py index eb945add..82f8b56c 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -18,15 +16,15 @@ class UpdateCatalogEntityPropertyDataAttributes: """ Attributes: - key (UpdateCatalogEntityPropertyDataAttributesKey | Unset): - value (str | Unset): + key (Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey]): + value (Union[Unset, str]): """ - key: UpdateCatalogEntityPropertyDataAttributesKey | Unset = UNSET - value: str | Unset = UNSET + key: Unset | UpdateCatalogEntityPropertyDataAttributesKey = UNSET + value: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - key: str | Unset = UNSET + key: Unset | str = UNSET if not isinstance(self.key, Unset): key = self.key @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _key = d.pop("key", UNSET) - key: UpdateCatalogEntityPropertyDataAttributesKey | Unset + key: Unset | UpdateCatalogEntityPropertyDataAttributesKey if isinstance(_key, Unset): key = UNSET else: diff --git a/rootly_sdk/models/update_catalog_field.py b/rootly_sdk/models/update_catalog_field.py index 1c18e6d3..71d4aaf0 100644 --- a/rootly_sdk/models/update_catalog_field.py +++ b/rootly_sdk/models/update_catalog_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogField: data (UpdateCatalogFieldData): """ - data: UpdateCatalogFieldData + data: "UpdateCatalogFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_field_data.py b/rootly_sdk/models/update_catalog_field_data.py index aead4648..08e43274 100644 --- a/rootly_sdk/models/update_catalog_field_data.py +++ b/rootly_sdk/models/update_catalog_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCatalogFieldData: """ type_: UpdateCatalogFieldDataType - attributes: UpdateCatalogFieldDataAttributes + attributes: "UpdateCatalogFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_field_data_attributes.py b/rootly_sdk/models/update_catalog_field_data_attributes.py index 743f9aaf..3783689b 100644 --- a/rootly_sdk/models/update_catalog_field_data_attributes.py +++ b/rootly_sdk/models/update_catalog_field_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,38 +20,48 @@ class UpdateCatalogFieldDataAttributes: """ Attributes: - name (str | Unset): - kind (UpdateCatalogFieldDataAttributesKind | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the field is required. - catalog_type (UpdateCatalogFieldDataAttributesCatalogType | Unset): The type of catalog the field belongs to. - external_id (None | str | Unset): An external identifier for this catalog field. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + kind (Union[Unset, UpdateCatalogFieldDataAttributesKind]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the field is required. + catalog_type (Union[Unset, UpdateCatalogFieldDataAttributesCatalogType]): The type of catalog the field belongs + to. + external_id (Union[None, Unset, str]): An external identifier for this catalog field. Must be unique within the scope. """ - name: str | Unset = UNSET - kind: UpdateCatalogFieldDataAttributesKind | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: UpdateCatalogFieldDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + kind: Unset | UpdateCatalogFieldDataAttributesKind = UNSET + kind_catalog_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | UpdateCatalogFieldDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: None | str | Unset + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -61,11 +69,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -74,6 +82,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if kind is not UNSET: @@ -94,52 +104,63 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: UpdateCatalogFieldDataAttributesKind | Unset + kind: Unset | UpdateCatalogFieldDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_field_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: UpdateCatalogFieldDataAttributesCatalogType | Unset + catalog_type: Unset | UpdateCatalogFieldDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_update_catalog_field_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) update_catalog_field_data_attributes = cls( + slug=slug, name=name, kind=kind, kind_catalog_id=kind_catalog_id, diff --git a/rootly_sdk/models/update_catalog_property.py b/rootly_sdk/models/update_catalog_property.py index 8b15c596..d7ba4b5e 100644 --- a/rootly_sdk/models/update_catalog_property.py +++ b/rootly_sdk/models/update_catalog_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogProperty: data (UpdateCatalogPropertyData): """ - data: UpdateCatalogPropertyData + data: "UpdateCatalogPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_property_data.py b/rootly_sdk/models/update_catalog_property_data.py index 2d7bf203..2412fa4f 100644 --- a/rootly_sdk/models/update_catalog_property_data.py +++ b/rootly_sdk/models/update_catalog_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCatalogPropertyData: """ type_: UpdateCatalogPropertyDataType - attributes: UpdateCatalogPropertyDataAttributes + attributes: "UpdateCatalogPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_property_data_attributes.py b/rootly_sdk/models/update_catalog_property_data_attributes.py index a5327c9d..c6dd568b 100644 --- a/rootly_sdk/models/update_catalog_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_property_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,39 +20,48 @@ class UpdateCatalogPropertyDataAttributes: """ Attributes: - name (str | Unset): - kind (UpdateCatalogPropertyDataAttributesKind | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the property is required. - catalog_type (UpdateCatalogPropertyDataAttributesCatalogType | Unset): The type of catalog the property belongs - to. - external_id (None | str | Unset): An external identifier for this catalog property. Must be unique within the - scope. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + kind (Union[Unset, UpdateCatalogPropertyDataAttributesKind]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the property is required. + catalog_type (Union[Unset, UpdateCatalogPropertyDataAttributesCatalogType]): The type of catalog the property + belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog property. Must be unique within + the scope. """ - name: str | Unset = UNSET - kind: UpdateCatalogPropertyDataAttributesKind | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: UpdateCatalogPropertyDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + kind: Unset | UpdateCatalogPropertyDataAttributesKind = UNSET + kind_catalog_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | UpdateCatalogPropertyDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: None | str | Unset + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -62,11 +69,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -75,6 +82,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if kind is not UNSET: @@ -95,52 +104,63 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: UpdateCatalogPropertyDataAttributesKind | Unset + kind: Unset | UpdateCatalogPropertyDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_property_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: UpdateCatalogPropertyDataAttributesCatalogType | Unset + catalog_type: Unset | UpdateCatalogPropertyDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_update_catalog_property_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) update_catalog_property_data_attributes = cls( + slug=slug, name=name, kind=kind, kind_catalog_id=kind_catalog_id, diff --git a/rootly_sdk/models/update_cause.py b/rootly_sdk/models/update_cause.py index bcbc6c76..ff36414d 100644 --- a/rootly_sdk/models/update_cause.py +++ b/rootly_sdk/models/update_cause.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCause: data (UpdateCauseData): """ - data: UpdateCauseData + data: "UpdateCauseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_cause_data.py b/rootly_sdk/models/update_cause_data.py index 4ee88f52..afcaf388 100644 --- a/rootly_sdk/models/update_cause_data.py +++ b/rootly_sdk/models/update_cause_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCauseData: """ type_: UpdateCauseDataType - attributes: UpdateCauseDataAttributes + attributes: "UpdateCauseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_cause_data_attributes.py b/rootly_sdk/models/update_cause_data_attributes.py index b3bd138c..04ac0a70 100644 --- a/rootly_sdk/models/update_cause_data_attributes.py +++ b/rootly_sdk/models/update_cause_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -18,34 +16,51 @@ class UpdateCauseDataAttributes: """ Attributes: - name (str | Unset): The name of the cause - description (None | str | Unset): The description of the cause - position (int | None | Unset): Position of the cause - properties (list[UpdateCauseDataAttributesPropertiesItem] | Unset): Array of property values for this cause. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the cause + description (Union[None, Unset, str]): The description of the cause + public_description (Union[None, Unset, str]): The status page description of the cause + position (Union[None, Unset, int]): Position of the cause + properties (Union[Unset, list['UpdateCauseDataAttributesPropertiesItem']]): Array of property values for this + cause. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - properties: list[UpdateCauseDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + properties: Unset | list["UpdateCauseDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -55,10 +70,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if properties is not UNSET: @@ -71,38 +90,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_cause_data_attributes_properties_item import UpdateCauseDataAttributesPropertiesItem d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateCauseDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateCauseDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateCauseDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_cause_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, position=position, properties=properties, ) diff --git a/rootly_sdk/models/update_cause_data_attributes_properties_item.py b/rootly_sdk/models/update_cause_data_attributes_properties_item.py index f551eb85..536c2d79 100644 --- a/rootly_sdk/models/update_cause_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_cause_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_clickup_task_task_params.py b/rootly_sdk/models/update_clickup_task_task_params.py index 7be46a3a..a1a7d6a6 100644 --- a/rootly_sdk/models/update_clickup_task_task_params.py +++ b/rootly_sdk/models/update_clickup_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,34 +22,33 @@ class UpdateClickupTaskTaskParams: """ Attributes: task_id (str): The task id - task_type (UpdateClickupTaskTaskParamsTaskType | Unset): - title (str | Unset): The task title - description (str | Unset): The task description - tags (str | Unset): The task tags - priority (UpdateClickupTaskTaskParamsPriority | Unset): The priority id and display name - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateClickupTaskTaskParamsTaskType]): + title (Union[Unset, str]): The task title + description (Union[Unset, str]): The task description + tags (Union[Unset, str]): The task tags + priority (Union[Unset, UpdateClickupTaskTaskParamsPriority]): The priority id and display name + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - task_payload (None | str | Unset): Additional ClickUp task attributes. Will be merged into whatever was + task_payload (Union[None, Unset, str]): Additional ClickUp task attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ task_id: str - task_type: UpdateClickupTaskTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - tags: str | Unset = UNSET - priority: UpdateClickupTaskTaskParamsPriority | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - task_payload: None | str | Unset = UNSET + task_type: Unset | UpdateClickupTaskTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + tags: Unset | str = UNSET + priority: Union[Unset, "UpdateClickupTaskTaskParamsPriority"] = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + task_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,19 +58,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: None | str | Unset + task_payload: None | Unset | str if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -113,7 +110,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: task_id = d.pop("task_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateClickupTaskTaskParamsTaskType | Unset + task_type: Unset | UpdateClickupTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -126,7 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateClickupTaskTaskParamsPriority | Unset + priority: Unset | UpdateClickupTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -134,21 +131,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> None | str | Unset: + def _parse_task_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) diff --git a/rootly_sdk/models/update_clickup_task_task_params_priority.py b/rootly_sdk/models/update_clickup_task_task_params_priority.py index bfae1358..eb3024d0 100644 --- a/rootly_sdk/models/update_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/update_clickup_task_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateClickupTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_coda_page_task_params.py b/rootly_sdk/models/update_coda_page_task_params.py index cc57f6dc..f36a0719 100644 --- a/rootly_sdk/models/update_coda_page_task_params.py +++ b/rootly_sdk/models/update_coda_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,28 +22,27 @@ class UpdateCodaPageTaskParams: """ Attributes: page_id (str): The Coda page id - task_type (UpdateCodaPageTaskParamsTaskType | Unset): - doc_id (str | Unset): The Coda doc id - title (str | Unset): The Coda page title - subtitle (str | Unset): The Coda page subtitle - content (str | Unset): The Coda page content - template (UpdateCodaPageTaskParamsTemplate | Unset): + task_type (Union[Unset, UpdateCodaPageTaskParamsTaskType]): + doc_id (Union[Unset, str]): The Coda doc id + title (Union[Unset, str]): The Coda page title + subtitle (Union[Unset, str]): The Coda page subtitle + content (Union[Unset, str]): The Coda page content + template (Union[Unset, UpdateCodaPageTaskParamsTemplate]): """ page_id: str - task_type: UpdateCodaPageTaskParamsTaskType | Unset = UNSET - doc_id: str | Unset = UNSET - title: str | Unset = UNSET - subtitle: str | Unset = UNSET - content: str | Unset = UNSET - template: UpdateCodaPageTaskParamsTemplate | Unset = UNSET + task_type: Unset | UpdateCodaPageTaskParamsTaskType = UNSET + doc_id: Unset | str = UNSET + title: Unset | str = UNSET + subtitle: Unset | str = UNSET + content: Unset | str = UNSET + template: Union[Unset, "UpdateCodaPageTaskParamsTemplate"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - page_id = self.page_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: dict[str, Any] | Unset = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -91,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: page_id = d.pop("page_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateCodaPageTaskParamsTaskType | Unset + task_type: Unset | UpdateCodaPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -106,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: UpdateCodaPageTaskParamsTemplate | Unset + template: Unset | UpdateCodaPageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_coda_page_task_params_template.py b/rootly_sdk/models/update_coda_page_task_params_template.py index 58a24acc..267641e6 100644 --- a/rootly_sdk/models/update_coda_page_task_params_template.py +++ b/rootly_sdk/models/update_coda_page_task_params_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateCodaPageTaskParamsTemplate: """ Attributes: - id (str | Unset): Combined doc_id/page_id in format 'doc_id/page_id' - name (str | Unset): + id (Union[Unset, str]): Combined doc_id/page_id in format 'doc_id/page_id' + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_communications_group.py b/rootly_sdk/models/update_communications_group.py index f9a17ecf..01e5aa95 100644 --- a/rootly_sdk/models/update_communications_group.py +++ b/rootly_sdk/models/update_communications_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsGroup: data (UpdateCommunicationsGroupData): """ - data: UpdateCommunicationsGroupData + data: "UpdateCommunicationsGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_group_data.py b/rootly_sdk/models/update_communications_group_data.py index bc38f326..0fee453c 100644 --- a/rootly_sdk/models/update_communications_group_data.py +++ b/rootly_sdk/models/update_communications_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsGroupData: """ type_: UpdateCommunicationsGroupDataType - attributes: UpdateCommunicationsGroupDataAttributes + attributes: "UpdateCommunicationsGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_group_data_attributes.py b/rootly_sdk/models/update_communications_group_data_attributes.py index a89a63de..65184abe 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes.py +++ b/rootly_sdk/models/update_communications_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,44 +25,43 @@ class UpdateCommunicationsGroupDataAttributes: """ Attributes: - name (str | Unset): The name of the communications group - description (None | str | Unset): The description of the communications group - communication_type_id (str | Unset): The communication type ID - is_private (bool | None | Unset): Whether the group is private - condition_type (UpdateCommunicationsGroupDataAttributesConditionType | Unset): Condition type - sms_channel (bool | None | Unset): SMS channel enabled - email_channel (bool | None | Unset): Email channel enabled - member_ids (list[int] | None | Unset): Array of member user IDs - slack_channel_ids (list[str] | None | Unset): Array of Slack channel IDs - communication_group_conditions - (list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset): Group - conditions attributes - communication_external_group_members - (list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset): - External group members attributes + name (Union[Unset, str]): The name of the communications group + description (Union[None, Unset, str]): The description of the communications group + communication_type_id (Union[Unset, str]): The communication type ID + is_private (Union[None, Unset, bool]): Whether the group is private + condition_type (Union[Unset, UpdateCommunicationsGroupDataAttributesConditionType]): Condition type + sms_channel (Union[None, Unset, bool]): SMS channel enabled + email_channel (Union[None, Unset, bool]): Email channel enabled + member_ids (Union[None, Unset, list[int]]): Array of member user IDs + slack_channel_ids (Union[None, Unset, list[str]]): Array of Slack channel IDs + communication_group_conditions (Union[None, Unset, + list['UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item']]): Group conditions + attributes + communication_external_group_members (Union[None, Unset, + list['UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item']]): External group + members attributes """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_type_id: str | Unset = UNSET - is_private: bool | None | Unset = UNSET - condition_type: UpdateCommunicationsGroupDataAttributesConditionType | Unset = UNSET - sms_channel: bool | None | Unset = UNSET - email_channel: bool | None | Unset = UNSET - member_ids: list[int] | None | Unset = UNSET - slack_channel_ids: list[str] | None | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_type_id: Unset | str = UNSET + is_private: None | Unset | bool = UNSET + condition_type: Unset | UpdateCommunicationsGroupDataAttributesConditionType = UNSET + sms_channel: None | Unset | bool = UNSET + email_channel: None | Unset | bool = UNSET + member_ids: None | Unset | list[int] = UNSET + slack_channel_ids: None | Unset | list[str] = UNSET communication_group_conditions: ( - list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset + None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] ) = UNSET communication_external_group_members: ( - list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset + None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] ) = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -72,29 +69,29 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - is_private: bool | None | Unset + is_private: None | Unset | bool if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: str | Unset = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: bool | None | Unset + sms_channel: None | Unset | bool if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: bool | None | Unset + email_channel: None | Unset | bool if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: list[int] | None | Unset + member_ids: None | Unset | list[int] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -103,7 +100,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: list[str] | None | Unset + slack_channel_ids: None | Unset | list[str] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -112,7 +109,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: list[dict[str, Any]] | None | Unset + communication_group_conditions: None | Unset | list[dict[str, Any]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -124,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: list[dict[str, Any]] | None | Unset + communication_external_group_members: None | Unset | list[dict[str, Any]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -178,52 +175,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_is_private(data: object) -> bool | None | Unset: + def _parse_is_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateCommunicationsGroupDataAttributesConditionType | Unset + condition_type: Unset | UpdateCommunicationsGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_communications_group_data_attributes_condition_type(_condition_type) - def _parse_sms_channel(data: object) -> bool | None | Unset: + def _parse_sms_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> bool | None | Unset: + def _parse_email_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> list[int] | None | Unset: + def _parse_member_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -234,13 +231,13 @@ def _parse_member_ids(data: object) -> list[int] | None | Unset: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: + def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -251,15 +248,15 @@ def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -279,10 +276,11 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset, data + None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"], + data, ) communication_group_conditions = _parse_communication_group_conditions( @@ -291,7 +289,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset: + ) -> None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -313,10 +311,12 @@ def _parse_communication_external_group_members( communication_external_group_members_type_0.append(communication_external_group_members_type_0_item) return communication_external_group_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset, + None + | Unset + | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], data, ) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py index cafe7e7c..8634430c 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,20 +13,20 @@ class UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item: """ Attributes: - id (None | str | Unset): ID of the external group member - name (str | Unset): Name of the external member - email (str | Unset): Email of the external member - phone_number (str | Unset): Phone number of the external member + id (Union[None, Unset, str]): ID of the external group member + name (Union[Unset, str]): Name of the external member + email (Union[Unset, str]): Email of the external member + phone_number (Union[Unset, str]): Phone number of the external member """ - id: None | str | Unset = UNSET - name: str | Unset = UNSET - email: str | Unset = UNSET - phone_number: str | Unset = UNSET + id: None | Unset | str = UNSET + name: Unset | str = UNSET + email: Unset | str = UNSET + phone_number: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: None | str | Unset + id: None | Unset | str if isinstance(self.id, Unset): id = UNSET else: @@ -58,12 +56,12 @@ 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_id(data: object) -> None | str | Unset: + def _parse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) id = _parse_id(d.pop("id", UNSET)) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py index 5cc8ccb1..8de71c14 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,39 +17,39 @@ class UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: """ Attributes: - id (None | str | Unset): ID of the condition - property_type (UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | - Unset): Property type - service_ids (list[str] | None | Unset): Array of service IDs - severity_ids (list[str] | None | Unset): Array of severity IDs - functionality_ids (list[str] | None | Unset): Array of functionality IDs - group_ids (list[str] | None | Unset): Array of group IDs - incident_type_ids (list[str] | None | Unset): Array of incident type IDs + id (Union[None, Unset, str]): ID of the condition + property_type (Union[Unset, + UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType]): Property type + service_ids (Union[None, Unset, list[str]]): Array of service IDs + severity_ids (Union[None, Unset, list[str]]): Array of severity IDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality IDs + group_ids (Union[None, Unset, list[str]]): Array of group IDs + incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - id: None | str | Unset = UNSET - property_type: UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset = ( + id: None | Unset | str = UNSET + property_type: Unset | UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = ( UNSET ) - service_ids: list[str] | None | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + service_ids: None | Unset | list[str] = UNSET + severity_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: None | str | Unset + id: None | Unset | str if isinstance(self.id, Unset): id = UNSET else: id = self.id - property_type: str | Unset = UNSET + property_type: Unset | str = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -60,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -69,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -87,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -120,17 +118,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_id(data: object) -> None | str | Unset: + def _parse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) id = _parse_id(d.pop("id", UNSET)) _property_type = d.pop("property_type", UNSET) - property_type: UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset + property_type: Unset | UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType if isinstance(_property_type, Unset): property_type = UNSET else: @@ -138,7 +136,7 @@ def _parse_id(data: object) -> None | str | Unset: _property_type ) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -149,13 +147,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -166,13 +164,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -183,13 +181,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -200,13 +198,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -217,9 +215,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_communications_stage.py b/rootly_sdk/models/update_communications_stage.py index 1a54ae26..ce803372 100644 --- a/rootly_sdk/models/update_communications_stage.py +++ b/rootly_sdk/models/update_communications_stage.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsStage: data (UpdateCommunicationsStageData): """ - data: UpdateCommunicationsStageData + data: "UpdateCommunicationsStageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_stage_data.py b/rootly_sdk/models/update_communications_stage_data.py index 119b57fb..e3ead90b 100644 --- a/rootly_sdk/models/update_communications_stage_data.py +++ b/rootly_sdk/models/update_communications_stage_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsStageData: """ type_: UpdateCommunicationsStageDataType - attributes: UpdateCommunicationsStageDataAttributes + attributes: "UpdateCommunicationsStageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_stage_data_attributes.py b/rootly_sdk/models/update_communications_stage_data_attributes.py index a0a443e5..2c399d85 100644 --- a/rootly_sdk/models/update_communications_stage_data_attributes.py +++ b/rootly_sdk/models/update_communications_stage_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,25 +12,34 @@ class UpdateCommunicationsStageDataAttributes: """ Attributes: - name (str | Unset): The name of the communications stage - description (None | str | Unset): The description of the communications stage - position (int | None | Unset): Position of the communications stage + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the communications stage + description (Union[None, Unset, str]): The description of the communications stage + position (Union[None, Unset, int]): Position of the communications stage """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -41,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -53,27 +62,38 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) update_communications_stage_data_attributes = cls( + slug=slug, name=name, description=description, position=position, diff --git a/rootly_sdk/models/update_communications_template.py b/rootly_sdk/models/update_communications_template.py index 6b584d62..e21c6f26 100644 --- a/rootly_sdk/models/update_communications_template.py +++ b/rootly_sdk/models/update_communications_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsTemplate: data (UpdateCommunicationsTemplateData): """ - data: UpdateCommunicationsTemplateData + data: "UpdateCommunicationsTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_template_data.py b/rootly_sdk/models/update_communications_template_data.py index 98c2b295..86dfa99c 100644 --- a/rootly_sdk/models/update_communications_template_data.py +++ b/rootly_sdk/models/update_communications_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsTemplateData: """ type_: UpdateCommunicationsTemplateDataType - attributes: UpdateCommunicationsTemplateDataAttributes + attributes: "UpdateCommunicationsTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_template_data_attributes.py b/rootly_sdk/models/update_communications_template_data_attributes.py index 51b6c959..ceb94ac5 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes.py +++ b/rootly_sdk/models/update_communications_template_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,28 +18,27 @@ class UpdateCommunicationsTemplateDataAttributes: """ Attributes: - name (str | Unset): The name of the communications template - description (None | str | Unset): The description of the communications template - communication_type_id (str | Unset): The communication type ID - position (int | None | Unset): Position of the communications template - communication_template_stages_attributes - (list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset): - Template stages attributes + name (Union[Unset, str]): The name of the communications template + description (Union[None, Unset, str]): The description of the communications template + communication_type_id (Union[Unset, str]): The communication type ID + position (Union[None, Unset, int]): Position of the communications template + communication_template_stages_attributes (Union[None, Unset, + list['UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item']]): Template + stages attributes """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_type_id: str | Unset = UNSET - position: int | None | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_type_id: Unset | str = UNSET + position: None | Unset | int = UNSET communication_template_stages_attributes: ( - list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset + None | Unset | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] ) = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -49,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: list[dict[str, Any]] | None | Unset + communication_template_stages_attributes: None | Unset | list[dict[str, Any]] if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -96,32 +93,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, ) -> ( - list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] - | None + None | Unset + | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] ): if data is None: return data @@ -144,12 +141,12 @@ def _parse_communication_template_stages_attributes( ) return communication_template_stages_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] - | None - | Unset, + None + | Unset + | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], data, ) diff --git a/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py b/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py index f8491a27..70e273b7 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py +++ b/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,46 +13,46 @@ class UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item: """ Attributes: - id (None | str | Unset): ID of the communication template stage - sms_content (None | str | Unset): SMS content for the stage - email_subject (None | str | Unset): Email subject for the stage - email_body (None | str | Unset): Email body for the stage - slack_content (None | str | Unset): Slack content for the stage + id (Union[None, Unset, str]): ID of the communication template stage + sms_content (Union[None, Unset, str]): SMS content for the stage + email_subject (Union[None, Unset, str]): Email subject for the stage + email_body (Union[None, Unset, str]): Email body for the stage + slack_content (Union[None, Unset, str]): Slack content for the stage """ - id: None | str | Unset = UNSET - sms_content: None | str | Unset = UNSET - email_subject: None | str | Unset = UNSET - email_body: None | str | Unset = UNSET - slack_content: None | str | Unset = UNSET + id: None | Unset | str = UNSET + sms_content: None | Unset | str = UNSET + email_subject: None | Unset | str = UNSET + email_body: None | Unset | str = UNSET + slack_content: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: None | str | Unset + id: None | Unset | str if isinstance(self.id, Unset): id = UNSET else: id = self.id - sms_content: None | str | Unset + sms_content: None | Unset | str if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: None | str | Unset + email_subject: None | Unset | str if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: None | str | Unset + email_body: None | Unset | str if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: None | str | Unset + slack_content: None | Unset | str if isinstance(self.slack_content, Unset): slack_content = UNSET else: @@ -80,48 +78,48 @@ 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_id(data: object) -> None | str | Unset: + def _parse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) id = _parse_id(d.pop("id", UNSET)) - def _parse_sms_content(data: object) -> None | str | Unset: + def _parse_sms_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> None | str | Unset: + def _parse_email_subject(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> None | str | Unset: + def _parse_email_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> None | str | Unset: + def _parse_slack_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) diff --git a/rootly_sdk/models/update_communications_type.py b/rootly_sdk/models/update_communications_type.py index 4417e08f..28420815 100644 --- a/rootly_sdk/models/update_communications_type.py +++ b/rootly_sdk/models/update_communications_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsType: data (UpdateCommunicationsTypeData): """ - data: UpdateCommunicationsTypeData + data: "UpdateCommunicationsTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_type_data.py b/rootly_sdk/models/update_communications_type_data.py index 8550fb92..c34b23c4 100644 --- a/rootly_sdk/models/update_communications_type_data.py +++ b/rootly_sdk/models/update_communications_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsTypeData: """ type_: UpdateCommunicationsTypeDataType - attributes: UpdateCommunicationsTypeDataAttributes + attributes: "UpdateCommunicationsTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_type_data_attributes.py b/rootly_sdk/models/update_communications_type_data_attributes.py index 9b78ebed..dd596593 100644 --- a/rootly_sdk/models/update_communications_type_data_attributes.py +++ b/rootly_sdk/models/update_communications_type_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,33 +12,42 @@ class UpdateCommunicationsTypeDataAttributes: """ Attributes: - name (str | Unset): The name of the communications type - description (None | str | Unset): The description of the communications type - color (None | str | Unset): The color of the communications type - position (int | None | Unset): Position of the communications type + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the communications type + description (Union[None, Unset, str]): The description of the communications type + color (Union[None, Unset, str]): The color of the communications type + position (Union[None, Unset, int]): Position of the communications type """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -49,6 +56,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -63,36 +72,47 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) update_communications_type_data_attributes = cls( + slug=slug, name=name, description=description, color=color, diff --git a/rootly_sdk/models/update_confluence_page_task_params.py b/rootly_sdk/models/update_confluence_page_task_params.py index fe6ce985..ce40e240 100644 --- a/rootly_sdk/models/update_confluence_page_task_params.py +++ b/rootly_sdk/models/update_confluence_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,37 +23,38 @@ class UpdateConfluencePageTaskParams: """ Attributes: file_id (str): The Confluence page ID - task_type (UpdateConfluencePageTaskParamsTaskType | Unset): - integration (UpdateConfluencePageTaskParamsIntegration | Unset): Specify integration id if you have more than - one Confluence instance - title (str | Unset): The Confluence page title - content (str | Unset): The Confluence page content - post_mortem_template_id (str | Unset): Retrospective template to use when updating page, if desired - template (UpdateConfluencePageTaskParamsTemplate | Unset): The Confluence template to use - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. + task_type (Union[Unset, UpdateConfluencePageTaskParamsTaskType]): + integration (Union[Unset, UpdateConfluencePageTaskParamsIntegration]): Specify integration id if you have more + than one Confluence instance + title (Union[Unset, str]): The Confluence page title + content (Union[Unset, str]): The Confluence page content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating page, if desired + template (Union[Unset, UpdateConfluencePageTaskParamsTemplate]): The Confluence template to use + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. """ file_id: str - task_type: UpdateConfluencePageTaskParamsTaskType | Unset = UNSET - integration: UpdateConfluencePageTaskParamsIntegration | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template: UpdateConfluencePageTaskParamsTemplate | Unset = UNSET - include_overview: bool | Unset = True - include_timeline: bool | Unset = True + task_type: Unset | UpdateConfluencePageTaskParamsTaskType = UNSET + integration: Union[Unset, "UpdateConfluencePageTaskParamsIntegration"] = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + template: Union[Unset, "UpdateConfluencePageTaskParamsTemplate"] = UNSET + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -65,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: post_mortem_template_id = self.post_mortem_template_id - template: dict[str, Any] | Unset = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -73,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -96,6 +97,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups return field_dict @@ -108,14 +111,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateConfluencePageTaskParamsTaskType | Unset + task_type: Unset | UpdateConfluencePageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_confluence_page_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: UpdateConfluencePageTaskParamsIntegration | Unset + integration: Unset | UpdateConfluencePageTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -128,7 +131,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_mortem_template_id = d.pop("post_mortem_template_id", UNSET) _template = d.pop("template", UNSET) - template: UpdateConfluencePageTaskParamsTemplate | Unset + template: Unset | UpdateConfluencePageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: @@ -138,6 +141,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + update_confluence_page_task_params = cls( file_id=file_id, task_type=task_type, @@ -148,6 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: template=template, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, ) update_confluence_page_task_params.additional_properties = d diff --git a/rootly_sdk/models/update_confluence_page_task_params_integration.py b/rootly_sdk/models/update_confluence_page_task_params_integration.py index a1f464df..81dfec1a 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/update_confluence_page_task_params_integration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateConfluencePageTaskParamsIntegration: """Specify integration id if you have more than one Confluence instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_confluence_page_task_params_template.py b/rootly_sdk/models/update_confluence_page_task_params_template.py index 8ab06a92..92bc9f06 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_template.py +++ b/rootly_sdk/models/update_confluence_page_task_params_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateConfluencePageTaskParamsTemplate: """The Confluence template to use Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_custom_field.py b/rootly_sdk/models/update_custom_field.py index 5ed37956..bf4eb47c 100644 --- a/rootly_sdk/models/update_custom_field.py +++ b/rootly_sdk/models/update_custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCustomField: data (UpdateCustomFieldData): """ - data: UpdateCustomFieldData + data: "UpdateCustomFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_custom_field_data.py b/rootly_sdk/models/update_custom_field_data.py index 414bc949..b67f174c 100644 --- a/rootly_sdk/models/update_custom_field_data.py +++ b/rootly_sdk/models/update_custom_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCustomFieldData: """ type_: UpdateCustomFieldDataType - attributes: UpdateCustomFieldDataAttributes + attributes: "UpdateCustomFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_custom_field_data_attributes.py b/rootly_sdk/models/update_custom_field_data_attributes.py index 2eac8a3a..0abc43ab 100644 --- a/rootly_sdk/models/update_custom_field_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,38 +20,38 @@ class UpdateCustomFieldDataAttributes: """ Attributes: - label (str | Unset): The name of the custom_field - description (None | str | Unset): The description of the custom_field - shown (list[UpdateCustomFieldDataAttributesShownItem] | Unset): - required (list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset): - default (None | str | Unset): The default value for text field kinds - position (int | Unset): The position of the custom_field + label (Union[Unset, str]): The name of the custom_field + description (Union[None, Unset, str]): The description of the custom_field + shown (Union[Unset, list[UpdateCustomFieldDataAttributesShownItem]]): + required (Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]]): + default (Union[None, Unset, str]): The default value for text field kinds + position (Union[Unset, int]): The position of the custom_field """ - label: str | Unset = UNSET - description: None | str | Unset = UNSET - shown: list[UpdateCustomFieldDataAttributesShownItem] | Unset = UNSET - required: list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset = UNSET - default: None | str | Unset = UNSET - position: int | Unset = UNSET + label: Unset | str = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[UpdateCustomFieldDataAttributesShownItem] = UNSET + required: None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item] = UNSET + default: None | Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: label = self.label - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = [] for shown_item_data in self.shown: shown_item: str = shown_item_data shown.append(shown_item) - required: list[str] | None | Unset + required: None | Unset | list[str] if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -65,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: None | str | Unset + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: @@ -96,25 +94,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) label = d.pop("label", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + shown = [] _shown = d.pop("shown", UNSET) - shown: list[UpdateCustomFieldDataAttributesShownItem] | Unset = UNSET - if _shown is not UNSET: - shown = [] - for shown_item_data in _shown: - shown_item = check_update_custom_field_data_attributes_shown_item(shown_item_data) + for shown_item_data in _shown or []: + shown_item = check_update_custom_field_data_attributes_shown_item(shown_item_data) - shown.append(shown_item) + shown.append(shown_item) - def _parse_required(data: object) -> list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset: + def _parse_required(data: object) -> None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item]: if data is None: return data if isinstance(data, Unset): @@ -132,18 +128,18 @@ def _parse_required(data: object) -> list[UpdateCustomFieldDataAttributesRequire required_type_0.append(required_type_0_item) return required_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset, data) + return cast(None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item], data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/update_custom_field_option.py b/rootly_sdk/models/update_custom_field_option.py index 52ad39dc..b1be8000 100644 --- a/rootly_sdk/models/update_custom_field_option.py +++ b/rootly_sdk/models/update_custom_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCustomFieldOption: data (UpdateCustomFieldOptionData): """ - data: UpdateCustomFieldOptionData + data: "UpdateCustomFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_custom_field_option_data.py b/rootly_sdk/models/update_custom_field_option_data.py index 7320f4a8..3070ade9 100644 --- a/rootly_sdk/models/update_custom_field_option_data.py +++ b/rootly_sdk/models/update_custom_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCustomFieldOptionData: """ type_: UpdateCustomFieldOptionDataType - attributes: UpdateCustomFieldOptionDataAttributes + attributes: "UpdateCustomFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_custom_field_option_data_attributes.py b/rootly_sdk/models/update_custom_field_option_data_attributes.py index 72264d79..b39881c6 100644 --- a/rootly_sdk/models/update_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_option_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,16 +12,16 @@ class UpdateCustomFieldOptionDataAttributes: """ Attributes: - value (str | Unset): The value of the custom_field_option - color (str | Unset): The hex color of the custom_field_option - default (bool | Unset): - position (int | Unset): The position of the custom_field_option + value (Union[Unset, str]): The value of the custom_field_option + color (Union[Unset, str]): The hex color of the custom_field_option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the custom_field_option """ - value: str | Unset = UNSET - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + value: Unset | str = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_custom_form.py b/rootly_sdk/models/update_custom_form.py index 406ac1e0..c207469d 100644 --- a/rootly_sdk/models/update_custom_form.py +++ b/rootly_sdk/models/update_custom_form.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCustomForm: data (UpdateCustomFormData): """ - data: UpdateCustomFormData + data: "UpdateCustomFormData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_custom_form_data.py b/rootly_sdk/models/update_custom_form_data.py index 73da6a83..bc9577de 100644 --- a/rootly_sdk/models/update_custom_form_data.py +++ b/rootly_sdk/models/update_custom_form_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCustomFormData: """ type_: UpdateCustomFormDataType - attributes: UpdateCustomFormDataAttributes + attributes: "UpdateCustomFormDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_custom_form_data_attributes.py b/rootly_sdk/models/update_custom_form_data_attributes.py index 72a3286c..c6dee99f 100644 --- a/rootly_sdk/models/update_custom_form_data_attributes.py +++ b/rootly_sdk/models/update_custom_form_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,21 +12,30 @@ class UpdateCustomFormDataAttributes: """ Attributes: - name (str | Unset): The name of the custom form. - description (None | str | Unset): - enabled (bool | Unset): - command (str | Unset): The Slack command used to trigger this form. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the custom form. + description (Union[None, Unset, str]): + enabled (Union[Unset, bool]): + command (Union[Unset, str]): The Slack command used to trigger this form. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - enabled: bool | Unset = UNSET - command: str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + enabled: Unset | bool = UNSET + command: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -41,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -55,14 +64,24 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -71,6 +90,7 @@ def _parse_description(data: object) -> None | str | Unset: command = d.pop("command", UNSET) update_custom_form_data_attributes = cls( + slug=slug, name=name, description=description, enabled=enabled, diff --git a/rootly_sdk/models/update_dashboard.py b/rootly_sdk/models/update_dashboard.py index 1a115d37..cef144c3 100644 --- a/rootly_sdk/models/update_dashboard.py +++ b/rootly_sdk/models/update_dashboard.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateDashboard: data (UpdateDashboardData): """ - data: UpdateDashboardData + data: "UpdateDashboardData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_dashboard_data.py b/rootly_sdk/models/update_dashboard_data.py index 31bbc70c..849bda0a 100644 --- a/rootly_sdk/models/update_dashboard_data.py +++ b/rootly_sdk/models/update_dashboard_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class UpdateDashboardData: """ Attributes: - type_ (UpdateDashboardDataType | Unset): - attributes (UpdateDashboardDataAttributes | Unset): + type_ (Union[Unset, UpdateDashboardDataType]): + attributes (Union[Unset, UpdateDashboardDataAttributes]): """ - type_: UpdateDashboardDataType | Unset = UNSET - attributes: UpdateDashboardDataAttributes | Unset = UNSET + type_: Unset | UpdateDashboardDataType = UNSET + attributes: Union[Unset, "UpdateDashboardDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: UpdateDashboardDataType | Unset + type_: Unset | UpdateDashboardDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: UpdateDashboardDataAttributes | Unset + attributes: Unset | UpdateDashboardDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_data_attributes.py b/rootly_sdk/models/update_dashboard_data_attributes.py index 71ceb44b..148b4538 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,43 +24,43 @@ class UpdateDashboardDataAttributes: """ Attributes: - name (str | Unset): The name of the dashboard - description (None | str | Unset): The description of the dashboard - owner (UpdateDashboardDataAttributesOwner | Unset): The owner type of the dashboard - public (bool | Unset): Whether the dashboard is public - range_ (None | str | Unset): The date range for dashboard panel data - auto_refresh (bool | Unset): Whether the dashboard auto-updates the UI with new data. - color (UpdateDashboardDataAttributesColor | Unset): The hex color of the dashboard - icon (str | Unset): The emoji icon of the dashboard - period (UpdateDashboardDataAttributesPeriod | Unset): The grouping period for dashboard panel data + name (Union[Unset, str]): The name of the dashboard + description (Union[None, Unset, str]): The description of the dashboard + owner (Union[Unset, UpdateDashboardDataAttributesOwner]): The owner type of the dashboard + public (Union[Unset, bool]): Whether the dashboard is public + range_ (Union[None, Unset, str]): The date range for dashboard panel data + auto_refresh (Union[Unset, bool]): Whether the dashboard auto-updates the UI with new data. + color (Union[Unset, UpdateDashboardDataAttributesColor]): The hex color of the dashboard + icon (Union[Unset, str]): The emoji icon of the dashboard + period (Union[Unset, UpdateDashboardDataAttributesPeriod]): The grouping period for dashboard panel data """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - owner: UpdateDashboardDataAttributesOwner | Unset = UNSET - public: bool | Unset = UNSET - range_: None | str | Unset = UNSET - auto_refresh: bool | Unset = UNSET - color: UpdateDashboardDataAttributesColor | Unset = UNSET - icon: str | Unset = UNSET - period: UpdateDashboardDataAttributesPeriod | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + owner: Unset | UpdateDashboardDataAttributesOwner = UNSET + public: Unset | bool = UNSET + range_: None | Unset | str = UNSET + auto_refresh: Unset | bool = UNSET + color: Unset | UpdateDashboardDataAttributesColor = UNSET + icon: Unset | str = UNSET + period: Unset | UpdateDashboardDataAttributesPeriod = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - owner: str | Unset = UNSET + owner: Unset | str = UNSET if not isinstance(self.owner, Unset): owner = self.owner public = self.public - range_: None | str | Unset + range_: None | Unset | str if isinstance(self.range_, Unset): range_ = UNSET else: @@ -70,13 +68,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: str | Unset = UNSET + color: Unset | str = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: str | Unset = UNSET + period: Unset | str = UNSET if not isinstance(self.period, Unset): period = self.period @@ -109,17 +107,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _owner = d.pop("owner", UNSET) - owner: UpdateDashboardDataAttributesOwner | Unset + owner: Unset | UpdateDashboardDataAttributesOwner if isinstance(_owner, Unset): owner = UNSET else: @@ -127,19 +125,19 @@ def _parse_description(data: object) -> None | str | Unset: public = d.pop("public", UNSET) - def _parse_range_(data: object) -> None | str | Unset: + def _parse_range_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: UpdateDashboardDataAttributesColor | Unset + color: Unset | UpdateDashboardDataAttributesColor if isinstance(_color, Unset): color = UNSET else: @@ -148,7 +146,7 @@ def _parse_range_(data: object) -> None | str | Unset: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: UpdateDashboardDataAttributesPeriod | Unset + period: Unset | UpdateDashboardDataAttributesPeriod if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel.py b/rootly_sdk/models/update_dashboard_panel.py index b02e34b4..1d0634fc 100644 --- a/rootly_sdk/models/update_dashboard_panel.py +++ b/rootly_sdk/models/update_dashboard_panel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateDashboardPanel: data (UpdateDashboardPanelData): """ - data: UpdateDashboardPanelData + data: "UpdateDashboardPanelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_dashboard_panel_data.py b/rootly_sdk/models/update_dashboard_panel_data.py index 340bba12..31d0f4d5 100644 --- a/rootly_sdk/models/update_dashboard_panel_data.py +++ b/rootly_sdk/models/update_dashboard_panel_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,21 +21,20 @@ class UpdateDashboardPanelData: """ Attributes: - type_ (UpdateDashboardPanelDataType | Unset): - attributes (UpdateDashboardPanelDataAttributes | Unset): + type_ (Union[Unset, UpdateDashboardPanelDataType]): + attributes (Union[Unset, UpdateDashboardPanelDataAttributes]): """ - type_: UpdateDashboardPanelDataType | Unset = UNSET - attributes: UpdateDashboardPanelDataAttributes | Unset = UNSET + type_: Unset | UpdateDashboardPanelDataType = UNSET + attributes: Union[Unset, "UpdateDashboardPanelDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -57,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: UpdateDashboardPanelDataType | Unset + type_: Unset | UpdateDashboardPanelDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_panel_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: UpdateDashboardPanelDataAttributes | Unset + attributes: Unset | UpdateDashboardPanelDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes.py b/rootly_sdk/models/update_dashboard_panel_data_attributes.py index 6025a60e..f59d99d7 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,31 +19,31 @@ class UpdateDashboardPanelDataAttributes: """ Attributes: - name (None | str | Unset): The name of the dashboard_panel - params (UpdateDashboardPanelDataAttributesParams | Unset): - position (None | Unset | UpdateDashboardPanelDataAttributesPositionType0): + name (Union[None, Unset, str]): The name of the dashboard_panel + params (Union[Unset, UpdateDashboardPanelDataAttributesParams]): + position (Union['UpdateDashboardPanelDataAttributesPositionType0', None, Unset]): """ - name: None | str | Unset = UNSET - params: UpdateDashboardPanelDataAttributesParams | Unset = UNSET - position: None | Unset | UpdateDashboardPanelDataAttributesPositionType0 = UNSET + name: None | Unset | str = UNSET + params: Union[Unset, "UpdateDashboardPanelDataAttributesParams"] = UNSET + position: Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_dashboard_panel_data_attributes_position_type_0 import ( UpdateDashboardPanelDataAttributesPositionType0, ) - name: None | str | Unset + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - params: dict[str, Any] | Unset = UNSET + params: Unset | dict[str, Any] = UNSET if not isinstance(self.params, Unset): params = self.params.to_dict() - position: dict[str, Any] | None | Unset + position: None | Unset | dict[str, Any] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, UpdateDashboardPanelDataAttributesPositionType0): @@ -74,23 +72,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _params = d.pop("params", UNSET) - params: UpdateDashboardPanelDataAttributesParams | Unset + params: Unset | UpdateDashboardPanelDataAttributesParams if isinstance(_params, Unset): params = UNSET else: params = UpdateDashboardPanelDataAttributesParams.from_dict(_params) - def _parse_position(data: object) -> None | Unset | UpdateDashboardPanelDataAttributesPositionType0: + def _parse_position(data: object) -> Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -101,9 +99,9 @@ def _parse_position(data: object) -> None | Unset | UpdateDashboardPanelDataAttr position_type_0 = UpdateDashboardPanelDataAttributesPositionType0.from_dict(data) return position_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateDashboardPanelDataAttributesPositionType0, data) + return cast(Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py index d67d451b..2cd1a381 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,43 +29,42 @@ class UpdateDashboardPanelDataAttributesParams: """ Attributes: - display (UpdateDashboardPanelDataAttributesParamsDisplay | Unset): - description (str | Unset): - table_fields (list[str] | Unset): - legend (UpdateDashboardPanelDataAttributesParamsLegend | Unset): - datalabels (UpdateDashboardPanelDataAttributesParamsDatalabels | Unset): - datasets (list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | Unset): + display (Union[Unset, UpdateDashboardPanelDataAttributesParamsDisplay]): + description (Union[Unset, str]): + table_fields (Union[Unset, list[str]]): + legend (Union[Unset, UpdateDashboardPanelDataAttributesParamsLegend]): + datalabels (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatalabels]): + datasets (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItem']]): """ - display: UpdateDashboardPanelDataAttributesParamsDisplay | Unset = UNSET - description: str | Unset = UNSET - table_fields: list[str] | Unset = UNSET - legend: UpdateDashboardPanelDataAttributesParamsLegend | Unset = UNSET - datalabels: UpdateDashboardPanelDataAttributesParamsDatalabels | Unset = UNSET - datasets: list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET + display: Unset | UpdateDashboardPanelDataAttributesParamsDisplay = UNSET + description: Unset | str = UNSET + table_fields: Unset | list[str] = UNSET + legend: Union[Unset, "UpdateDashboardPanelDataAttributesParamsLegend"] = UNSET + datalabels: Union[Unset, "UpdateDashboardPanelDataAttributesParamsDatalabels"] = UNSET + datasets: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - display: str | Unset = UNSET + display: Unset | str = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: list[str] | Unset = UNSET + table_fields: Unset | list[str] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: dict[str, Any] | Unset = UNSET + legend: Unset | dict[str, Any] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: dict[str, Any] | Unset = UNSET + datalabels: Unset | dict[str, Any] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: list[dict[str, Any]] | Unset = UNSET + datasets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -106,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: UpdateDashboardPanelDataAttributesParamsDisplay | Unset + display: Unset | UpdateDashboardPanelDataAttributesParamsDisplay if isinstance(_display, Unset): display = UNSET else: @@ -117,27 +114,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: UpdateDashboardPanelDataAttributesParamsLegend | Unset + legend: Unset | UpdateDashboardPanelDataAttributesParamsLegend if isinstance(_legend, Unset): legend = UNSET else: legend = UpdateDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: UpdateDashboardPanelDataAttributesParamsDatalabels | Unset + datalabels: Unset | UpdateDashboardPanelDataAttributesParamsDatalabels if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = UpdateDashboardPanelDataAttributesParamsDatalabels.from_dict(_datalabels) + datasets = [] _datasets = d.pop("datasets", UNSET) - datasets: list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET - if _datasets is not UNSET: - datasets = [] - for datasets_item_data in _datasets: - datasets_item = UpdateDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) + for datasets_item_data in _datasets or []: + datasets_item = UpdateDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) - datasets.append(datasets_item) + datasets.append(datasets_item) update_dashboard_panel_data_attributes_params = cls( display=display, diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py index 0c83750e..91983f14 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,10 +13,10 @@ class UpdateDashboardPanelDataAttributesParamsDatalabels: """ Attributes: - enabled (bool | Unset): + enabled (Union[Unset, bool]): """ - enabled: bool | Unset = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py index 49dd7014..0523caa2 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,18 +29,18 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItem: """ Attributes: - name (None | str | Unset): - collection (UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset): - filter_ (list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset): - group_by (None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): - aggregate (None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): + name (Union[None, Unset, str]): + collection (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection]): + filter_ (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem']]): + group_by (Union['UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0', None, Unset, str]): + aggregate (Union['UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0', None, Unset]): """ - name: None | str | Unset = UNSET - collection: UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset = UNSET - filter_: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - group_by: None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 = UNSET - aggregate: None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 = UNSET + name: None | Unset | str = UNSET + collection: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection = UNSET + filter_: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem"] = UNSET + group_by: Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET + aggregate: Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: None | str | Unset + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: str | Unset = UNSET + collection: Unset | str = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: list[dict[str, Any]] | Unset = UNSET + filter_: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: dict[str, Any] | None | str | Unset + group_by: None | Unset | dict[str, Any] | str if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: dict[str, Any] | None | Unset + aggregate: None | Unset | dict[str, Any] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -116,34 +114,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset + collection: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection if isinstance(_collection, Unset): collection = UNSET else: collection = check_update_dashboard_panel_data_attributes_params_datasets_item_collection(_collection) + filter_ = [] _filter_ = d.pop("filter", UNSET) - filter_: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - if _filter_ is not UNSET: - filter_ = [] - for filter_item_data in _filter_: - filter_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) + for filter_item_data in _filter_ or []: + filter_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) - filter_.append(filter_item) + filter_.append(filter_item) def _parse_group_by( data: object, - ) -> None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0: + ) -> Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str]: if data is None: return data if isinstance(data, Unset): @@ -156,17 +152,17 @@ def _parse_group_by( ) return group_by_type_1_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, data + Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str], data ) group_by = _parse_group_by(d.pop("group_by", UNSET)) def _parse_aggregate( data: object, - ) -> None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: + ) -> Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -177,9 +173,9 @@ def _parse_aggregate( aggregate_type_0 = UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0, data) + return cast(Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset], data) aggregate = _parse_aggregate(d.pop("aggregate", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py index 4b0c487d..2e1d3fbc 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,28 +17,28 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: """ Attributes: - operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset): - key (None | str | Unset): - cumulative (bool | None | Unset): + operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation]): + key (Union[None, Unset, str]): + cumulative (Union[None, Unset, bool]): """ - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset = UNSET - key: None | str | Unset = UNSET - cumulative: bool | None | Unset = UNSET + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = UNSET + key: None | Unset | str = UNSET + cumulative: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | str | Unset + key: None | Unset | str if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: bool | None | Unset + cumulative: None | Unset | bool if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation if isinstance(_operation, Unset): operation = UNSET else: @@ -70,21 +68,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> None | str | Unset: + def _parse_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> bool | None | Unset: + def _parse_cumulative(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py index bb4b5355..7c091524 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem: """ Attributes: - operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset): - rules (list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset): + operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation]): + rules (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): """ - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset = UNSET - rules: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = UNSET + rules: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: list[dict[str, Any]] | Unset = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -64,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation if isinstance(_operation, Unset): operation = UNSET else: @@ -72,16 +69,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( - rules_item_data - ) + for rules_item_data in _rules or []: + rules_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( + rules_item_data + ) - rules.append(rules_item) + rules.append(rules_item) update_dashboard_panel_data_attributes_params_datasets_item_filter_item = cls( operation=operation, diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py index 982897f3..eaaf8471 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,24 +21,24 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset): - condition (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset): - key (str | Unset): - value (str | Unset): + operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation]): + condition (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition]): + key (Union[Unset, str]): + value (Union[Unset, str]): """ - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET - condition: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET - key: str | Unset = UNSET - value: str | Unset = UNSET + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = UNSET + condition: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = UNSET + key: Unset | str = UNSET + value: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: str | Unset = UNSET + condition: Unset | str = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation if isinstance(_operation, Unset): operation = UNSET else: @@ -77,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset + condition: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py index b1641d09..aaaba96d 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py index d9afacec..24a0af4a 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,14 +17,14 @@ class UpdateDashboardPanelDataAttributesParamsLegend: """ Attributes: - groups (UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset): Default: 'all'. + groups (Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. """ - groups: UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset = "all" + groups: Unset | UpdateDashboardPanelDataAttributesParamsLegendGroups = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: str | Unset = UNSET + groups: Unset | str = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset + groups: Unset | UpdateDashboardPanelDataAttributesParamsLegendGroups if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py index 8ce15963..2118c2c0 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_datadog_notebook_task_params.py b/rootly_sdk/models/update_datadog_notebook_task_params.py index 267ccdbc..d67ddc1b 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,28 +26,27 @@ class UpdateDatadogNotebookTaskParams: """ Attributes: file_id (str): The Datadog notebook ID - task_type (UpdateDatadogNotebookTaskParamsTaskType | Unset): - title (str | Unset): The Datadog notebook title - content (str | Unset): The Datadog notebook content - kind (UpdateDatadogNotebookTaskParamsKind | Unset): The notebook type - post_mortem_template_id (str | Unset): Retrospective template to use when updating notebook, if desired - template (UpdateDatadogNotebookTaskParamsTemplate | Unset): The Datadog notebook template to use + task_type (Union[Unset, UpdateDatadogNotebookTaskParamsTaskType]): + title (Union[Unset, str]): The Datadog notebook title + content (Union[Unset, str]): The Datadog notebook content + kind (Union[Unset, UpdateDatadogNotebookTaskParamsKind]): The notebook type + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating notebook, if desired + template (Union[Unset, UpdateDatadogNotebookTaskParamsTemplate]): The Datadog notebook template to use """ file_id: str - task_type: UpdateDatadogNotebookTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - kind: UpdateDatadogNotebookTaskParamsKind | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template: UpdateDatadogNotebookTaskParamsTemplate | Unset = UNSET + task_type: Unset | UpdateDatadogNotebookTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + kind: Unset | UpdateDatadogNotebookTaskParamsKind = UNSET + post_mortem_template_id: Unset | str = UNSET + template: Union[Unset, "UpdateDatadogNotebookTaskParamsTemplate"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,13 +54,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind post_mortem_template_id = self.post_mortem_template_id - template: dict[str, Any] | Unset = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -97,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateDatadogNotebookTaskParamsTaskType | Unset + task_type: Unset | UpdateDatadogNotebookTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -108,7 +105,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _kind = d.pop("kind", UNSET) - kind: UpdateDatadogNotebookTaskParamsKind | Unset + kind: Unset | UpdateDatadogNotebookTaskParamsKind if isinstance(_kind, Unset): kind = UNSET else: @@ -117,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_mortem_template_id = d.pop("post_mortem_template_id", UNSET) _template = d.pop("template", UNSET) - template: UpdateDatadogNotebookTaskParamsTemplate | Unset + template: Unset | UpdateDatadogNotebookTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_datadog_notebook_task_params_template.py b/rootly_sdk/models/update_datadog_notebook_task_params_template.py index 7946ae4c..8b3f916d 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateDatadogNotebookTaskParamsTemplate: """The Datadog notebook template to use Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_dropbox_paper_page_task_params.py b/rootly_sdk/models/update_dropbox_paper_page_task_params.py index 9f31d59e..285ebb2c 100644 --- a/rootly_sdk/models/update_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/update_dropbox_paper_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,23 +18,23 @@ class UpdateDropboxPaperPageTaskParams: """ Attributes: file_id (str): The Dropbox Paper document ID - task_type (UpdateDropboxPaperPageTaskParamsTaskType | Unset): - title (str | Unset): The Dropbox Paper document title - content (str | Unset): The Dropbox Paper document content - post_mortem_template_id (str | Unset): Retrospective template to use when updating document, if desired + task_type (Union[Unset, UpdateDropboxPaperPageTaskParamsTaskType]): + title (Union[Unset, str]): The Dropbox Paper document title + content (Union[Unset, str]): The Dropbox Paper document content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating document, if desired """ file_id: str - task_type: UpdateDropboxPaperPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET + task_type: Unset | UpdateDropboxPaperPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateDropboxPaperPageTaskParamsTaskType | Unset + task_type: Unset | UpdateDropboxPaperPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector.py b/rootly_sdk/models/update_edge_connector.py index 34021a42..d3a49f74 100644 --- a/rootly_sdk/models/update_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEdgeConnector: edge_connector (UpdateEdgeConnectorEdgeConnector): """ - edge_connector: UpdateEdgeConnectorEdgeConnector + edge_connector: "UpdateEdgeConnectorEdgeConnector" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - edge_connector = self.edge_connector.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_edge_connector_action.py b/rootly_sdk/models/update_edge_connector_action.py index d616265c..03595dc3 100644 --- a/rootly_sdk/models/update_edge_connector_action.py +++ b/rootly_sdk/models/update_edge_connector_action.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEdgeConnectorAction: action (UpdateEdgeConnectorActionAction): """ - action: UpdateEdgeConnectorActionAction + action: "UpdateEdgeConnectorActionAction" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action = self.action.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_edge_connector_action_action.py b/rootly_sdk/models/update_edge_connector_action_action.py index 43276057..508ccc77 100644 --- a/rootly_sdk/models/update_edge_connector_action_action.py +++ b/rootly_sdk/models/update_edge_connector_action_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class UpdateEdgeConnectorActionAction: """ Attributes: - name (str | Unset): - action_type (UpdateEdgeConnectorActionActionActionType | Unset): - metadata (UpdateEdgeConnectorActionActionMetadata | Unset): + name (Union[Unset, str]): + action_type (Union[Unset, UpdateEdgeConnectorActionActionActionType]): + metadata (Union[Unset, UpdateEdgeConnectorActionActionMetadata]): """ - name: str | Unset = UNSET - action_type: UpdateEdgeConnectorActionActionActionType | Unset = UNSET - metadata: UpdateEdgeConnectorActionActionMetadata | Unset = UNSET + name: Unset | str = UNSET + action_type: Unset | UpdateEdgeConnectorActionActionActionType = UNSET + metadata: Union[Unset, "UpdateEdgeConnectorActionActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - action_type: str | Unset = UNSET + action_type: Unset | str = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _action_type = d.pop("action_type", UNSET) - action_type: UpdateEdgeConnectorActionActionActionType | Unset + action_type: Unset | UpdateEdgeConnectorActionActionActionType if isinstance(_action_type, Unset): action_type = UNSET else: action_type = check_update_edge_connector_action_action_action_type(_action_type) _metadata = d.pop("metadata", UNSET) - metadata: UpdateEdgeConnectorActionActionMetadata | Unset + metadata: Unset | UpdateEdgeConnectorActionActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_action_metadata.py b/rootly_sdk/models/update_edge_connector_action_action_metadata.py index b1551783..0f536a48 100644 --- a/rootly_sdk/models/update_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/update_edge_connector_action_action_metadata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateEdgeConnectorActionActionMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_edge_connector_action_body.py b/rootly_sdk/models/update_edge_connector_action_body.py index e6fff5ab..ab2138ac 100644 --- a/rootly_sdk/models/update_edge_connector_action_body.py +++ b/rootly_sdk/models/update_edge_connector_action_body.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class UpdateEdgeConnectorActionBody: """ Attributes: - action (UpdateEdgeConnectorActionBodyAction | Unset): + action (Union[Unset, UpdateEdgeConnectorActionBodyAction]): """ - action: UpdateEdgeConnectorActionBodyAction | Unset = UNSET + action: Union[Unset, "UpdateEdgeConnectorActionBodyAction"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - action: dict[str, Any] | Unset = UNSET + action: Unset | dict[str, Any] = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: UpdateEdgeConnectorActionBodyAction | Unset + action: Unset | UpdateEdgeConnectorActionBodyAction if isinstance(_action, Unset): action = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body_action.py b/rootly_sdk/models/update_edge_connector_action_body_action.py index e33acde0..5b27c01f 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class UpdateEdgeConnectorActionBodyAction: """ Attributes: - name (str | Unset): - action_type (UpdateEdgeConnectorActionBodyActionActionType | Unset): - metadata (UpdateEdgeConnectorActionBodyActionMetadata | Unset): + name (Union[Unset, str]): + action_type (Union[Unset, UpdateEdgeConnectorActionBodyActionActionType]): + metadata (Union[Unset, UpdateEdgeConnectorActionBodyActionMetadata]): """ - name: str | Unset = UNSET - action_type: UpdateEdgeConnectorActionBodyActionActionType | Unset = UNSET - metadata: UpdateEdgeConnectorActionBodyActionMetadata | Unset = UNSET + name: Unset | str = UNSET + action_type: Unset | UpdateEdgeConnectorActionBodyActionActionType = UNSET + metadata: Union[Unset, "UpdateEdgeConnectorActionBodyActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - action_type: str | Unset = UNSET + action_type: Unset | str = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -67,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _action_type = d.pop("action_type", UNSET) - action_type: UpdateEdgeConnectorActionBodyActionActionType | Unset + action_type: Unset | UpdateEdgeConnectorActionBodyActionActionType if isinstance(_action_type, Unset): action_type = UNSET else: action_type = check_update_edge_connector_action_body_action_action_type(_action_type) _metadata = d.pop("metadata", UNSET) - metadata: UpdateEdgeConnectorActionBodyActionMetadata | Unset + metadata: Unset | UpdateEdgeConnectorActionBodyActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py b/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py index 091eb2e7..507c8764 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateEdgeConnectorActionBodyActionMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_edge_connector_body.py b/rootly_sdk/models/update_edge_connector_body.py index 43596b1b..996b1d4d 100644 --- a/rootly_sdk/models/update_edge_connector_body.py +++ b/rootly_sdk/models/update_edge_connector_body.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class UpdateEdgeConnectorBody: """ Attributes: - data (UpdateEdgeConnectorBodyData | Unset): + data (Union[Unset, UpdateEdgeConnectorBodyData]): """ - data: UpdateEdgeConnectorBodyData | Unset = UNSET + data: Union[Unset, "UpdateEdgeConnectorBodyData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: UpdateEdgeConnectorBodyData | Unset + data: Unset | UpdateEdgeConnectorBodyData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data.py b/rootly_sdk/models/update_edge_connector_body_data.py index 22b5eb6c..7e203ba0 100644 --- a/rootly_sdk/models/update_edge_connector_body_data.py +++ b/rootly_sdk/models/update_edge_connector_body_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class UpdateEdgeConnectorBodyData: """ Attributes: - type_ (UpdateEdgeConnectorBodyDataType | Unset): - id (str | Unset): - attributes (UpdateEdgeConnectorBodyDataAttributes | Unset): + type_ (Union[Unset, UpdateEdgeConnectorBodyDataType]): + id (Union[Unset, str]): + attributes (Union[Unset, UpdateEdgeConnectorBodyDataAttributes]): """ - type_: UpdateEdgeConnectorBodyDataType | Unset = UNSET - id: str | Unset = UNSET - attributes: UpdateEdgeConnectorBodyDataAttributes | Unset = UNSET + type_: Unset | UpdateEdgeConnectorBodyDataType = UNSET + id: Unset | str = UNSET + attributes: Union[Unset, "UpdateEdgeConnectorBodyDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ id = self.id - attributes: dict[str, Any] | Unset = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -63,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: UpdateEdgeConnectorBodyDataType | Unset + type_: Unset | UpdateEdgeConnectorBodyDataType if isinstance(_type_, Unset): type_ = UNSET else: @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: UpdateEdgeConnectorBodyDataAttributes | Unset + attributes: Unset | UpdateEdgeConnectorBodyDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data_attributes.py b/rootly_sdk/models/update_edge_connector_body_data_attributes.py index 6324907b..abde96dc 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,35 +21,34 @@ class UpdateEdgeConnectorBodyDataAttributes: """ Attributes: - name (str | Unset): - description (str | Unset): - status (UpdateEdgeConnectorBodyDataAttributesStatus | Unset): - subscriptions (list[str] | Unset): - filters (UpdateEdgeConnectorBodyDataAttributesFilters | Unset): Event filters + name (Union[Unset, str]): + description (Union[Unset, str]): + status (Union[Unset, UpdateEdgeConnectorBodyDataAttributesStatus]): + subscriptions (Union[Unset, list[str]]): + filters (Union[Unset, UpdateEdgeConnectorBodyDataAttributesFilters]): Event filters """ - name: str | Unset = UNSET - description: str | Unset = UNSET - status: UpdateEdgeConnectorBodyDataAttributesStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET - filters: UpdateEdgeConnectorBodyDataAttributesFilters | Unset = UNSET + name: Unset | str = UNSET + description: Unset | str = UNSET + status: Unset | UpdateEdgeConnectorBodyDataAttributesStatus = UNSET + subscriptions: Unset | list[str] = UNSET + filters: Union[Unset, "UpdateEdgeConnectorBodyDataAttributesFilters"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name description = self.description - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: dict[str, Any] | Unset = UNSET + filters: Unset | dict[str, Any] = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -83,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: UpdateEdgeConnectorBodyDataAttributesStatus | Unset + status: Unset | UpdateEdgeConnectorBodyDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: @@ -92,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) _filters = d.pop("filters", UNSET) - filters: UpdateEdgeConnectorBodyDataAttributesFilters | Unset + filters: Unset | UpdateEdgeConnectorBodyDataAttributesFilters if isinstance(_filters, Unset): filters = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py b/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py index c6da5ea2..dc0a35cc 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateEdgeConnectorBodyDataAttributesFilters: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_edge_connector_edge_connector.py b/rootly_sdk/models/update_edge_connector_edge_connector.py index a2accd57..3bbc9ead 100644 --- a/rootly_sdk/models/update_edge_connector_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector_edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,16 +17,16 @@ class UpdateEdgeConnectorEdgeConnector: """ Attributes: - name (str | Unset): - description (str | Unset): - status (UpdateEdgeConnectorEdgeConnectorStatus | Unset): - subscriptions (list[str] | Unset): + name (Union[Unset, str]): + description (Union[Unset, str]): + status (Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus]): + subscriptions (Union[Unset, list[str]]): """ - name: str | Unset = UNSET - description: str | Unset = UNSET - status: UpdateEdgeConnectorEdgeConnectorStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET + name: Unset | str = UNSET + description: Unset | str = UNSET + status: Unset | UpdateEdgeConnectorEdgeConnectorStatus = UNSET + subscriptions: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,11 +34,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: UpdateEdgeConnectorEdgeConnectorStatus | Unset + status: Unset | UpdateEdgeConnectorEdgeConnectorStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_environment.py b/rootly_sdk/models/update_environment.py index 4983b3f5..0af13434 100644 --- a/rootly_sdk/models/update_environment.py +++ b/rootly_sdk/models/update_environment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEnvironment: data (UpdateEnvironmentData): """ - data: UpdateEnvironmentData + data: "UpdateEnvironmentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_environment_data.py b/rootly_sdk/models/update_environment_data.py index 340dd50b..bb7f5c09 100644 --- a/rootly_sdk/models/update_environment_data.py +++ b/rootly_sdk/models/update_environment_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateEnvironmentData: """ type_: UpdateEnvironmentDataType - attributes: UpdateEnvironmentDataAttributes + attributes: "UpdateEnvironmentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_environment_data_attributes.py b/rootly_sdk/models/update_environment_data_attributes.py index f7e478fd..5964309a 100644 --- a/rootly_sdk/models/update_environment_data_attributes.py +++ b/rootly_sdk/models/update_environment_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -26,59 +24,75 @@ class UpdateEnvironmentDataAttributes: """ Attributes: - name (str | Unset): The name of the environment - description (None | str | Unset): The description of the environment - color (None | str | Unset): The hex color of the environment - position (int | None | Unset): Position of the environment - external_id (None | str | Unset): The external id associated to this environment - notify_emails (list[str] | None | Unset): Emails to attach to the environment - slack_channels (list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this environment - slack_aliases (list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the environment + description (Union[None, Unset, str]): The description of the environment + public_description (Union[None, Unset, str]): The status page description of the environment + color (Union[None, Unset, str]): The hex color of the environment + position (Union[None, Unset, int]): Position of the environment + external_id (Union[None, Unset, str]): The external id associated to this environment + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the environment + slack_channels (Union[None, Unset, list['UpdateEnvironmentDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this environment + slack_aliases (Union[None, Unset, list['UpdateEnvironmentDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this environment - properties (list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset): Array of property values for this - environment. + properties (Union[Unset, list['UpdateEnvironmentDataAttributesPropertiesItem']]): Array of property values for + this environment. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["UpdateEnvironmentDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -87,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -99,7 +113,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -111,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -121,10 +135,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -155,45 +173,64 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -204,15 +241,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -230,15 +267,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -256,24 +293,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_environment_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, color=color, position=position, external_id=external_id, diff --git a/rootly_sdk/models/update_environment_data_attributes_properties_item.py b/rootly_sdk/models/update_environment_data_attributes_properties_item.py index 555c7a02..c1cc04b9 100644 --- a/rootly_sdk/models/update_environment_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py index fdc4f9b2..cfadccf4 100644 --- a/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py index 98c9e895..ae4c9d1a 100644 --- a/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy.py b/rootly_sdk/models/update_escalation_policy.py index 9dc8393d..d64a1ba0 100644 --- a/rootly_sdk/models/update_escalation_policy.py +++ b/rootly_sdk/models/update_escalation_policy.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEscalationPolicy: data (UpdateEscalationPolicyData): """ - data: UpdateEscalationPolicyData + data: "UpdateEscalationPolicyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_escalation_policy_data.py b/rootly_sdk/models/update_escalation_policy_data.py index 68a98a8b..69dcce30 100644 --- a/rootly_sdk/models/update_escalation_policy_data.py +++ b/rootly_sdk/models/update_escalation_policy_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateEscalationPolicyData: """ type_: UpdateEscalationPolicyDataType - attributes: UpdateEscalationPolicyDataAttributes + attributes: "UpdateEscalationPolicyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes.py b/rootly_sdk/models/update_escalation_policy_data_attributes.py index 9cf51994..aad07d04 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,21 +18,21 @@ class UpdateEscalationPolicyDataAttributes: """ Attributes: - name (str | Unset): The name of the escalation policy - description (None | str | Unset): The description of the escalation policy - repeat_count (int | Unset): The number of times this policy will be executed until someone acknowledges the - alert - group_ids (list[str] | Unset): Associated groups (alerting the group will trigger escalation policy) - service_ids (list[str] | Unset): Associated services (alerting the service will trigger escalation policy) - business_hours (None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0): + name (Union[Unset, str]): The name of the escalation policy + description (Union[None, Unset, str]): The description of the escalation policy + repeat_count (Union[Unset, int]): The number of times this policy will be executed until someone acknowledges + the alert + group_ids (Union[Unset, list[str]]): Associated groups (alerting the group will trigger escalation policy) + service_ids (Union[Unset, list[str]]): Associated services (alerting the service will trigger escalation policy) + business_hours (Union['UpdateEscalationPolicyDataAttributesBusinessHoursType0', None, Unset]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - repeat_count: int | Unset = UNSET - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - business_hours: None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0 = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + repeat_count: Unset | int = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + business_hours: Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_data_attributes_business_hours_type_0 import ( @@ -43,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -51,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: dict[str, Any] | None | Unset + business_hours: None | Unset | dict[str, Any] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, UpdateEscalationPolicyDataAttributesBusinessHoursType0): @@ -94,12 +92,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -111,7 +109,7 @@ def _parse_description(data: object) -> None | str | Unset: def _parse_business_hours( data: object, - ) -> None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0: + ) -> Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -122,9 +120,9 @@ def _parse_business_hours( business_hours_type_0 = UpdateEscalationPolicyDataAttributesBusinessHoursType0.from_dict(data) return business_hours_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0, data) + return cast(Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset], data) business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py index 08e773d8..49ec4302 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,24 +21,26 @@ class UpdateEscalationPolicyDataAttributesBusinessHoursType0: """ Attributes: - time_zone (UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset): Time zone for business hours - days (list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset): Business days - start_time (None | str | Unset): Start time for business hours (HH:MM) - end_time (None | str | Unset): End time for business hours (HH:MM) + time_zone (Union[Unset, UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone]): Time zone for business + hours + days (Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]): Business + days + start_time (Union[None, Unset, str]): Start time for business hours (HH:MM) + end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset = UNSET - days: list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset = UNSET - start_time: None | str | Unset = UNSET - end_time: None | str | Unset = UNSET + time_zone: Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone = UNSET + days: None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] = UNSET + start_time: None | Unset | str = UNSET + end_time: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: str | Unset = UNSET + time_zone: Unset | str = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: list[str] | None | Unset + days: None | Unset | list[str] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +52,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | str | Unset + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | str | Unset + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset + time_zone: Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -90,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset: + ) -> None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]: if data is None: return data if isinstance(data, Unset): @@ -110,27 +110,27 @@ def _parse_days( days_type_0.append(days_type_0_item) return days_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset, data) + return cast(None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | str | Unset: + def _parse_start_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | str | Unset: + def _parse_end_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_level.py b/rootly_sdk/models/update_escalation_policy_level.py index dc0a48ed..4d915225 100644 --- a/rootly_sdk/models/update_escalation_policy_level.py +++ b/rootly_sdk/models/update_escalation_policy_level.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEscalationPolicyLevel: data (UpdateEscalationPolicyLevelData): """ - data: UpdateEscalationPolicyLevelData + data: "UpdateEscalationPolicyLevelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_escalation_policy_level_data.py b/rootly_sdk/models/update_escalation_policy_level_data.py index f6369f8e..93386fa0 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data.py +++ b/rootly_sdk/models/update_escalation_policy_level_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateEscalationPolicyLevelData: """ type_: UpdateEscalationPolicyLevelDataType - attributes: UpdateEscalationPolicyLevelDataAttributes + attributes: "UpdateEscalationPolicyLevelDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py index b19e19b3..3fdb235e 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py @@ -1,10 +1,16 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define +from ..models.update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode, +) +from ..models.update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope, +) from ..models.update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy, @@ -28,31 +34,49 @@ class UpdateEscalationPolicyLevelDataAttributes: """ Attributes: - delay (int | Unset): Delay before notifying targets in the next Escalation Level. - position (int | Unset): Position of the escalation policy level - escalation_policy_path_id (None | str | Unset): The ID of the dynamic escalation policy path the level will + delay (Union[Unset, int]): Delay before notifying targets in the next Escalation Level. + position (Union[Unset, int]): Position of the escalation policy level + escalation_policy_path_id (Union[None, Unset, str]): The ID of the dynamic escalation policy path the level will belong to. If nothing is specified it will add the level to your default path. - paging_strategy_configuration_strategy - (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset): Default: 'default'. - paging_strategy_configuration_schedule_strategy - (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset): Default: + paging_strategy_configuration_strategy (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy]): Default: 'default'. + paging_strategy_configuration_schedule_strategy (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy]): Default: 'on_call_only'. - notification_target_params (list[None | - UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset): Escalation level's - notification targets + paging_strategy_configuration_repeats (Union[None, Unset, int]): Number of times to rotate through the roster + (cycle-based round robin). + paging_strategy_configuration_repeats_mode (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode]): Controls how repeats are + interpreted: 'users' pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope]): Scope of rotation ordering: + active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (Union[None, Unset, int]): Number of users to page at a time + (cycle-based round robin). + notification_target_params (Union[Unset, + list[Union['UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0', None]]]): Escalation + level's notification targets """ - delay: int | Unset = UNSET - position: int | Unset = UNSET - escalation_policy_path_id: None | str | Unset = UNSET + delay: Unset | int = UNSET + position: Unset | int = UNSET + escalation_policy_path_id: None | Unset | str = UNSET paging_strategy_configuration_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy ) = "default" paging_strategy_configuration_schedule_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy ) = "on_call_only" + paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats_mode: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) = UNSET + paging_strategy_configuration_rotation_scope: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) = UNSET + paging_strategy_configuration_page_users_count: None | Unset | int = UNSET notification_target_params: ( - list[None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset + Unset | list[Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]] ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -64,25 +88,45 @@ def to_dict(self) -> dict[str, Any]: position = self.position - escalation_policy_path_id: None | str | Unset + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - paging_strategy_configuration_strategy: str | Unset = UNSET + paging_strategy_configuration_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: str | Unset = UNSET + paging_strategy_configuration_schedule_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - notification_target_params: list[dict[str, Any] | None] | Unset = UNSET + paging_strategy_configuration_repeats: None | Unset | int + if isinstance(self.paging_strategy_configuration_repeats, Unset): + paging_strategy_configuration_repeats = UNSET + else: + paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats + + paging_strategy_configuration_repeats_mode: Unset | str = UNSET + if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode + + paging_strategy_configuration_rotation_scope: Unset | str = UNSET + if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope + + paging_strategy_configuration_page_users_count: None | Unset | int + if isinstance(self.paging_strategy_configuration_page_users_count, Unset): + paging_strategy_configuration_page_users_count = UNSET + else: + paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count + + notification_target_params: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.notification_target_params, Unset): notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: dict[str, Any] | None + notification_target_params_item: None | dict[str, Any] if isinstance( notification_target_params_item_data, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -107,6 +151,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["paging_strategy_configuration_schedule_strategy"] = ( paging_strategy_configuration_schedule_strategy ) + if paging_strategy_configuration_repeats is not UNSET: + field_dict["paging_strategy_configuration_repeats"] = paging_strategy_configuration_repeats + if paging_strategy_configuration_repeats_mode is not UNSET: + field_dict["paging_strategy_configuration_repeats_mode"] = paging_strategy_configuration_repeats_mode + if paging_strategy_configuration_rotation_scope is not UNSET: + field_dict["paging_strategy_configuration_rotation_scope"] = paging_strategy_configuration_rotation_scope + if paging_strategy_configuration_page_users_count is not UNSET: + field_dict["paging_strategy_configuration_page_users_count"] = ( + paging_strategy_configuration_page_users_count + ) if notification_target_params is not UNSET: field_dict["notification_target_params"] = notification_target_params @@ -123,18 +177,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) paging_strategy_configuration_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy ) if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET @@ -149,7 +203,7 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: "paging_strategy_configuration_schedule_strategy", UNSET ) paging_strategy_configuration_schedule_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET @@ -160,36 +214,82 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: ) ) + def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( + d.pop("paging_strategy_configuration_repeats", UNSET) + ) + + _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) + paging_strategy_configuration_repeats_mode: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) + if isinstance(_paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = UNSET + else: + paging_strategy_configuration_repeats_mode = ( + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + _paging_strategy_configuration_repeats_mode + ) + ) + + _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) + paging_strategy_configuration_rotation_scope: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) + if isinstance(_paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = UNSET + else: + paging_strategy_configuration_rotation_scope = ( + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + _paging_strategy_configuration_rotation_scope + ) + ) + + def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( + d.pop("paging_strategy_configuration_page_users_count", UNSET) + ) + + notification_target_params = [] _notification_target_params = d.pop("notification_target_params", UNSET) - notification_target_params: ( - list[None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset - ) = UNSET - if _notification_target_params is not UNSET: - notification_target_params = [] - for notification_target_params_item_data in _notification_target_params: - - def _parse_notification_target_params_item( - data: object, - ) -> None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - notification_target_params_item_type_0 = ( - UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0.from_dict(data) - ) - - return notification_target_params_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, data) - - notification_target_params_item = _parse_notification_target_params_item( - notification_target_params_item_data + for notification_target_params_item_data in _notification_target_params or []: + + def _parse_notification_target_params_item( + data: object, + ) -> Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + notification_target_params_item_type_0 = ( + UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0.from_dict(data) + ) + + return notification_target_params_item_type_0 + except: # noqa: E722 + pass + return cast( + Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None], data ) - notification_target_params.append(notification_target_params_item) + notification_target_params_item = _parse_notification_target_params_item( + notification_target_params_item_data + ) + + notification_target_params.append(notification_target_params_item) update_escalation_policy_level_data_attributes = cls( delay=delay, @@ -197,6 +297,10 @@ def _parse_notification_target_params_item( escalation_policy_path_id=escalation_policy_path_id, paging_strategy_configuration_strategy=paging_strategy_configuration_strategy, paging_strategy_configuration_schedule_strategy=paging_strategy_configuration_schedule_strategy, + paging_strategy_configuration_repeats=paging_strategy_configuration_repeats, + paging_strategy_configuration_repeats_mode=paging_strategy_configuration_repeats_mode, + paging_strategy_configuration_rotation_scope=paging_strategy_configuration_rotation_scope, + paging_strategy_configuration_page_users_count=paging_strategy_configuration_page_users_count, notification_target_params=notification_target_params, ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py index 79fdffe0..f9f312b1 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -26,13 +24,14 @@ class UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 id (str): The ID of notification target type_ (UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type): The type of the notification target - team_members (UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset): - For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. + team_members (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers]): For targets with + type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset = UNSET + team_members: Unset | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: str | Unset = UNSET + team_members: Unset | str = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -67,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset + team_members: Unset | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py new file mode 100644 index 00000000..f2624ee7 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] + +UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: set[ + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode +] = { + "all", + "users", +} + + +def check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + value: str | None, +) -> UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: + return cast(UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py new file mode 100644 index 00000000..545a7600 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py @@ -0,0 +1,24 @@ +from typing import Literal, cast + +UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope = Literal[ + "active_rotation", "entire_schedule" +] + +UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: set[ + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope +] = { + "active_rotation", + "entire_schedule", +} + + +def check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + value: str | None, +) -> UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: + return cast(UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path.py b/rootly_sdk/models/update_escalation_policy_path.py index b489235a..7eb93c3a 100644 --- a/rootly_sdk/models/update_escalation_policy_path.py +++ b/rootly_sdk/models/update_escalation_policy_path.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEscalationPolicyPath: data (UpdateEscalationPolicyPathData): """ - data: UpdateEscalationPolicyPathData + data: "UpdateEscalationPolicyPathData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_escalation_policy_path_data.py b/rootly_sdk/models/update_escalation_policy_path_data.py index 99b43f08..b207fa28 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data.py +++ b/rootly_sdk/models/update_escalation_policy_path_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateEscalationPolicyPathData: """ type_: UpdateEscalationPolicyPathDataType - attributes: UpdateEscalationPolicyPathDataAttributes + attributes: "UpdateEscalationPolicyPathDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py index a88712c9..d5c61ae4 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -112,94 +110,101 @@ class UpdateEscalationPolicyPathDataAttributes: """ Attributes: - name (str | Unset): The name of the escalation path - notification_type (UpdateEscalationPolicyPathDataAttributesNotificationType | Unset): Position of the escalation - policy level Default: 'audible'. - path_type (UpdateEscalationPolicyPathDataAttributesPathType | Unset): The type of escalation path. Cannot be - changed after creation. - after_deferral_behavior (UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset): What happens - after a deferral path finishes. - after_deferral_path_id (None | str | Unset): The escalation path to execute after this deferral path when + name (Union[Unset, str]): The name of the escalation path + notification_type (Union[Unset, UpdateEscalationPolicyPathDataAttributesNotificationType]): Position of the + escalation policy level Default: 'audible'. + path_type (Union[Unset, UpdateEscalationPolicyPathDataAttributesPathType]): The type of escalation path. Cannot + be changed after creation. + after_deferral_behavior (Union[Unset, UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior]): What + happens after a deferral path finishes. + after_deferral_path_id (Union[None, Unset, str]): The escalation path to execute after this deferral path when after_deferral_behavior is execute_path. - default (bool | None | Unset): Whether this escalation path is the default path - match_mode (UpdateEscalationPolicyPathDataAttributesMatchMode | Unset): How path rules are matched. Default: - 'match-all-rules'. - position (int | Unset): The position of this path in the paths for this EP. - repeat (bool | None | Unset): Whether this path should be repeated until someone acknowledges the alert - repeat_count (int | None | Unset): The number of times this path will be executed until someone acknowledges the - alert - initial_delay (int | Unset): Initial delay for escalation path in minutes. Maximum 1 week (10080). - rules (list[UpdateEscalationPolicyPathDataAttributesRulesItemType0 | - UpdateEscalationPolicyPathDataAttributesRulesItemType1 | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 | - UpdateEscalationPolicyPathDataAttributesRulesItemType4 | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 | - UpdateEscalationPolicyPathDataAttributesRulesItemType7 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7] | Unset): Escalation path conditions - time_restriction_time_zone (UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset): Time zone - used for time restrictions. - time_restrictions (list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset): If time + default (Union[None, Unset, bool]): Whether this escalation path is the default path + match_mode (Union[Unset, UpdateEscalationPolicyPathDataAttributesMatchMode]): How path rules are matched. + Default: 'match-all-rules'. + position (Union[Unset, int]): The position of this path in the paths for this EP. + repeat (Union[None, Unset, bool]): Whether this path should be repeated until someone acknowledges the alert + repeat_count (Union[None, Unset, int]): The number of times this path will be executed until someone + acknowledges the alert + initial_delay (Union[Unset, int]): Initial delay for escalation path in minutes. Maximum 1 week (10080). + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts on this path after N + minutes; null inherits the urgency/workspace default, negative = never. + rules (Union[Unset, list[Union['UpdateEscalationPolicyPathDataAttributesRulesItemType0', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType1', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType2', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType3', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType4', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType5', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType6', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType7', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7']]]): Escalation path conditions + time_restriction_time_zone (Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone]): Time + zone used for time restrictions. + time_restrictions (Union[Unset, list['UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem']]): If time restrictions are set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ - name: str | Unset = UNSET - notification_type: UpdateEscalationPolicyPathDataAttributesNotificationType | Unset = "audible" - path_type: UpdateEscalationPolicyPathDataAttributesPathType | Unset = UNSET - after_deferral_behavior: UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset = UNSET - after_deferral_path_id: None | str | Unset = UNSET - default: bool | None | Unset = UNSET - match_mode: UpdateEscalationPolicyPathDataAttributesMatchMode | Unset = "match-all-rules" - position: int | Unset = UNSET - repeat: bool | None | Unset = UNSET - repeat_count: int | None | Unset = UNSET - initial_delay: int | Unset = UNSET + name: Unset | str = UNSET + notification_type: Unset | UpdateEscalationPolicyPathDataAttributesNotificationType = "audible" + path_type: Unset | UpdateEscalationPolicyPathDataAttributesPathType = UNSET + after_deferral_behavior: Unset | UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior = UNSET + after_deferral_path_id: None | Unset | str = UNSET + default: None | Unset | bool = UNSET + match_mode: Unset | UpdateEscalationPolicyPathDataAttributesMatchMode = "match-all-rules" + position: Unset | int = UNSET + repeat: None | Unset | bool = UNSET + repeat_count: None | Unset | int = UNSET + initial_delay: Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET rules: ( - list[ - UpdateEscalationPolicyPathDataAttributesRulesItemType0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7 + Unset + | list[ + Union[ + "UpdateEscalationPolicyPathDataAttributesRulesItemType0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7", + ] ] - | Unset ) = UNSET - time_restriction_time_zone: UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset = UNSET - time_restrictions: list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET + time_restriction_time_zone: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = UNSET + time_restrictions: Unset | list["UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_path_data_attributes_rules_item_type_0 import ( @@ -274,43 +279,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - notification_type: str | Unset = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: str | Unset = UNSET + path_type: Unset | str = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: str | Unset = UNSET + after_deferral_behavior: Unset | str = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | str | Unset + after_deferral_path_id: None | Unset | str if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: bool | None | Unset + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: str | Unset = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: bool | None | Unset + repeat: None | Unset | bool if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: int | None | Unset + repeat_count: None | Unset | int if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -318,7 +323,13 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - rules: list[dict[str, Any]] | Unset = UNSET + retrigger_timeout_minutes: None | Unset | int + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -374,11 +385,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: str | Unset = UNSET + time_restriction_time_zone: Unset | str = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: list[dict[str, Any]] | Unset = UNSET + time_restrictions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -410,6 +421,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_count"] = repeat_count if initial_delay is not UNSET: field_dict["initial_delay"] = initial_delay + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if rules is not UNSET: field_dict["rules"] = rules if time_restriction_time_zone is not UNSET: @@ -501,7 +514,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _notification_type = d.pop("notification_type", UNSET) - notification_type: UpdateEscalationPolicyPathDataAttributesNotificationType | Unset + notification_type: Unset | UpdateEscalationPolicyPathDataAttributesNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: @@ -510,14 +523,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _path_type = d.pop("path_type", UNSET) - path_type: UpdateEscalationPolicyPathDataAttributesPathType | Unset + path_type: Unset | UpdateEscalationPolicyPathDataAttributesPathType if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_update_escalation_policy_path_data_attributes_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset + after_deferral_behavior: Unset | UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -525,26 +538,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _after_deferral_behavior ) - def _parse_after_deferral_path_id(data: object) -> None | str | Unset: + def _parse_after_deferral_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: UpdateEscalationPolicyPathDataAttributesMatchMode | Unset + match_mode: Unset | UpdateEscalationPolicyPathDataAttributesMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -552,316 +565,293 @@ def _parse_default(data: object) -> bool | None | Unset: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> bool | None | Unset: + def _parse_repeat(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> int | None | Unset: + def _parse_repeat_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) repeat_count = _parse_repeat_count(d.pop("repeat_count", UNSET)) initial_delay = d.pop("initial_delay", UNSET) + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | int, data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + + rules = [] _rules = d.pop("rules", UNSET) - rules: ( - list[ - UpdateEscalationPolicyPathDataAttributesRulesItemType0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7 - ] - | Unset - ) = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - - def _parse_rules_item( - data: object, - ) -> ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7 - ): - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - - return rules_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) - - return rules_item_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) - - return rules_item_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) - - return rules_item_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) - - return rules_item_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) - - return rules_item_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) - - return rules_item_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) - - return rules_item_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_0 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0.from_dict(data) - ) - - return rules_item_type_8_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_1 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1.from_dict(data) - ) - - return rules_item_type_8_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_2 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2.from_dict(data) - ) - - return rules_item_type_8_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_3 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3.from_dict(data) - ) - - return rules_item_type_8_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_4 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4.from_dict(data) - ) - - return rules_item_type_8_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_5 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5.from_dict(data) - ) - - return rules_item_type_8_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_6 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6.from_dict(data) - ) - - return rules_item_type_8_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_7 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7.from_dict(data) - ) - - return rules_item_type_8_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_0 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0.from_dict(data) - ) - - return rules_item_type_9_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_1 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1.from_dict(data) - ) - - return rules_item_type_9_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_2 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2.from_dict(data) - ) - - return rules_item_type_9_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_3 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3.from_dict(data) - ) - - return rules_item_type_9_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_4 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4.from_dict(data) - ) - - return rules_item_type_9_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_5 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5.from_dict(data) - ) - - return rules_item_type_9_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_6 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6.from_dict(data) - ) - - return rules_item_type_9_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass + for rules_item_data in _rules or []: + + def _parse_rules_item( + data: object, + ) -> Union[ + "UpdateEscalationPolicyPathDataAttributesRulesItemType0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7", + ]: + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) + + return rules_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) + + return rules_item_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) + + return rules_item_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) + + return rules_item_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) + + return rules_item_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) + + return rules_item_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) + + return rules_item_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) + + return rules_item_type_7 + except: # noqa: E722 + pass + try: if not isinstance(data, dict): raise TypeError() - rules_item_type_9_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7.from_dict( + rules_item_type_8_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0.from_dict( data ) - return rules_item_type_9_type_7 + return rules_item_type_8_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1.from_dict( + data + ) + + return rules_item_type_8_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2.from_dict( + data + ) - rules_item = _parse_rules_item(rules_item_data) + return rules_item_type_8_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3.from_dict( + data + ) - rules.append(rules_item) + return rules_item_type_8_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4.from_dict( + data + ) + + return rules_item_type_8_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5.from_dict( + data + ) + + return rules_item_type_8_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6.from_dict( + data + ) + + return rules_item_type_8_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7.from_dict( + data + ) + + return rules_item_type_8_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0.from_dict( + data + ) + + return rules_item_type_9_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1.from_dict( + data + ) + + return rules_item_type_9_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2.from_dict( + data + ) + + return rules_item_type_9_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3.from_dict( + data + ) + + return rules_item_type_9_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4.from_dict( + data + ) + + return rules_item_type_9_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5.from_dict( + data + ) + + return rules_item_type_9_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6.from_dict( + data + ) + + return rules_item_type_9_type_6 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7.from_dict(data) + + return rules_item_type_9_type_7 + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset + time_restriction_time_zone: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -869,16 +859,14 @@ def _parse_rules_item( _time_restriction_time_zone ) + time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - time_restrictions: list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET - if _time_restrictions is not UNSET: - time_restrictions = [] - for time_restrictions_item_data in _time_restrictions: - time_restrictions_item = UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( - time_restrictions_item_data - ) + for time_restrictions_item_data in _time_restrictions or []: + time_restrictions_item = UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( + time_restrictions_item_data + ) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) update_escalation_policy_path_data_attributes = cls( name=name, @@ -892,6 +880,7 @@ def _parse_rules_item( repeat=repeat, repeat_count=repeat_count, initial_delay=initial_delay, + retrigger_timeout_minutes=retrigger_timeout_minutes, rules=rules, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py index 43536fa1..91fcac99 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py index 67efc6ac..b8a8ef1d 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py index a3f2a0e2..0f849085 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,15 +24,15 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType2: rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_update_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py index d654ba4a..0b645f2f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,14 +26,14 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType3: fieldable_id (str): The ID of the alert field operator (UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py index 8e47f315..41b5d14a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py index 34bfdabe..1f1da033 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType5: Attributes: rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType): The type of the escalation path rule time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone): Time zone for the deferral window - time_blocks (list[UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem]): Time windows during + time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone - time_blocks: list[UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem] + time_blocks: list["UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py index d79f3ac7..1bc78b6f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py index d543a1ff..764b5182 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py index 67122596..a394755a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py index 4e875168..15ecf4f7 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py index fefcf0cb..67f10e0c 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py index 5548d7ad..d3282b15 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,15 +26,15 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2: json_path (str): JSON path to extract value from payload operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("operator") ) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py index 7c490b36..9d1030c3 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -29,14 +27,14 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3: fieldable_id (str): The ID of the alert field operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py index 9ea1d8cf..3915505f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py index e8d1eb48..d2b190a0 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,17 +30,16 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5: rule time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone): Time zone for the deferral window - time_blocks (list[UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem]): Time windows + time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone - time_blocks: list[UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem] + time_blocks: list["UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py index b90ababd..0e8296e6 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py index 5c3b2c9a..de81d342 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py index b5143c9d..9d4a69b4 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py index 3d985253..23817a6a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py index a54b05f8..0ffe6200 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py index e630006f..50ab7788 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,15 +26,15 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2: json_path (str): JSON path to extract value from payload operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("operator") ) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py index 74fc9476..ef4214fe 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -29,14 +27,14 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3: fieldable_id (str): The ID of the alert field operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py index d9250bc1..0f5a8320 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py index 6d07b9a8..ffdf6426 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,17 +30,16 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5: rule time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone): Time zone for the deferral window - time_blocks (list[UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem]): Time windows + time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone - time_blocks: list[UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem] + time_blocks: list["UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py index 31a4c90f..615fb586 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +13,30 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py index 068ee32b..8e63d912 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py index 006cb474..b45ee2eb 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py index a53f78dd..e729e6f7 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -23,26 +21,26 @@ class UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem: """ Attributes: - start_day (UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset): - start_time (str | Unset): Formatted as HH:MM - end_day (UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset): - end_time (str | Unset): Formatted as HH:MM + start_day (Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay]): + start_time (Union[Unset, str]): Formatted as HH:MM + end_day (Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay]): + end_time (Union[Unset, str]): Formatted as HH:MM """ - start_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset = UNSET - start_time: str | Unset = UNSET - end_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset = UNSET - end_time: str | Unset = UNSET + start_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay = UNSET + start_time: Unset | str = UNSET + end_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: str | Unset = UNSET + start_day: Unset | str = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: str | Unset = UNSET + end_day: Unset | str = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_day = d.pop("start_day", UNSET) - start_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset + start_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay if isinstance(_start_day, Unset): start_day = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_time = d.pop("start_time", UNSET) _end_day = d.pop("end_day", UNSET) - end_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset + end_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/update_form_field.py b/rootly_sdk/models/update_form_field.py index b525084e..0d06144e 100644 --- a/rootly_sdk/models/update_form_field.py +++ b/rootly_sdk/models/update_form_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormField: data (UpdateFormFieldData): """ - data: UpdateFormFieldData + data: "UpdateFormFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_data.py b/rootly_sdk/models/update_form_field_data.py index 2a189305..e404f75d 100644 --- a/rootly_sdk/models/update_form_field_data.py +++ b/rootly_sdk/models/update_form_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateFormFieldData: """ type_: UpdateFormFieldDataType - attributes: UpdateFormFieldDataAttributes + attributes: "UpdateFormFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_data_attributes.py b/rootly_sdk/models/update_form_field_data_attributes.py index b35324bf..055611ae 100644 --- a/rootly_sdk/models/update_form_field_data_attributes.py +++ b/rootly_sdk/models/update_form_field_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,48 +24,57 @@ class UpdateFormFieldDataAttributes: """ Attributes: - kind (UpdateFormFieldDataAttributesKind | Unset): The kind of the form field - input_kind (UpdateFormFieldDataAttributesInputKind | Unset): The input kind of the form field - value_kind (UpdateFormFieldDataAttributesValueKind | Unset): The value kind of the form field - value_kind_catalog_id (None | str | Unset): The ID of the catalog used when value_kind is `catalog_entity` - name (str | Unset): The name of the form field - description (None | str | Unset): The description of the form field - shown (list[str] | Unset): - required (list[str] | Unset): - show_on_incident_details (bool | Unset): Whether the form field is shown on the incident details panel - enabled (bool | Unset): Whether the form field is enabled - default_values (list[str] | Unset): - auto_set_by_catalog_property_id (None | str | Unset): Catalog property ID to auto-set this form field. Only + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + kind (Union[Unset, UpdateFormFieldDataAttributesKind]): The kind of the form field + input_kind (Union[Unset, UpdateFormFieldDataAttributesInputKind]): The input kind of the form field + value_kind (Union[Unset, UpdateFormFieldDataAttributesValueKind]): The value kind of the form field + value_kind_catalog_id (Union[None, Unset, str]): The ID of the catalog used when value_kind is `catalog_entity` + name (Union[Unset, str]): The name of the form field + description (Union[None, Unset, str]): The description of the form field + shown (Union[Unset, list[str]]): + required (Union[Unset, list[str]]): + show_on_incident_details (Union[Unset, bool]): Whether the form field is shown on the incident details panel + enabled (Union[Unset, bool]): Whether the form field is enabled + default_values (Union[Unset, list[str]]): + auto_set_by_catalog_property_id (Union[None, Unset, str]): Catalog property ID to auto-set this form field. Only reference-kind catalog properties are supported. """ - kind: UpdateFormFieldDataAttributesKind | Unset = UNSET - input_kind: UpdateFormFieldDataAttributesInputKind | Unset = UNSET - value_kind: UpdateFormFieldDataAttributesValueKind | Unset = UNSET - value_kind_catalog_id: None | str | Unset = UNSET - name: str | Unset = UNSET - description: None | str | Unset = UNSET - shown: list[str] | Unset = UNSET - required: list[str] | Unset = UNSET - show_on_incident_details: bool | Unset = UNSET - enabled: bool | Unset = UNSET - default_values: list[str] | Unset = UNSET - auto_set_by_catalog_property_id: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + kind: Unset | UpdateFormFieldDataAttributesKind = UNSET + input_kind: Unset | UpdateFormFieldDataAttributesInputKind = UNSET + value_kind: Unset | UpdateFormFieldDataAttributesValueKind = UNSET + value_kind_catalog_id: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[str] = UNSET + required: Unset | list[str] = UNSET + show_on_incident_details: Unset | bool = UNSET + enabled: Unset | bool = UNSET + default_values: Unset | list[str] = UNSET + auto_set_by_catalog_property_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - kind: str | Unset = UNSET + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - input_kind: str | Unset = UNSET + input_kind: Unset | str = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: str | Unset = UNSET + value_kind: Unset | str = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: None | str | Unset + value_kind_catalog_id: None | Unset | str if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -75,17 +82,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: list[str] | Unset = UNSET + required: Unset | list[str] = UNSET if not isinstance(self.required, Unset): required = self.required @@ -93,11 +100,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: list[str] | Unset = UNSET + default_values: Unset | list[str] = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: None | str | Unset + auto_set_by_catalog_property_id: None | Unset | str if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -106,6 +113,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if kind is not UNSET: field_dict["kind"] = kind if input_kind is not UNSET: @@ -136,44 +145,54 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _kind = d.pop("kind", UNSET) - kind: UpdateFormFieldDataAttributesKind | Unset + kind: Unset | UpdateFormFieldDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_form_field_data_attributes_kind(_kind) _input_kind = d.pop("input_kind", UNSET) - input_kind: UpdateFormFieldDataAttributesInputKind | Unset + input_kind: Unset | UpdateFormFieldDataAttributesInputKind if isinstance(_input_kind, Unset): input_kind = UNSET else: input_kind = check_update_form_field_data_attributes_input_kind(_input_kind) _value_kind = d.pop("value_kind", UNSET) - value_kind: UpdateFormFieldDataAttributesValueKind | Unset + value_kind: Unset | UpdateFormFieldDataAttributesValueKind if isinstance(_value_kind, Unset): value_kind = UNSET else: value_kind = check_update_form_field_data_attributes_value_kind(_value_kind) - def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_value_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -187,18 +206,19 @@ def _parse_description(data: object) -> None | str | Unset: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) ) update_form_field_data_attributes = cls( + slug=slug, kind=kind, input_kind=input_kind, value_kind=value_kind, diff --git a/rootly_sdk/models/update_form_field_option.py b/rootly_sdk/models/update_form_field_option.py index 7fa663da..82cc645a 100644 --- a/rootly_sdk/models/update_form_field_option.py +++ b/rootly_sdk/models/update_form_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldOption: data (UpdateFormFieldOptionData): """ - data: UpdateFormFieldOptionData + data: "UpdateFormFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_option_data.py b/rootly_sdk/models/update_form_field_option_data.py index 234bfe54..648a9210 100644 --- a/rootly_sdk/models/update_form_field_option_data.py +++ b/rootly_sdk/models/update_form_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormFieldOptionData: """ type_: UpdateFormFieldOptionDataType - attributes: UpdateFormFieldOptionDataAttributes + attributes: "UpdateFormFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_option_data_attributes.py b/rootly_sdk/models/update_form_field_option_data_attributes.py index 884652f0..592e45ed 100644 --- a/rootly_sdk/models/update_form_field_option_data_attributes.py +++ b/rootly_sdk/models/update_form_field_option_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,16 +12,16 @@ class UpdateFormFieldOptionDataAttributes: """ Attributes: - value (str | Unset): The value of the form field option - color (str | Unset): The hex color of the form field option - default (bool | Unset): - position (int | Unset): The position of the form field option + value (Union[Unset, str]): The value of the form field option + color (Union[Unset, str]): The hex color of the form field option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the form field option """ - value: str | Unset = UNSET - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + value: Unset | str = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_form_field_placement.py b/rootly_sdk/models/update_form_field_placement.py index 8d8e18d4..f9a2844c 100644 --- a/rootly_sdk/models/update_form_field_placement.py +++ b/rootly_sdk/models/update_form_field_placement.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldPlacement: data (UpdateFormFieldPlacementData): """ - data: UpdateFormFieldPlacementData + data: "UpdateFormFieldPlacementData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_placement_condition.py b/rootly_sdk/models/update_form_field_placement_condition.py index 60e1c0a5..3788132c 100644 --- a/rootly_sdk/models/update_form_field_placement_condition.py +++ b/rootly_sdk/models/update_form_field_placement_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldPlacementCondition: data (UpdateFormFieldPlacementConditionData): """ - data: UpdateFormFieldPlacementConditionData + data: "UpdateFormFieldPlacementConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_placement_condition_data.py b/rootly_sdk/models/update_form_field_placement_condition_data.py index 28363a0c..d01736b0 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateFormFieldPlacementConditionData: """ type_: UpdateFormFieldPlacementConditionDataType - attributes: UpdateFormFieldPlacementConditionDataAttributes + attributes: "UpdateFormFieldPlacementConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py index abca4c89..f7498f29 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,22 +20,22 @@ class UpdateFormFieldPlacementConditionDataAttributes: """ Attributes: - conditioned (UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset): The resource or attribute the - condition applies. - position (int | Unset): The condition position. - form_field_id (str | Unset): The condition field. - comparison (UpdateFormFieldPlacementConditionDataAttributesComparison | Unset): The condition comparison. - values (list[str] | Unset): The values for comparison. + conditioned (Union[Unset, UpdateFormFieldPlacementConditionDataAttributesConditioned]): The resource or + attribute the condition applies. + position (Union[Unset, int]): The condition position. + form_field_id (Union[Unset, str]): The condition field. + comparison (Union[Unset, UpdateFormFieldPlacementConditionDataAttributesComparison]): The condition comparison. + values (Union[Unset, list[str]]): The values for comparison. """ - conditioned: UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset = UNSET - position: int | Unset = UNSET - form_field_id: str | Unset = UNSET - comparison: UpdateFormFieldPlacementConditionDataAttributesComparison | Unset = UNSET - values: list[str] | Unset = UNSET + conditioned: Unset | UpdateFormFieldPlacementConditionDataAttributesConditioned = UNSET + position: Unset | int = UNSET + form_field_id: Unset | str = UNSET + comparison: Unset | UpdateFormFieldPlacementConditionDataAttributesComparison = UNSET + values: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - conditioned: str | Unset = UNSET + conditioned: Unset | str = UNSET if not isinstance(self.conditioned, Unset): conditioned = self.conditioned @@ -45,11 +43,11 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: str | Unset = UNSET + comparison: Unset | str = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -73,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _conditioned = d.pop("conditioned", UNSET) - conditioned: UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset + conditioned: Unset | UpdateFormFieldPlacementConditionDataAttributesConditioned if isinstance(_conditioned, Unset): conditioned = UNSET else: @@ -84,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _comparison = d.pop("comparison", UNSET) - comparison: UpdateFormFieldPlacementConditionDataAttributesComparison | Unset + comparison: Unset | UpdateFormFieldPlacementConditionDataAttributesComparison if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_field_placement_data.py b/rootly_sdk/models/update_form_field_placement_data.py index 35393803..63c89523 100644 --- a/rootly_sdk/models/update_form_field_placement_data.py +++ b/rootly_sdk/models/update_form_field_placement_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormFieldPlacementData: """ type_: UpdateFormFieldPlacementDataType - attributes: UpdateFormFieldPlacementDataAttributes + attributes: "UpdateFormFieldPlacementDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_placement_data_attributes.py b/rootly_sdk/models/update_form_field_placement_data_attributes.py index aebd8477..ab3ed2c6 100644 --- a/rootly_sdk/models/update_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -22,24 +20,25 @@ class UpdateFormFieldPlacementDataAttributes: """ Attributes: - form_set_id (str | Unset): The form set this field is placed in. - form (str | Unset): The form this field is placed on. - position (int | Unset): The position of the field placement. - required (bool | Unset): Whether the field is unconditionally required on this form. - required_operator (UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset): Logical operator when + form_set_id (Union[Unset, str]): The form set this field is placed in. The form set must have the same + `resource_type` as the form field, otherwise the request is rejected with 422. + form (Union[Unset, str]): The form this field is placed on. + position (Union[Unset, int]): The position of the field placement. + required (Union[Unset, bool]): Whether the field is unconditionally required on this form. + required_operator (Union[Unset, UpdateFormFieldPlacementDataAttributesRequiredOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset): Logical operator when - evaluating multiple form_field_placement_conditions with conditioned=placement - non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. + placement_operator (Union[Unset, UpdateFormFieldPlacementDataAttributesPlacementOperator]): Logical operator + when evaluating multiple form_field_placement_conditions with conditioned=placement + non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ - form_set_id: str | Unset = UNSET - form: str | Unset = UNSET - position: int | Unset = UNSET - required: bool | Unset = UNSET - required_operator: UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset = UNSET - placement_operator: UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset = UNSET - non_editable: bool | Unset = UNSET + form_set_id: Unset | str = UNSET + form: Unset | str = UNSET + position: Unset | int = UNSET + required: Unset | bool = UNSET + required_operator: Unset | UpdateFormFieldPlacementDataAttributesRequiredOperator = UNSET + placement_operator: Unset | UpdateFormFieldPlacementDataAttributesPlacementOperator = UNSET + non_editable: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: form_set_id = self.form_set_id @@ -50,11 +49,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: str | Unset = UNSET + required_operator: Unset | str = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: str | Unset = UNSET + placement_operator: Unset | str = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -92,14 +91,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) _required_operator = d.pop("required_operator", UNSET) - required_operator: UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset + required_operator: Unset | UpdateFormFieldPlacementDataAttributesRequiredOperator if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_update_form_field_placement_data_attributes_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset + placement_operator: Unset | UpdateFormFieldPlacementDataAttributesPlacementOperator if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/update_form_field_position.py b/rootly_sdk/models/update_form_field_position.py index b7f234f1..e25ddb92 100644 --- a/rootly_sdk/models/update_form_field_position.py +++ b/rootly_sdk/models/update_form_field_position.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldPosition: data (UpdateFormFieldPositionData): """ - data: UpdateFormFieldPositionData + data: "UpdateFormFieldPositionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_position_data.py b/rootly_sdk/models/update_form_field_position_data.py index 3b9cc75c..282ebd4d 100644 --- a/rootly_sdk/models/update_form_field_position_data.py +++ b/rootly_sdk/models/update_form_field_position_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormFieldPositionData: """ type_: UpdateFormFieldPositionDataType - attributes: UpdateFormFieldPositionDataAttributes + attributes: "UpdateFormFieldPositionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_position_data_attributes.py b/rootly_sdk/models/update_form_field_position_data_attributes.py index bc7b1105..11487ec7 100644 --- a/rootly_sdk/models/update_form_field_position_data_attributes.py +++ b/rootly_sdk/models/update_form_field_position_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -18,19 +16,19 @@ class UpdateFormFieldPositionDataAttributes: """ Attributes: - form_field_id (str | Unset): The ID of the form field. - form (UpdateFormFieldPositionDataAttributesForm | Unset): The form for the position - position (int | Unset): The position of the form_field_position + form_field_id (Union[Unset, str]): The ID of the form field. + form (Union[Unset, UpdateFormFieldPositionDataAttributesForm]): The form for the position + position (Union[Unset, int]): The position of the form_field_position """ - form_field_id: str | Unset = UNSET - form: UpdateFormFieldPositionDataAttributesForm | Unset = UNSET - position: int | Unset = UNSET + form_field_id: Unset | str = UNSET + form: Unset | UpdateFormFieldPositionDataAttributesForm = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - form: str | Unset = UNSET + form: Unset | str = UNSET if not isinstance(self.form, Unset): form = self.form @@ -54,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _form = d.pop("form", UNSET) - form: UpdateFormFieldPositionDataAttributesForm | Unset + form: Unset | UpdateFormFieldPositionDataAttributesForm if isinstance(_form, Unset): form = UNSET else: diff --git a/rootly_sdk/models/update_form_field_position_data_attributes_form.py b/rootly_sdk/models/update_form_field_position_data_attributes_form.py index 15a3f66a..3c58189c 100644 --- a/rootly_sdk/models/update_form_field_position_data_attributes_form.py +++ b/rootly_sdk/models/update_form_field_position_data_attributes_form.py @@ -8,6 +8,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -18,6 +19,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", ] @@ -30,6 +32,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -40,6 +43,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", } diff --git a/rootly_sdk/models/update_form_set.py b/rootly_sdk/models/update_form_set.py index 5122ef01..e0ff9a8b 100644 --- a/rootly_sdk/models/update_form_set.py +++ b/rootly_sdk/models/update_form_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormSet: data (UpdateFormSetData): """ - data: UpdateFormSetData + data: "UpdateFormSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_set_condition.py b/rootly_sdk/models/update_form_set_condition.py index ccd4d7ee..97080641 100644 --- a/rootly_sdk/models/update_form_set_condition.py +++ b/rootly_sdk/models/update_form_set_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormSetCondition: data (UpdateFormSetConditionData): """ - data: UpdateFormSetConditionData + data: "UpdateFormSetConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_set_condition_data.py b/rootly_sdk/models/update_form_set_condition_data.py index 83b587c0..c95eb31c 100644 --- a/rootly_sdk/models/update_form_set_condition_data.py +++ b/rootly_sdk/models/update_form_set_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormSetConditionData: """ type_: UpdateFormSetConditionDataType - attributes: UpdateFormSetConditionDataAttributes + attributes: "UpdateFormSetConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_set_condition_data_attributes.py b/rootly_sdk/models/update_form_set_condition_data_attributes.py index cbaa334a..6a6f053b 100644 --- a/rootly_sdk/models/update_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_set_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,23 +16,23 @@ class UpdateFormSetConditionDataAttributes: """ Attributes: - form_field_id (str | Unset): The form field this condition applies. - comparison (UpdateFormSetConditionDataAttributesComparison | Unset): The condition comparison. - values (list[str] | Unset): The values for comparison. + form_field_id (Union[Unset, str]): The form field this condition applies. + comparison (Union[Unset, UpdateFormSetConditionDataAttributesComparison]): The condition comparison. + values (Union[Unset, list[str]]): The values for comparison. """ - form_field_id: str | Unset = UNSET - comparison: UpdateFormSetConditionDataAttributesComparison | Unset = UNSET - values: list[str] | Unset = UNSET + form_field_id: Unset | str = UNSET + comparison: Unset | UpdateFormSetConditionDataAttributesComparison = UNSET + values: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: str | Unset = UNSET + comparison: Unset | str = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -56,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _comparison = d.pop("comparison", UNSET) - comparison: UpdateFormSetConditionDataAttributesComparison | Unset + comparison: Unset | UpdateFormSetConditionDataAttributesComparison if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_set_data.py b/rootly_sdk/models/update_form_set_data.py index 582152a4..b22a2180 100644 --- a/rootly_sdk/models/update_form_set_data.py +++ b/rootly_sdk/models/update_form_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateFormSetData: """ type_: UpdateFormSetDataType - attributes: UpdateFormSetDataAttributes + attributes: "UpdateFormSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_set_data_attributes.py b/rootly_sdk/models/update_form_set_data_attributes.py index 4b67156e..e9bc5ab6 100644 --- a/rootly_sdk/models/update_form_set_data_attributes.py +++ b/rootly_sdk/models/update_form_set_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,30 +12,41 @@ class UpdateFormSetDataAttributes: """ Attributes: - name (str | Unset): The name of the form set - forms (list[str] | Unset): The forms included in the form set. Add custom forms using the custom form's `slug` - field. Or choose a built-in form: `web_new_incident_form`, `web_update_incident_form`, + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the form set + forms (Union[Unset, list[str]]): The forms included in the form set. Add custom forms using the custom form's + `slug` field. Or choose a built-in form: `web_new_incident_form`, `web_update_incident_form`, `web_incident_post_mortem_form`, `web_incident_mitigation_form`, `web_incident_resolution_form`, `web_incident_cancellation_form`, `web_scheduled_incident_form`, `web_update_scheduled_incident_form`, `slack_new_incident_form`, `slack_update_incident_form`, `slack_update_incident_status_form`, `slack_incident_mitigation_form`, `slack_incident_resolution_form`, `slack_incident_cancellation_form`, `slack_scheduled_incident_form`, `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, - `google_chat_update_incident_form` + `google_chat_update_incident_form`, `microsoft_teams_new_incident_form` """ - name: str | Unset = UNSET - forms: list[str] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + forms: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - forms: list[str] | Unset = UNSET + forms: Unset | list[str] = UNSET if not isinstance(self.forms, Unset): forms = self.forms field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if forms is not UNSET: @@ -48,11 +57,22 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) forms = cast(list[str], d.pop("forms", UNSET)) update_form_set_data_attributes = cls( + slug=slug, name=name, forms=forms, ) diff --git a/rootly_sdk/models/update_functionality.py b/rootly_sdk/models/update_functionality.py index 556789c0..501a15ac 100644 --- a/rootly_sdk/models/update_functionality.py +++ b/rootly_sdk/models/update_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFunctionality: data (UpdateFunctionalityData): """ - data: UpdateFunctionalityData + data: "UpdateFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_functionality_data.py b/rootly_sdk/models/update_functionality_data.py index 53e62f85..3bd9d4e7 100644 --- a/rootly_sdk/models/update_functionality_data.py +++ b/rootly_sdk/models/update_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateFunctionalityData: """ type_: UpdateFunctionalityDataType - attributes: UpdateFunctionalityDataAttributes + attributes: "UpdateFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_functionality_data_attributes.py b/rootly_sdk/models/update_functionality_data_attributes.py index 067bd483..81ef1a0e 100644 --- a/rootly_sdk/models/update_functionality_data_attributes.py +++ b/rootly_sdk/models/update_functionality_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -26,72 +24,82 @@ class UpdateFunctionalityDataAttributes: """ Attributes: - name (str | Unset): The name of the functionality - description (None | str | Unset): The description of the functionality - public_description (None | str | Unset): The public description of the functionality - notify_emails (list[str] | None | Unset): Emails to attach to the functionality - color (None | str | Unset): The hex color of the functionality - position (int | None | Unset): Position of the functionality - backstage_id (None | str | Unset): The Backstage entity id associated to this functionality. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the functionality + description (Union[None, Unset, str]): The description of the functionality + public_description (Union[None, Unset, str]): The status page description of the functionality + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the functionality + color (Union[None, Unset, str]): The hex color of the functionality + position (Union[None, Unset, int]): Position of the functionality + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this functionality - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this functionality - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this functionality - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this functionality - cortex_id (None | str | Unset): The Cortex group id associated to this functionality - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this functionality - environment_ids (list[str] | None | Unset): Environments associated with this functionality - service_ids (list[str] | None | Unset): Services associated with this functionality - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this functionality - owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality - escalation_policy_id (None | str | Unset): The escalation policy id of the functionality - slack_channels (list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this functionality - slack_aliases (list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases - associated with this functionality - properties (list[UpdateFunctionalityDataAttributesPropertiesItem] | Unset): Array of property values for this - functionality. + external_id (Union[None, Unset, str]): The external id associated to this functionality + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this functionality + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this functionality + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this functionality + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this functionality + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this functionality + environment_ids (Union[None, Unset, list[str]]): Environments associated with this functionality + service_ids (Union[None, Unset, list[str]]): Services associated with this functionality + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this functionality. Empty array + removes all; omitting or null leaves unchanged. + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this functionality. Empty array + removes all; omitting or null leaves unchanged. + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the functionality + slack_channels (Union[None, Unset, list['UpdateFunctionalityDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this functionality + slack_aliases (Union[None, Unset, list['UpdateFunctionalityDataAttributesSlackAliasesType0Item']]): Slack + Aliases associated with this functionality + properties (Union[Unset, list['UpdateFunctionalityDataAttributesPropertiesItem']]): Array of property values for + this functionality. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[UpdateFunctionalityDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["UpdateFunctionalityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -100,61 +108,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -163,7 +171,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -172,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -181,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -190,13 +198,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | str | Unset + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -208,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -220,7 +228,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -230,6 +238,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -288,27 +298,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -319,94 +339,94 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -417,13 +437,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -434,13 +454,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -451,13 +471,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -468,24 +488,24 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -503,15 +523,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -529,22 +549,21 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateFunctionalityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_functionality_data_attributes = cls( + slug=slug, name=name, description=description, public_description=public_description, diff --git a/rootly_sdk/models/update_functionality_data_attributes_properties_item.py b/rootly_sdk/models/update_functionality_data_attributes_properties_item.py index 8d1806bc..65940fe9 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py index b49afaf8..0570fa7e 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py index ef5557a9..7c94915e 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_github_issue_task_params.py b/rootly_sdk/models/update_github_issue_task_params.py index a6f28436..1bd52cf9 100644 --- a/rootly_sdk/models/update_github_issue_task_params.py +++ b/rootly_sdk/models/update_github_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,42 +30,41 @@ class UpdateGithubIssueTaskParams: Attributes: issue_id (str): The issue id completion (UpdateGithubIssueTaskParamsCompletion): - task_type (UpdateGithubIssueTaskParamsTaskType | Unset): - repository (UpdateGithubIssueTaskParamsRepository | Unset): The repository (used for loading labels and issue - types) - title (str | Unset): The issue title - body (str | Unset): The issue body - labels (list[UpdateGithubIssueTaskParamsLabelsItem] | Unset): The issue labels - labels_mode (UpdateGithubIssueTaskParamsLabelsMode | Unset): How to apply labels. 'replace' (default) overwrites - all existing labels. 'append' adds to existing labels without removing them. Default: 'replace'. - issue_type (UpdateGithubIssueTaskParamsIssueType | Unset): The issue type - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateGithubIssueTaskParamsTaskType]): + repository (Union[Unset, UpdateGithubIssueTaskParamsRepository]): The repository (used for loading labels and + issue types) + title (Union[Unset, str]): The issue title + body (Union[Unset, str]): The issue body + labels (Union[Unset, list['UpdateGithubIssueTaskParamsLabelsItem']]): The issue labels + labels_mode (Union[Unset, UpdateGithubIssueTaskParamsLabelsMode]): How to apply labels. 'replace' (default) + overwrites all existing labels. 'append' adds to existing labels without removing them. Default: 'replace'. + issue_type (Union[Unset, UpdateGithubIssueTaskParamsIssueType]): The issue type + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ issue_id: str - completion: UpdateGithubIssueTaskParamsCompletion - task_type: UpdateGithubIssueTaskParamsTaskType | Unset = UNSET - repository: UpdateGithubIssueTaskParamsRepository | Unset = UNSET - title: str | Unset = UNSET - body: str | Unset = UNSET - labels: list[UpdateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - labels_mode: UpdateGithubIssueTaskParamsLabelsMode | Unset = "replace" - issue_type: UpdateGithubIssueTaskParamsIssueType | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + completion: "UpdateGithubIssueTaskParamsCompletion" + task_type: Unset | UpdateGithubIssueTaskParamsTaskType = UNSET + repository: Union[Unset, "UpdateGithubIssueTaskParamsRepository"] = UNSET + title: Unset | str = UNSET + body: Unset | str = UNSET + labels: Unset | list["UpdateGithubIssueTaskParamsLabelsItem"] = UNSET + labels_mode: Unset | UpdateGithubIssueTaskParamsLabelsMode = "replace" + issue_type: Union[Unset, "UpdateGithubIssueTaskParamsIssueType"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - repository: dict[str, Any] | Unset = UNSET + repository: Unset | dict[str, Any] = UNSET if not isinstance(self.repository, Unset): repository = self.repository.to_dict() @@ -75,22 +72,22 @@ def to_dict(self) -> dict[str, Any]: body = self.body - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - labels_mode: str | Unset = UNSET + labels_mode: Unset | str = UNSET if not isinstance(self.labels_mode, Unset): labels_mode = self.labels_mode - issue_type: dict[str, Any] | Unset = UNSET + issue_type: Unset | dict[str, Any] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -136,14 +133,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateGithubIssueTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateGithubIssueTaskParamsTaskType | Unset + task_type: Unset | UpdateGithubIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_github_issue_task_params_task_type(_task_type) _repository = d.pop("repository", UNSET) - repository: UpdateGithubIssueTaskParamsRepository | Unset + repository: Unset | UpdateGithubIssueTaskParamsRepository if isinstance(_repository, Unset): repository = UNSET else: @@ -153,35 +150,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body", UNSET) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[UpdateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = UpdateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = UpdateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _labels_mode = d.pop("labels_mode", UNSET) - labels_mode: UpdateGithubIssueTaskParamsLabelsMode | Unset + labels_mode: Unset | UpdateGithubIssueTaskParamsLabelsMode if isinstance(_labels_mode, Unset): labels_mode = UNSET else: labels_mode = check_update_github_issue_task_params_labels_mode(_labels_mode) _issue_type = d.pop("issue_type", UNSET) - issue_type: UpdateGithubIssueTaskParamsIssueType | Unset + issue_type: Unset | UpdateGithubIssueTaskParamsIssueType if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = UpdateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_github_issue_task_params_completion.py b/rootly_sdk/models/update_github_issue_task_params_completion.py index 2aaafc3b..003e9917 100644 --- a/rootly_sdk/models/update_github_issue_task_params_completion.py +++ b/rootly_sdk/models/update_github_issue_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateGithubIssueTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_issue_type.py b/rootly_sdk/models/update_github_issue_task_params_issue_type.py index 2699f2b5..70e2dbaa 100644 --- a/rootly_sdk/models/update_github_issue_task_params_issue_type.py +++ b/rootly_sdk/models/update_github_issue_task_params_issue_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateGithubIssueTaskParamsIssueType: """The issue type Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_labels_item.py b/rootly_sdk/models/update_github_issue_task_params_labels_item.py index c905b808..913a6763 100644 --- a/rootly_sdk/models/update_github_issue_task_params_labels_item.py +++ b/rootly_sdk/models/update_github_issue_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateGithubIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_repository.py b/rootly_sdk/models/update_github_issue_task_params_repository.py index 541866c5..1d2587b7 100644 --- a/rootly_sdk/models/update_github_issue_task_params_repository.py +++ b/rootly_sdk/models/update_github_issue_task_params_repository.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateGithubIssueTaskParamsRepository: """The repository (used for loading labels and issue types) Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_gitlab_issue_task_params.py b/rootly_sdk/models/update_gitlab_issue_task_params.py index c2fb8168..691d232a 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,35 +27,34 @@ class UpdateGitlabIssueTaskParams: Attributes: issue_id (str): The issue id completion (UpdateGitlabIssueTaskParamsCompletion): - task_type (UpdateGitlabIssueTaskParamsTaskType | Unset): - issue_type (UpdateGitlabIssueTaskParamsIssueType | Unset): The issue type - title (str | Unset): The issue title - description (str | Unset): The issue description - labels (str | Unset): The issue labels - due_date (str | Unset): The due date + task_type (Union[Unset, UpdateGitlabIssueTaskParamsTaskType]): + issue_type (Union[Unset, UpdateGitlabIssueTaskParamsIssueType]): The issue type + title (Union[Unset, str]): The issue title + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + due_date (Union[Unset, str]): The due date """ issue_id: str - completion: UpdateGitlabIssueTaskParamsCompletion - task_type: UpdateGitlabIssueTaskParamsTaskType | Unset = UNSET - issue_type: UpdateGitlabIssueTaskParamsIssueType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET + completion: "UpdateGitlabIssueTaskParamsCompletion" + task_type: Unset | UpdateGitlabIssueTaskParamsTaskType = UNSET + issue_type: Unset | UpdateGitlabIssueTaskParamsIssueType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - issue_type: str | Unset = UNSET + issue_type: Unset | str = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type @@ -102,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateGitlabIssueTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateGitlabIssueTaskParamsTaskType | Unset + task_type: Unset | UpdateGitlabIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_gitlab_issue_task_params_task_type(_task_type) _issue_type = d.pop("issue_type", UNSET) - issue_type: UpdateGitlabIssueTaskParamsIssueType | Unset + issue_type: Unset | UpdateGitlabIssueTaskParamsIssueType if isinstance(_issue_type, Unset): issue_type = UNSET else: diff --git a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py index 0fef7627..c563e990 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateGitlabIssueTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_calendar_event_task_params.py b/rootly_sdk/models/update_google_calendar_event_task_params.py index 8f019d13..81eeceb0 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,53 +28,52 @@ class UpdateGoogleCalendarEventTaskParams: """ Attributes: event_id (str): The event ID - task_type (UpdateGoogleCalendarEventTaskParamsTaskType | Unset): - calendar_id (None | str | Unset): Default: 'primary'. - summary (str | Unset): The event summary - description (str | Unset): The event description - adjustment_days (int | Unset): Days to adjust meeting by - time_of_meeting (str | Unset): Time of meeting in format HH:MM - meeting_duration (str | Unset): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. - send_updates (bool | Unset): Send an email to the attendees notifying them of the event - can_guests_modify_event (bool | Unset): - can_guests_see_other_guests (bool | Unset): - can_guests_invite_others (bool | Unset): - attendees (list[str] | Unset): Emails of attendees - replace_attendees (bool | Unset): - conference_solution_key (UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset): Sets the video + task_type (Union[Unset, UpdateGoogleCalendarEventTaskParamsTaskType]): + calendar_id (Union[None, Unset, str]): Default: 'primary'. + summary (Union[Unset, str]): The event summary + description (Union[Unset, str]): The event description + adjustment_days (Union[Unset, int]): Days to adjust meeting by + time_of_meeting (Union[Unset, str]): Time of meeting in format HH:MM + meeting_duration (Union[Unset, str]): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. + send_updates (Union[Unset, bool]): Send an email to the attendees notifying them of the event + can_guests_modify_event (Union[Unset, bool]): + can_guests_see_other_guests (Union[Unset, bool]): + can_guests_invite_others (Union[Unset, bool]): + attendees (Union[Unset, list[str]]): Emails of attendees + replace_attendees (Union[Unset, bool]): + conference_solution_key (Union[Unset, UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey]): Sets the video conference type attached to the meeting - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem']]): """ event_id: str - task_type: UpdateGoogleCalendarEventTaskParamsTaskType | Unset = UNSET - calendar_id: None | str | Unset = "primary" - summary: str | Unset = UNSET - description: str | Unset = UNSET - adjustment_days: int | Unset = UNSET - time_of_meeting: str | Unset = UNSET - meeting_duration: str | Unset = UNSET - send_updates: bool | Unset = UNSET - can_guests_modify_event: bool | Unset = UNSET - can_guests_see_other_guests: bool | Unset = UNSET - can_guests_invite_others: bool | Unset = UNSET - attendees: list[str] | Unset = UNSET - replace_attendees: bool | Unset = UNSET - conference_solution_key: UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Unset | UpdateGoogleCalendarEventTaskParamsTaskType = UNSET + calendar_id: None | Unset | str = "primary" + summary: Unset | str = UNSET + description: Unset | str = UNSET + adjustment_days: Unset | int = UNSET + time_of_meeting: Unset | str = UNSET + meeting_duration: Unset | str = UNSET + send_updates: Unset | bool = UNSET + can_guests_modify_event: Unset | bool = UNSET + can_guests_see_other_guests: Unset | bool = UNSET + can_guests_invite_others: Unset | bool = UNSET + attendees: Unset | list[str] = UNSET + replace_attendees: Unset | bool = UNSET + conference_solution_key: Unset | UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - event_id = self.event_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - calendar_id: None | str | Unset + calendar_id: None | Unset | str if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -100,19 +97,19 @@ def to_dict(self) -> dict[str, Any]: can_guests_invite_others = self.can_guests_invite_others - attendees: list[str] | Unset = UNSET + attendees: Unset | list[str] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees replace_attendees = self.replace_attendees - conference_solution_key: str | Unset = UNSET + conference_solution_key: Unset | str = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -171,18 +168,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_id = d.pop("event_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateGoogleCalendarEventTaskParamsTaskType | Unset + task_type: Unset | UpdateGoogleCalendarEventTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_google_calendar_event_task_params_task_type(_task_type) - def _parse_calendar_id(data: object) -> None | str | Unset: + def _parse_calendar_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -209,7 +206,7 @@ def _parse_calendar_id(data: object) -> None | str | Unset: replace_attendees = d.pop("replace_attendees", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset + conference_solution_key: Unset | UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -219,16 +216,14 @@ def _parse_calendar_id(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) update_google_calendar_event_task_params = cls( event_id=event_id, diff --git a/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py index 81404c8a..e92620d2 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_chat_space_description_task_params.py b/rootly_sdk/models/update_google_chat_space_description_task_params.py index bf018939..9e20b3d5 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,21 +25,20 @@ class UpdateGoogleChatSpaceDescriptionTaskParams: Attributes: space (UpdateGoogleChatSpaceDescriptionTaskParamsSpace): description (str): The space description. Supports liquid markup - task_type (UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType]): """ - space: UpdateGoogleChatSpaceDescriptionTaskParamsSpace + space: "UpdateGoogleChatSpaceDescriptionTaskParamsSpace" description: str - task_type: UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset = UNSET + task_type: Unset | UpdateGoogleChatSpaceDescriptionTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() description = self.description - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset + task_type: Unset | UpdateGoogleChatSpaceDescriptionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_google_chat_space_description_task_params_space.py b/rootly_sdk/models/update_google_chat_space_description_task_params_space.py index 42c6ff4f..ca1a54af 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params_space.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params_space.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateGoogleChatSpaceDescriptionTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_docs_page_task_params.py b/rootly_sdk/models/update_google_docs_page_task_params.py index 80b0fe55..adc6e256 100644 --- a/rootly_sdk/models/update_google_docs_page_task_params.py +++ b/rootly_sdk/models/update_google_docs_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,29 +18,31 @@ class UpdateGoogleDocsPageTaskParams: """ Attributes: file_id (str): The Google Doc file ID - task_type (UpdateGoogleDocsPageTaskParamsTaskType | Unset): - title (str | Unset): The Google Doc title - content (str | Unset): The Google Doc content - post_mortem_template_id (str | Unset): Retrospective template to use when updating page, if desired - template_id (str | Unset): The Google Doc file ID to use as a template. - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. + task_type (Union[Unset, UpdateGoogleDocsPageTaskParamsTaskType]): + title (Union[Unset, str]): The Google Doc title + content (Union[Unset, str]): The Google Doc content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating page, if desired + template_id (Union[Unset, str]): The Google Doc file ID to use as a template. + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. """ file_id: str - task_type: UpdateGoogleDocsPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template_id: str | Unset = UNSET - include_overview: bool | Unset = True - include_timeline: bool | Unset = True + task_type: Unset | UpdateGoogleDocsPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + template_id: Unset | str = UNSET + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -79,6 +81,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups return field_dict @@ -88,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateGoogleDocsPageTaskParamsTaskType | Unset + task_type: Unset | UpdateGoogleDocsPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -106,6 +110,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + update_google_docs_page_task_params = cls( file_id=file_id, task_type=task_type, @@ -115,6 +121,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: template_id=template_id, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, ) update_google_docs_page_task_params.additional_properties = d diff --git a/rootly_sdk/models/update_heartbeat.py b/rootly_sdk/models/update_heartbeat.py index 165a23ee..a8c09301 100644 --- a/rootly_sdk/models/update_heartbeat.py +++ b/rootly_sdk/models/update_heartbeat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateHeartbeat: data (UpdateHeartbeatData): """ - data: UpdateHeartbeatData + data: "UpdateHeartbeatData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_heartbeat_data.py b/rootly_sdk/models/update_heartbeat_data.py index f068e428..b5696242 100644 --- a/rootly_sdk/models/update_heartbeat_data.py +++ b/rootly_sdk/models/update_heartbeat_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateHeartbeatData: """ type_: UpdateHeartbeatDataType - attributes: UpdateHeartbeatDataAttributes + attributes: "UpdateHeartbeatDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_heartbeat_data_attributes.py b/rootly_sdk/models/update_heartbeat_data_attributes.py index 6b0b4180..e605b3c1 100644 --- a/rootly_sdk/models/update_heartbeat_data_attributes.py +++ b/rootly_sdk/models/update_heartbeat_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,36 +20,36 @@ class UpdateHeartbeatDataAttributes: """ Attributes: - name (str | Unset): The name of the heartbeat - description (None | str | Unset): The description of the heartbeat - alert_summary (str | Unset): Summary of alerts triggered when heartbeat expires. - alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires. - alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires. - interval (int | Unset): - interval_unit (UpdateHeartbeatDataAttributesIntervalUnit | Unset): - notification_target_id (str | Unset): - notification_target_type (UpdateHeartbeatDataAttributesNotificationTargetType | Unset): The type of the + name (Union[Unset, str]): The name of the heartbeat + description (Union[None, Unset, str]): The description of the heartbeat + alert_summary (Union[Unset, str]): Summary of alerts triggered when heartbeat expires. + alert_description (Union[None, Unset, str]): Description of alerts triggered when heartbeat expires. + alert_urgency_id (Union[None, Unset, str]): Urgency of alerts triggered when heartbeat expires. + interval (Union[Unset, int]): + interval_unit (Union[Unset, UpdateHeartbeatDataAttributesIntervalUnit]): + notification_target_id (Union[Unset, str]): + notification_target_type (Union[Unset, UpdateHeartbeatDataAttributesNotificationTargetType]): The type of the notification target. Please contact support if you encounter issues using `Functionality` as a target type. - owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat - enabled (bool | Unset): Whether to trigger alerts when heartbeat is expired. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that own this heartbeat + enabled (Union[Unset, bool]): Whether to trigger alerts when heartbeat is expired. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - alert_summary: str | Unset = UNSET - alert_description: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - interval: int | Unset = UNSET - interval_unit: UpdateHeartbeatDataAttributesIntervalUnit | Unset = UNSET - notification_target_id: str | Unset = UNSET - notification_target_type: UpdateHeartbeatDataAttributesNotificationTargetType | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - enabled: bool | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + alert_summary: Unset | str = UNSET + alert_description: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + interval: Unset | int = UNSET + interval_unit: Unset | UpdateHeartbeatDataAttributesIntervalUnit = UNSET + notification_target_id: Unset | str = UNSET + notification_target_type: Unset | UpdateHeartbeatDataAttributesNotificationTargetType = UNSET + owner_group_ids: Unset | list[str] = UNSET + enabled: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -59,13 +57,13 @@ def to_dict(self) -> dict[str, Any]: alert_summary = self.alert_summary - alert_description: None | str | Unset + alert_description: None | Unset | str if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: @@ -73,17 +71,17 @@ def to_dict(self) -> dict[str, Any]: interval = self.interval - interval_unit: str | Unset = UNSET + interval_unit: Unset | str = UNSET if not isinstance(self.interval_unit, Unset): interval_unit = self.interval_unit notification_target_id = self.notification_target_id - notification_target_type: str | Unset = UNSET + notification_target_type: Unset | str = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -122,39 +120,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) alert_summary = d.pop("alert_summary", UNSET) - def _parse_alert_description(data: object) -> None | str | Unset: + def _parse_alert_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) interval = d.pop("interval", UNSET) _interval_unit = d.pop("interval_unit", UNSET) - interval_unit: UpdateHeartbeatDataAttributesIntervalUnit | Unset + interval_unit: Unset | UpdateHeartbeatDataAttributesIntervalUnit if isinstance(_interval_unit, Unset): interval_unit = UNSET else: @@ -163,7 +161,7 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset: notification_target_id = d.pop("notification_target_id", UNSET) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: UpdateHeartbeatDataAttributesNotificationTargetType | Unset + notification_target_type: Unset | UpdateHeartbeatDataAttributesNotificationTargetType if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: diff --git a/rootly_sdk/models/update_incident.py b/rootly_sdk/models/update_incident.py index 7f3dc16e..8539fba1 100644 --- a/rootly_sdk/models/update_incident.py +++ b/rootly_sdk/models/update_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncident: data (UpdateIncidentData): """ - data: UpdateIncidentData + data: "UpdateIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_action_item.py b/rootly_sdk/models/update_incident_action_item.py index b2746244..cd2fc2ac 100644 --- a/rootly_sdk/models/update_incident_action_item.py +++ b/rootly_sdk/models/update_incident_action_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentActionItem: data (UpdateIncidentActionItemData): """ - data: UpdateIncidentActionItemData + data: "UpdateIncidentActionItemData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_action_item_data.py b/rootly_sdk/models/update_incident_action_item_data.py index ca8096f5..12a47e8c 100644 --- a/rootly_sdk/models/update_incident_action_item_data.py +++ b/rootly_sdk/models/update_incident_action_item_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentActionItemData: """ type_: UpdateIncidentActionItemDataType - attributes: UpdateIncidentActionItemDataAttributes + attributes: "UpdateIncidentActionItemDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes.py b/rootly_sdk/models/update_incident_action_item_data_attributes.py index 076174eb..e4bda19b 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,58 +30,57 @@ class UpdateIncidentActionItemDataAttributes: """ Attributes: - summary (str | Unset): The summary of the action item - description (None | str | Unset): The description of the action item - kind (UpdateIncidentActionItemDataAttributesKind | Unset): The kind of the action item - assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item - assigned_to_group_ids (list[str] | None | Unset): IDs of groups you wish to assign this action item - priority (UpdateIncidentActionItemDataAttributesPriority | Unset): The priority of the action item - status (UpdateIncidentActionItemDataAttributesStatus | Unset): The status of the action item - due_date (None | str | Unset): The due date of the action item - jira_issue_id (None | str | Unset): The Jira issue ID. - jira_issue_key (None | str | Unset): The Jira issue key. - jira_issue_url (None | str | Unset): The Jira issue URL. - form_field_selections (list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset): - Custom field values to set on the action item. Ignored unless custom fields for action items are enabled for the - organization. + summary (Union[Unset, str]): The summary of the action item + description (Union[None, Unset, str]): The description of the action item + kind (Union[Unset, UpdateIncidentActionItemDataAttributesKind]): The kind of the action item + assigned_to_user_id (Union[None, Unset, int]): ID of user you wish to assign this action item + assigned_to_group_ids (Union[None, Unset, list[str]]): IDs of groups you wish to assign this action item + priority (Union[Unset, UpdateIncidentActionItemDataAttributesPriority]): The priority of the action item + status (Union[Unset, UpdateIncidentActionItemDataAttributesStatus]): The status of the action item + due_date (Union[None, Unset, str]): The due date of the action item + jira_issue_id (Union[None, Unset, str]): The Jira issue ID. + jira_issue_key (Union[None, Unset, str]): The Jira issue key. + jira_issue_url (Union[None, Unset, str]): The Jira issue URL. + form_field_selections (Union[None, Unset, + list['UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item']]): Custom field values to set on the + action item. Ignored unless custom fields for action items are enabled for the organization. """ - summary: str | Unset = UNSET - description: None | str | Unset = UNSET - kind: UpdateIncidentActionItemDataAttributesKind | Unset = UNSET - assigned_to_user_id: int | None | Unset = UNSET - assigned_to_group_ids: list[str] | None | Unset = UNSET - priority: UpdateIncidentActionItemDataAttributesPriority | Unset = UNSET - status: UpdateIncidentActionItemDataAttributesStatus | Unset = UNSET - due_date: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - form_field_selections: list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset = ( + summary: Unset | str = UNSET + description: None | Unset | str = UNSET + kind: Unset | UpdateIncidentActionItemDataAttributesKind = UNSET + assigned_to_user_id: None | Unset | int = UNSET + assigned_to_group_ids: None | Unset | list[str] = UNSET + priority: Unset | UpdateIncidentActionItemDataAttributesPriority = UNSET + status: Unset | UpdateIncidentActionItemDataAttributesStatus = UNSET + due_date: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + form_field_selections: None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] = ( UNSET ) def to_dict(self) -> dict[str, Any]: - summary = self.summary - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: int | None | Unset + assigned_to_user_id: None | Unset | int if isinstance(self.assigned_to_user_id, Unset): assigned_to_user_id = UNSET else: assigned_to_user_id = self.assigned_to_user_id - assigned_to_group_ids: list[str] | None | Unset + assigned_to_group_ids: None | Unset | list[str] if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -92,39 +89,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | str | Unset + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | str | Unset + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | str | Unset + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | str | Unset + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: list[dict[str, Any]] | None | Unset + form_field_selections: None | Unset | list[dict[str, Any]] if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -175,32 +172,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentActionItemDataAttributesKind | Unset + kind: Unset | UpdateIncidentActionItemDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_action_item_data_attributes_kind(_kind) - def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + def _parse_assigned_to_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) - def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: + def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -211,65 +208,65 @@ def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: assigned_to_group_ids_type_0 = cast(list[str], data) return assigned_to_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: UpdateIncidentActionItemDataAttributesPriority | Unset + priority: Unset | UpdateIncidentActionItemDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: UpdateIncidentActionItemDataAttributesStatus | Unset + status: Unset | UpdateIncidentActionItemDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -289,9 +286,9 @@ def _parse_form_field_selections( form_field_selections_type_0.append(form_field_selections_type_0_item) return form_field_selections_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"], data) form_field_selections = _parse_form_field_selections(d.pop("form_field_selections", UNSET)) diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py b/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py index 95df1e5a..1285dd67 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,41 +13,42 @@ class UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ Attributes: form_field_id (str): ID of the custom field - id (str | Unset): ID of an existing selection. Required when updating or removing a field's existing value. - value (list[str] | None | str | Unset): Value for text, textarea, rich text, date, datetime, number, checkbox, - or tag fields - selected_option_ids (list[str] | Unset): IDs of the selected custom field options - selected_user_ids (list[int] | Unset): IDs of the selected users - selected_group_ids (list[str] | Unset): IDs of the selected teams - selected_service_ids (list[str] | Unset): IDs of the selected services - selected_functionality_ids (list[str] | Unset): IDs of the selected functionalities - selected_catalog_entity_ids (list[str] | Unset): IDs of the selected catalog entities - selected_environment_ids (list[str] | Unset): IDs of the selected environments - selected_cause_ids (list[str] | Unset): IDs of the selected causes - selected_incident_type_ids (list[str] | Unset): IDs of the selected incident types - field_destroy (bool | None | Unset): Set to true to remove the field's value from the action item + id (Union[Unset, str]): ID of an existing selection. Required when updating or removing a field's existing + value. + value (Union[None, Unset, list[str], str]): Value for text, textarea, rich text, date, datetime, number, + checkbox, or tag fields + selected_option_ids (Union[Unset, list[str]]): IDs of the selected custom field options + selected_user_ids (Union[Unset, list[int]]): IDs of the selected users + selected_group_ids (Union[Unset, list[str]]): IDs of the selected teams + selected_service_ids (Union[Unset, list[str]]): IDs of the selected services + selected_functionality_ids (Union[Unset, list[str]]): IDs of the selected functionalities + selected_catalog_entity_ids (Union[Unset, list[str]]): IDs of the selected catalog entities + selected_environment_ids (Union[Unset, list[str]]): IDs of the selected environments + selected_cause_ids (Union[Unset, list[str]]): IDs of the selected causes + selected_incident_type_ids (Union[Unset, list[str]]): IDs of the selected incident types + field_destroy (Union[None, Unset, bool]): Set to true to remove the field's value from the action item """ form_field_id: str - id: str | Unset = UNSET - value: list[str] | None | str | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET - field_destroy: bool | None | Unset = UNSET + id: Unset | str = UNSET + value: None | Unset | list[str] | str = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET + field_destroy: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: list[str] | None | str | Unset + value: None | Unset | list[str] | str if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -58,43 +57,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: bool | None | Unset + field_destroy: None | Unset | bool if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -141,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> list[str] | None | str | Unset: + def _parse_value(data: object) -> None | Unset | list[str] | str: if data is None: return data if isinstance(data, Unset): @@ -152,9 +151,9 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: value_type_1 = cast(list[str], data) return value_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | str | Unset, data) + return cast(None | Unset | list[str] | str, data) value = _parse_value(d.pop("value", UNSET)) @@ -176,12 +175,12 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> bool | None | Unset: + def _parse_field_destroy(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/update_incident_custom_field_selection.py b/rootly_sdk/models/update_incident_custom_field_selection.py index 9aa40a6f..3690992c 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection.py +++ b/rootly_sdk/models/update_incident_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentCustomFieldSelection: data (UpdateIncidentCustomFieldSelectionData): """ - data: UpdateIncidentCustomFieldSelectionData + data: "UpdateIncidentCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_custom_field_selection_data.py b/rootly_sdk/models/update_incident_custom_field_selection_data.py index 365c90ba..a439389b 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentCustomFieldSelectionData: """ type_: UpdateIncidentCustomFieldSelectionDataType - attributes: UpdateIncidentCustomFieldSelectionDataAttributes + attributes: "UpdateIncidentCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py index 04f6d0da..ddd3fa07 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,21 +12,21 @@ class UpdateIncidentCustomFieldSelectionDataAttributes: """ Attributes: - value (None | str | Unset): The selected value for text kind custom fields - selected_option_ids (list[int] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_option_ids (Union[Unset, list[int]]): """ - value: None | str | Unset = UNSET - selected_option_ids: list[int] | Unset = UNSET + value: None | Unset | str = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -46,12 +44,12 @@ 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_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_data.py b/rootly_sdk/models/update_incident_data.py index 79df36e1..6f4da343 100644 --- a/rootly_sdk/models/update_incident_data.py +++ b/rootly_sdk/models/update_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentData: """ type_: UpdateIncidentDataType - attributes: UpdateIncidentDataAttributes + attributes: "UpdateIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_data_attributes.py b/rootly_sdk/models/update_incident_data_attributes.py index b92c2028..0d2246cf 100644 --- a/rootly_sdk/models/update_incident_data_attributes.py +++ b/rootly_sdk/models/update_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,146 +24,146 @@ class UpdateIncidentDataAttributes: """ Attributes: - title (None | str | Unset): The title of the incident - kind (UpdateIncidentDataAttributesKind | Unset): The kind of the incident Default: 'normal'. - parent_incident_id (None | str | Unset): ID of parent incident - duplicate_incident_id (None | str | Unset): ID of duplicated incident - summary (None | str | Unset): The summary of the incident - status (UpdateIncidentDataAttributesStatus | Unset): The status of the incident - private (bool | None | Unset): Convert the incident as private. Once an incident is updated as private it cannot - be undone Default: False. - severity_id (None | str | Unset): The Severity ID to attach to the incident - public_title (None | str | Unset): The public title of the incident - alert_ids (list[str] | None | Unset): The Alert IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - muted_service_ids (list[str] | None | Unset): The Service IDs to mute alerts for during maintenance. Alerts for - these services will still be triggered and attached to the incident, but won't page responders. - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident - labels (None | Unset | UpdateIncidentDataAttributesLabelsType0): Labels to attach to the incidents. eg: + title (Union[None, Unset, str]): The title of the incident + kind (Union[Unset, UpdateIncidentDataAttributesKind]): The kind of the incident Default: 'normal'. + parent_incident_id (Union[None, Unset, str]): ID of parent incident + duplicate_incident_id (Union[None, Unset, str]): ID of duplicated incident + summary (Union[None, Unset, str]): The summary of the incident + status (Union[Unset, UpdateIncidentDataAttributesStatus]): The status of the incident + private (Union[None, Unset, bool]): Convert the incident as private. Once an incident is updated as private it + cannot be undone Default: False. + severity_id (Union[None, Unset, str]): The Severity ID to attach to the incident + public_title (Union[None, Unset, str]): The public title of the incident + alert_ids (Union[None, Unset, list[str]]): The Alert IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + muted_service_ids (Union[None, Unset, list[str]]): The Service IDs to mute alerts for during maintenance. Alerts + for these services will still be triggered and attached to the incident, but won't page responders. + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident + labels (Union['UpdateIncidentDataAttributesLabelsType0', None, Unset]): Labels to attach to the incidents. eg: {"platform":"osx", "version": "1.29"} - slack_channel_id (None | str | Unset): Slack channel id - slack_channel_name (None | str | Unset): Slack channel name - slack_channel_url (None | str | Unset): Slack channel url - slack_channel_archived (bool | None | Unset): Whether the Slack channel is archived - google_drive_parent_id (None | str | Unset): Google Drive parent folder ID - google_drive_url (None | str | Unset): Google Drive URL - jira_issue_key (None | str | Unset): Jira issue key - jira_issue_id (None | str | Unset): Jira issue ID - jira_issue_url (None | str | Unset): Jira issue URL - scheduled_for (None | str | Unset): Date of when the maintenance begins - scheduled_until (None | str | Unset): Date of when the maintenance ends - in_triage_at (None | str | Unset): Date of triage - started_at (None | str | Unset): Date of start - detected_at (None | str | Unset): Date of detection - acknowledged_at (None | str | Unset): Date of acknowledgment - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - closed_at (None | str | Unset): Date of closure - cancelled_at (None | str | Unset): Date of cancellation - mitigation_message (None | str | Unset): How was the incident mitigated? - resolution_message (None | str | Unset): How was the incident resolved? - cancellation_message (None | str | Unset): Why was the incident cancelled? + slack_channel_id (Union[None, Unset, str]): Slack channel id + slack_channel_name (Union[None, Unset, str]): Slack channel name + slack_channel_url (Union[None, Unset, str]): Slack channel url + slack_channel_archived (Union[None, Unset, bool]): Whether the Slack channel is archived + google_drive_parent_id (Union[None, Unset, str]): Google Drive parent folder ID + google_drive_url (Union[None, Unset, str]): Google Drive URL + jira_issue_key (Union[None, Unset, str]): Jira issue key + jira_issue_id (Union[None, Unset, str]): Jira issue ID + jira_issue_url (Union[None, Unset, str]): Jira issue URL + scheduled_for (Union[None, Unset, str]): Date of when the maintenance begins + scheduled_until (Union[None, Unset, str]): Date of when the maintenance ends + in_triage_at (Union[None, Unset, str]): Date of triage + started_at (Union[None, Unset, str]): Date of start + detected_at (Union[None, Unset, str]): Date of detection + acknowledged_at (Union[None, Unset, str]): Date of acknowledgment + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + closed_at (Union[None, Unset, str]): Date of closure + cancelled_at (Union[None, Unset, str]): Date of cancellation + mitigation_message (Union[None, Unset, str]): How was the incident mitigated? + resolution_message (Union[None, Unset, str]): How was the incident resolved? + cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? """ - title: None | str | Unset = UNSET - kind: UpdateIncidentDataAttributesKind | Unset = "normal" - parent_incident_id: None | str | Unset = UNSET - duplicate_incident_id: None | str | Unset = UNSET - summary: None | str | Unset = UNSET - status: UpdateIncidentDataAttributesStatus | Unset = UNSET - private: bool | None | Unset = False - severity_id: None | str | Unset = UNSET - public_title: None | str | Unset = UNSET - alert_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - muted_service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - cause_ids: list[str] | None | Unset = UNSET - labels: None | Unset | UpdateIncidentDataAttributesLabelsType0 = UNSET - slack_channel_id: None | str | Unset = UNSET - slack_channel_name: None | str | Unset = UNSET - slack_channel_url: None | str | Unset = UNSET - slack_channel_archived: bool | None | Unset = UNSET - google_drive_parent_id: None | str | Unset = UNSET - google_drive_url: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - scheduled_for: None | str | Unset = UNSET - scheduled_until: None | str | Unset = UNSET - in_triage_at: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - closed_at: None | str | Unset = UNSET - cancelled_at: None | str | Unset = UNSET - mitigation_message: None | str | Unset = UNSET - resolution_message: None | str | Unset = UNSET - cancellation_message: None | str | Unset = UNSET + title: None | Unset | str = UNSET + kind: Unset | UpdateIncidentDataAttributesKind = "normal" + parent_incident_id: None | Unset | str = UNSET + duplicate_incident_id: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + status: Unset | UpdateIncidentDataAttributesStatus = UNSET + private: None | Unset | bool = False + severity_id: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + alert_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + muted_service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + cause_ids: None | Unset | list[str] = UNSET + labels: Union["UpdateIncidentDataAttributesLabelsType0", None, Unset] = UNSET + slack_channel_id: None | Unset | str = UNSET + slack_channel_name: None | Unset | str = UNSET + slack_channel_url: None | Unset | str = UNSET + slack_channel_archived: None | Unset | bool = UNSET + google_drive_parent_id: None | Unset | str = UNSET + google_drive_url: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + scheduled_for: None | Unset | str = UNSET + scheduled_until: None | Unset | str = UNSET + in_triage_at: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + closed_at: None | Unset | str = UNSET + cancelled_at: None | Unset | str = UNSET + mitigation_message: None | Unset | str = UNSET + resolution_message: None | Unset | str = UNSET + cancellation_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_incident_data_attributes_labels_type_0 import UpdateIncidentDataAttributesLabelsType0 - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: None | str | Unset + parent_incident_id: None | Unset | str if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | str | Unset + duplicate_incident_id: None | Unset | str if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - private: bool | None | Unset + private: None | Unset | bool if isinstance(self.private, Unset): private = UNSET else: private = self.private - severity_id: None | str | Unset + severity_id: None | Unset | str if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: None | str | Unset + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: list[str] | None | Unset + alert_ids: None | Unset | list[str] if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -174,7 +172,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -183,7 +181,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -192,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -201,7 +199,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -210,7 +208,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - muted_service_ids: list[str] | None | Unset + muted_service_ids: None | Unset | list[str] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -219,7 +217,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -228,7 +226,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: list[str] | None | Unset + cause_ids: None | Unset | list[str] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -237,7 +235,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - labels: dict[str, Any] | None | Unset + labels: None | Unset | dict[str, Any] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, UpdateIncidentDataAttributesLabelsType0): @@ -245,133 +243,133 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: None | str | Unset + slack_channel_id: None | Unset | str if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: None | str | Unset + slack_channel_name: None | Unset | str if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: None | str | Unset + slack_channel_url: None | Unset | str if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: bool | None | Unset + slack_channel_archived: None | Unset | bool if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: None | str | Unset + google_drive_parent_id: None | Unset | str if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: None | str | Unset + google_drive_url: None | Unset | str if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: None | str | Unset + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | str | Unset + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | str | Unset + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - scheduled_for: None | str | Unset + scheduled_for: None | Unset | str if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | str | Unset + scheduled_until: None | Unset | str if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: None | str | Unset + in_triage_at: None | Unset | str if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | str | Unset + closed_at: None | Unset | str if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | str | Unset + cancelled_at: None | Unset | str if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: cancelled_at = self.cancelled_at - mitigation_message: None | str | Unset + mitigation_message: None | Unset | str if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: None | str | Unset + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: None | str | Unset + cancellation_message: None | Unset | str if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -469,84 +467,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentDataAttributesKind | Unset + kind: Unset | UpdateIncidentDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> None | str | Unset: + def _parse_parent_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | str | Unset: + def _parse_duplicate_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) _status = d.pop("status", UNSET) - status: UpdateIncidentDataAttributesStatus | Unset + status: Unset | UpdateIncidentDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_data_attributes_status(_status) - def _parse_private(data: object) -> bool | None | Unset: + def _parse_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) private = _parse_private(d.pop("private", UNSET)) - def _parse_severity_id(data: object) -> None | str | Unset: + def _parse_severity_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -557,13 +555,13 @@ def _parse_alert_ids(data: object) -> list[str] | None | Unset: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -574,13 +572,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -591,13 +589,13 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -608,13 +606,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -625,13 +623,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: + def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -642,13 +640,13 @@ def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -659,13 +657,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> list[str] | None | Unset: + def _parse_cause_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -676,13 +674,13 @@ def _parse_cause_ids(data: object) -> list[str] | None | Unset: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_labels(data: object) -> None | Unset | UpdateIncidentDataAttributesLabelsType0: + def _parse_labels(data: object) -> Union["UpdateIncidentDataAttributesLabelsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -693,207 +691,207 @@ def _parse_labels(data: object) -> None | Unset | UpdateIncidentDataAttributesLa labels_type_0 = UpdateIncidentDataAttributesLabelsType0.from_dict(data) return labels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateIncidentDataAttributesLabelsType0, data) + return cast(Union["UpdateIncidentDataAttributesLabelsType0", None, Unset], data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> None | str | Unset: + def _parse_slack_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> None | str | Unset: + def _parse_slack_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> None | str | Unset: + def _parse_slack_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> bool | None | Unset: + def _parse_slack_channel_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | str | Unset: + def _parse_google_drive_parent_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> None | str | Unset: + def _parse_google_drive_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_scheduled_for(data: object) -> None | str | Unset: + def _parse_scheduled_for(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | str | Unset: + def _parse_scheduled_until(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> None | str | Unset: + def _parse_in_triage_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | str | Unset: + def _parse_closed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | str | Unset: + def _parse_cancelled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) - def _parse_mitigation_message(data: object) -> None | str | Unset: + def _parse_mitigation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> None | str | Unset: + def _parse_cancellation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py b/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py index 3bbf882a..cd7027c9 100644 --- a/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py +++ b/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateIncidentDataAttributesLabelsType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_incident_event.py b/rootly_sdk/models/update_incident_event.py index 4cb04a10..ab56ae88 100644 --- a/rootly_sdk/models/update_incident_event.py +++ b/rootly_sdk/models/update_incident_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentEvent: data (UpdateIncidentEventData): """ - data: UpdateIncidentEventData + data: "UpdateIncidentEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_event_data.py b/rootly_sdk/models/update_incident_event_data.py index ee5cbb73..cc26fc06 100644 --- a/rootly_sdk/models/update_incident_event_data.py +++ b/rootly_sdk/models/update_incident_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentEventData: """ type_: UpdateIncidentEventDataType - attributes: UpdateIncidentEventDataAttributes + attributes: "UpdateIncidentEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_event_data_attributes.py b/rootly_sdk/models/update_incident_event_data_attributes.py index 1d966e3c..07151a8c 100644 --- a/rootly_sdk/models/update_incident_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -18,17 +16,18 @@ class UpdateIncidentEventDataAttributes: """ Attributes: - event (str | Unset): The summary of the incident event - visibility (UpdateIncidentEventDataAttributesVisibility | Unset): The visibility of the incident action item + event (Union[Unset, str]): The summary of the incident event + visibility (Union[Unset, UpdateIncidentEventDataAttributesVisibility]): The visibility of the incident action + item """ - event: str | Unset = UNSET - visibility: UpdateIncidentEventDataAttributesVisibility | Unset = UNSET + event: Unset | str = UNSET + visibility: Unset | UpdateIncidentEventDataAttributesVisibility = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: str | Unset = UNSET + visibility: Unset | str = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -48,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event", UNSET) _visibility = d.pop("visibility", UNSET) - visibility: UpdateIncidentEventDataAttributesVisibility | Unset + visibility: Unset | UpdateIncidentEventDataAttributesVisibility if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/update_incident_event_functionality.py b/rootly_sdk/models/update_incident_event_functionality.py index b7d3a6e7..1991760e 100644 --- a/rootly_sdk/models/update_incident_event_functionality.py +++ b/rootly_sdk/models/update_incident_event_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentEventFunctionality: data (UpdateIncidentEventFunctionalityData): """ - data: UpdateIncidentEventFunctionalityData + data: "UpdateIncidentEventFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_event_functionality_data.py b/rootly_sdk/models/update_incident_event_functionality_data.py index db851cd6..66eacd0d 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data.py +++ b/rootly_sdk/models/update_incident_event_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentEventFunctionalityData: """ type_: UpdateIncidentEventFunctionalityDataType - attributes: UpdateIncidentEventFunctionalityDataAttributes + attributes: "UpdateIncidentEventFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_event_functionality_data_attributes.py b/rootly_sdk/models/update_incident_event_functionality_data_attributes.py index 3dd37190..e036a562 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_functionality_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_event_service.py b/rootly_sdk/models/update_incident_event_service.py index 89e922a7..4c582722 100644 --- a/rootly_sdk/models/update_incident_event_service.py +++ b/rootly_sdk/models/update_incident_event_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentEventService: data (UpdateIncidentEventServiceData): """ - data: UpdateIncidentEventServiceData + data: "UpdateIncidentEventServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_event_service_data.py b/rootly_sdk/models/update_incident_event_service_data.py index df92c39e..39489ed7 100644 --- a/rootly_sdk/models/update_incident_event_service_data.py +++ b/rootly_sdk/models/update_incident_event_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentEventServiceData: """ type_: UpdateIncidentEventServiceDataType - attributes: UpdateIncidentEventServiceDataAttributes + attributes: "UpdateIncidentEventServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_event_service_data_attributes.py b/rootly_sdk/models/update_incident_event_service_data_attributes.py index d5f3207b..0d8cd5d6 100644 --- a/rootly_sdk/models/update_incident_event_service_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_service_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_feedback.py b/rootly_sdk/models/update_incident_feedback.py index ed194100..c74c81a1 100644 --- a/rootly_sdk/models/update_incident_feedback.py +++ b/rootly_sdk/models/update_incident_feedback.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentFeedback: data (UpdateIncidentFeedbackData): """ - data: UpdateIncidentFeedbackData + data: "UpdateIncidentFeedbackData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_feedback_data.py b/rootly_sdk/models/update_incident_feedback_data.py index 540185bc..d8e341a9 100644 --- a/rootly_sdk/models/update_incident_feedback_data.py +++ b/rootly_sdk/models/update_incident_feedback_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentFeedbackData: """ type_: UpdateIncidentFeedbackDataType - attributes: UpdateIncidentFeedbackDataAttributes + attributes: "UpdateIncidentFeedbackDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_feedback_data_attributes.py b/rootly_sdk/models/update_incident_feedback_data_attributes.py index 4d9558c6..952fc058 100644 --- a/rootly_sdk/models/update_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/update_incident_feedback_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -18,19 +16,19 @@ class UpdateIncidentFeedbackDataAttributes: """ Attributes: - feedback (str | Unset): The feedback of the incident feedback - rating (UpdateIncidentFeedbackDataAttributesRating | Unset): The rating of the incident feedback - anonymous (bool | Unset): Is the feedback anonymous? + feedback (Union[Unset, str]): The feedback of the incident feedback + rating (Union[Unset, UpdateIncidentFeedbackDataAttributesRating]): The rating of the incident feedback + anonymous (Union[Unset, bool]): Is the feedback anonymous? """ - feedback: str | Unset = UNSET - rating: UpdateIncidentFeedbackDataAttributesRating | Unset = UNSET - anonymous: bool | Unset = UNSET + feedback: Unset | str = UNSET + rating: Unset | UpdateIncidentFeedbackDataAttributesRating = UNSET + anonymous: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback - rating: int | Unset = UNSET + rating: Unset | int = UNSET if not isinstance(self.rating, Unset): rating = self.rating @@ -54,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: feedback = d.pop("feedback", UNSET) _rating = d.pop("rating", UNSET) - rating: UpdateIncidentFeedbackDataAttributesRating | Unset + rating: Unset | UpdateIncidentFeedbackDataAttributesRating if isinstance(_rating, Unset): rating = UNSET else: diff --git a/rootly_sdk/models/update_incident_form_field_selection.py b/rootly_sdk/models/update_incident_form_field_selection.py index c6ad6546..d26e8ead 100644 --- a/rootly_sdk/models/update_incident_form_field_selection.py +++ b/rootly_sdk/models/update_incident_form_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentFormFieldSelection: data (UpdateIncidentFormFieldSelectionData): """ - data: UpdateIncidentFormFieldSelectionData + data: "UpdateIncidentFormFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_form_field_selection_data.py b/rootly_sdk/models/update_incident_form_field_selection_data.py index 0c574ed7..863405d5 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentFormFieldSelectionData: """ type_: UpdateIncidentFormFieldSelectionDataType - attributes: UpdateIncidentFormFieldSelectionDataAttributes + attributes: "UpdateIncidentFormFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py index db5ea2f0..9f4884c4 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,69 +12,69 @@ class UpdateIncidentFormFieldSelectionDataAttributes: """ Attributes: - value (None | str | Unset): The selected value for text kind custom fields - selected_catalog_entity_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_environment_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ - value: None | str | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + value: None | Unset | str = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - value: None | str | Unset + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -110,12 +108,12 @@ 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_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set.py b/rootly_sdk/models/update_incident_permission_set.py index 0e8ae576..5632a471 100644 --- a/rootly_sdk/models/update_incident_permission_set.py +++ b/rootly_sdk/models/update_incident_permission_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPermissionSet: data (UpdateIncidentPermissionSetData): """ - data: UpdateIncidentPermissionSetData + data: "UpdateIncidentPermissionSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_permission_set_boolean.py b/rootly_sdk/models/update_incident_permission_set_boolean.py index 8f25c582..d8a4cb37 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPermissionSetBoolean: data (UpdateIncidentPermissionSetBooleanData): """ - data: UpdateIncidentPermissionSetBooleanData + data: "UpdateIncidentPermissionSetBooleanData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data.py b/rootly_sdk/models/update_incident_permission_set_boolean_data.py index ea07346a..91b0126a 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentPermissionSetBooleanData: """ type_: UpdateIncidentPermissionSetBooleanDataType - attributes: UpdateIncidentPermissionSetBooleanDataAttributes + attributes: "UpdateIncidentPermissionSetBooleanDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py index 56e4c01d..09ba597e 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -24,20 +22,19 @@ class UpdateIncidentPermissionSetBooleanDataAttributes: """ Attributes: - kind (UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset): - private (bool | Unset): - enabled (bool | Unset): - severity_params (UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset): + kind (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind]): + private (Union[Unset, bool]): + enabled (Union[Unset, bool]): + severity_params (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams]): """ - kind: UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset = UNSET - private: bool | Unset = UNSET - enabled: bool | Unset = UNSET - severity_params: UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset = UNSET + kind: Unset | UpdateIncidentPermissionSetBooleanDataAttributesKind = UNSET + private: Unset | bool = UNSET + enabled: Unset | bool = UNSET + severity_params: Union[Unset, "UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -71,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset + kind: Unset | UpdateIncidentPermissionSetBooleanDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -82,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset + severity_params: Unset | UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py index 15818ae2..1c6c224e 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,18 +13,18 @@ class UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - applies_to_unassigned: bool | Unset = True - create_enabled: bool | Unset = False - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Unset | bool = True + applies_to_unassigned: Unset | bool = True + create_enabled: Unset | bool = False + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: create_enabled = self.create_enabled - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: create_enabled = d.pop("create_enabled", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set_data.py b/rootly_sdk/models/update_incident_permission_set_data.py index df6b990a..36c413c4 100644 --- a/rootly_sdk/models/update_incident_permission_set_data.py +++ b/rootly_sdk/models/update_incident_permission_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentPermissionSetData: """ type_: UpdateIncidentPermissionSetDataType - attributes: UpdateIncidentPermissionSetDataAttributes + attributes: "UpdateIncidentPermissionSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_permission_set_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_data_attributes.py index f084f371..10626000 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,40 +20,49 @@ class UpdateIncidentPermissionSetDataAttributes: """ Attributes: - name (str | Unset): The incident permission set name. - description (None | str | Unset): The incident permission set description. - private_incident_permissions (list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | - Unset): - public_incident_permissions (list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | - Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The incident permission set name. + description (Union[None, Unset, str]): The incident permission set description. + private_incident_permissions (Union[Unset, + list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem]]): + public_incident_permissions (Union[Unset, + list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem]]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET private_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset + Unset | list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] ) = UNSET public_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset + Unset | list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] ) = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: list[str] | Unset = UNSET + private_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: list[str] | Unset = UNSET + public_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -65,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -79,48 +88,51 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) + private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - private_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset - ) = UNSET - if _private_incident_permissions is not UNSET: - private_incident_permissions = [] - for private_incident_permissions_item_data in _private_incident_permissions: - private_incident_permissions_item = ( - check_update_incident_permission_set_data_attributes_private_incident_permissions_item( - private_incident_permissions_item_data - ) + for private_incident_permissions_item_data in _private_incident_permissions or []: + private_incident_permissions_item = ( + check_update_incident_permission_set_data_attributes_private_incident_permissions_item( + private_incident_permissions_item_data ) + ) - private_incident_permissions.append(private_incident_permissions_item) + private_incident_permissions.append(private_incident_permissions_item) + public_incident_permissions = [] _public_incident_permissions = d.pop("public_incident_permissions", UNSET) - public_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset - ) = UNSET - if _public_incident_permissions is not UNSET: - public_incident_permissions = [] - for public_incident_permissions_item_data in _public_incident_permissions: - public_incident_permissions_item = ( - check_update_incident_permission_set_data_attributes_public_incident_permissions_item( - public_incident_permissions_item_data - ) + for public_incident_permissions_item_data in _public_incident_permissions or []: + public_incident_permissions_item = ( + check_update_incident_permission_set_data_attributes_public_incident_permissions_item( + public_incident_permissions_item_data ) + ) - public_incident_permissions.append(public_incident_permissions_item) + public_incident_permissions.append(public_incident_permissions_item) update_incident_permission_set_data_attributes = cls( + slug=slug, name=name, description=description, private_incident_permissions=private_incident_permissions, diff --git a/rootly_sdk/models/update_incident_permission_set_resource.py b/rootly_sdk/models/update_incident_permission_set_resource.py index 954a62ce..f0cec4e5 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource.py +++ b/rootly_sdk/models/update_incident_permission_set_resource.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPermissionSetResource: data (UpdateIncidentPermissionSetResourceData): """ - data: UpdateIncidentPermissionSetResourceData + data: "UpdateIncidentPermissionSetResourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data.py b/rootly_sdk/models/update_incident_permission_set_resource_data.py index 083c9a1b..2f7048c5 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentPermissionSetResourceData: """ type_: UpdateIncidentPermissionSetResourceDataType - attributes: UpdateIncidentPermissionSetResourceDataAttributes + attributes: "UpdateIncidentPermissionSetResourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py index 4a4b6196..a1a06597 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -24,22 +22,21 @@ class UpdateIncidentPermissionSetResourceDataAttributes: """ Attributes: - kind (UpdateIncidentPermissionSetResourceDataAttributesKind | Unset): - private (bool | Unset): - resource_id (str | Unset): - resource_type (str | Unset): - severity_params (UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset): + kind (Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesKind]): + private (Union[Unset, bool]): + resource_id (Union[Unset, str]): + resource_type (Union[Unset, str]): + severity_params (Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesSeverityParams]): """ - kind: UpdateIncidentPermissionSetResourceDataAttributesKind | Unset = UNSET - private: bool | Unset = UNSET - resource_id: str | Unset = UNSET - resource_type: str | Unset = UNSET - severity_params: UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset = UNSET + kind: Unset | UpdateIncidentPermissionSetResourceDataAttributesKind = UNSET + private: Unset | bool = UNSET + resource_id: Unset | str = UNSET + resource_type: Unset | str = UNSET + severity_params: Union[Unset, "UpdateIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -49,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -77,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentPermissionSetResourceDataAttributesKind | Unset + kind: Unset | UpdateIncidentPermissionSetResourceDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource_type = d.pop("resource_type", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset + severity_params: Unset | UpdateIncidentPermissionSetResourceDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py index 68d171f5..eb5ea221 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,18 +13,18 @@ class UpdateIncidentPermissionSetResourceDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - create_enabled: bool | Unset = False - applies_to_unassigned: bool | Unset = True - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Unset | bool = True + create_enabled: Unset | bool = False + applies_to_unassigned: Unset | bool = True + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_post_mortem.py b/rootly_sdk/models/update_incident_post_mortem.py index e5b9b00c..72c00f08 100644 --- a/rootly_sdk/models/update_incident_post_mortem.py +++ b/rootly_sdk/models/update_incident_post_mortem.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPostMortem: data (UpdateIncidentPostMortemData): """ - data: UpdateIncidentPostMortemData + data: "UpdateIncidentPostMortemData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_post_mortem_data.py b/rootly_sdk/models/update_incident_post_mortem_data.py index c37ff215..fd65235d 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data.py +++ b/rootly_sdk/models/update_incident_post_mortem_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentPostMortemData: """ type_: UpdateIncidentPostMortemDataType - attributes: UpdateIncidentPostMortemDataAttributes + attributes: "UpdateIncidentPostMortemDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py index d251d7ec..231645bc 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py +++ b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,61 +16,61 @@ class UpdateIncidentPostMortemDataAttributes: """ Attributes: - title (str | Unset): The title of the incident retrospective - status (UpdateIncidentPostMortemDataAttributesStatus | Unset): The status of the incident retrospective - started_at (None | str | Unset): Date of started at - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - show_timeline (bool | Unset): Show events timeline of the incident retrospective - show_timeline_trail (bool | Unset): Show trail events in the timeline of the incident retrospective - show_timeline_genius (bool | Unset): Show workflow events in the timeline of the incident retrospective - show_timeline_tasks (bool | Unset): Show tasks in the timeline of the incident retrospective - show_timeline_action_items (bool | Unset): Show action items in the timeline of the incident retrospective - show_services_impacted (bool | Unset): Show functionalities impacted of the incident retrospective - show_functionalities_impacted (bool | Unset): Show services impacted of the incident retrospective - show_groups_impacted (bool | Unset): Show groups impacted of the incident retrospective - show_alerts_attached (bool | Unset): Show alerts attached to the incident - show_action_items (bool | Unset): Show action items (follow-ups) in the incident retrospective - cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident retrospective + title (Union[Unset, str]): The title of the incident retrospective + status (Union[Unset, UpdateIncidentPostMortemDataAttributesStatus]): The status of the incident retrospective + started_at (Union[None, Unset, str]): Date of started at + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + show_timeline (Union[Unset, bool]): Show events timeline of the incident retrospective + show_timeline_trail (Union[Unset, bool]): Show trail events in the timeline of the incident retrospective + show_timeline_genius (Union[Unset, bool]): Show workflow events in the timeline of the incident retrospective + show_timeline_tasks (Union[Unset, bool]): Show tasks in the timeline of the incident retrospective + show_timeline_action_items (Union[Unset, bool]): Show action items in the timeline of the incident retrospective + show_services_impacted (Union[Unset, bool]): Show functionalities impacted of the incident retrospective + show_functionalities_impacted (Union[Unset, bool]): Show services impacted of the incident retrospective + show_groups_impacted (Union[Unset, bool]): Show groups impacted of the incident retrospective + show_alerts_attached (Union[Unset, bool]): Show alerts attached to the incident + show_action_items (Union[Unset, bool]): Show action items (follow-ups) in the incident retrospective + cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident retrospective """ - title: str | Unset = UNSET - status: UpdateIncidentPostMortemDataAttributesStatus | Unset = UNSET - started_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - show_timeline: bool | Unset = UNSET - show_timeline_trail: bool | Unset = UNSET - show_timeline_genius: bool | Unset = UNSET - show_timeline_tasks: bool | Unset = UNSET - show_timeline_action_items: bool | Unset = UNSET - show_services_impacted: bool | Unset = UNSET - show_functionalities_impacted: bool | Unset = UNSET - show_groups_impacted: bool | Unset = UNSET - show_alerts_attached: bool | Unset = UNSET - show_action_items: bool | Unset = UNSET - cause_ids: list[str] | None | Unset = UNSET + title: Unset | str = UNSET + status: Unset | UpdateIncidentPostMortemDataAttributesStatus = UNSET + started_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + show_timeline: Unset | bool = UNSET + show_timeline_trail: Unset | bool = UNSET + show_timeline_genius: Unset | bool = UNSET + show_timeline_tasks: Unset | bool = UNSET + show_timeline_action_items: Unset | bool = UNSET + show_services_impacted: Unset | bool = UNSET + show_functionalities_impacted: Unset | bool = UNSET + show_groups_impacted: Unset | bool = UNSET + show_alerts_attached: Unset | bool = UNSET + show_action_items: Unset | bool = UNSET + cause_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: None | str | Unset + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -98,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: show_action_items = self.show_action_items - cause_ids: list[str] | None | Unset + cause_ids: None | Unset | list[str] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -151,36 +149,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: UpdateIncidentPostMortemDataAttributesStatus | Unset + status: Unset | UpdateIncidentPostMortemDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_post_mortem_data_attributes_status(_status) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -204,7 +202,7 @@ def _parse_resolved_at(data: object) -> None | str | Unset: show_action_items = d.pop("show_action_items", UNSET) - def _parse_cause_ids(data: object) -> list[str] | None | Unset: + def _parse_cause_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -215,9 +213,9 @@ def _parse_cause_ids(data: object) -> list[str] | None | Unset: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_postmortem_task_params.py b/rootly_sdk/models/update_incident_postmortem_task_params.py index 5a56484c..8d742a44 100644 --- a/rootly_sdk/models/update_incident_postmortem_task_params.py +++ b/rootly_sdk/models/update_incident_postmortem_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,31 +18,31 @@ class UpdateIncidentPostmortemTaskParams: """ Attributes: postmortem_id (str): UUID of the retrospective that needs to be updated - task_type (UpdateIncidentPostmortemTaskParamsTaskType | Unset): - title (None | str | Unset): The incident title - status (None | str | Unset): + task_type (Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType]): + title (Union[None, Unset, str]): The incident title + status (Union[None, Unset, str]): """ postmortem_id: str - task_type: UpdateIncidentPostmortemTaskParamsTaskType | Unset = UNSET - title: None | str | Unset = UNSET - status: None | str | Unset = UNSET + task_type: Unset | UpdateIncidentPostmortemTaskParamsTaskType = UNSET + title: None | Unset | str = UNSET + status: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: postmortem_id = self.postmortem_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - status: None | str | Unset + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: @@ -72,27 +70,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: postmortem_id = d.pop("postmortem_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateIncidentPostmortemTaskParamsTaskType | Unset + task_type: Unset | UpdateIncidentPostmortemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_incident_postmortem_task_params_task_type(_task_type) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) diff --git a/rootly_sdk/models/update_incident_retrospective_step.py b/rootly_sdk/models/update_incident_retrospective_step.py index 568fd4f2..827c9e77 100644 --- a/rootly_sdk/models/update_incident_retrospective_step.py +++ b/rootly_sdk/models/update_incident_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentRetrospectiveStep: data (UpdateIncidentRetrospectiveStepData): """ - data: UpdateIncidentRetrospectiveStepData + data: "UpdateIncidentRetrospectiveStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_retrospective_step_data.py b/rootly_sdk/models/update_incident_retrospective_step_data.py index 8a5b5a0e..2f3cfdce 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentRetrospectiveStepData: """ type_: UpdateIncidentRetrospectiveStepDataType - attributes: UpdateIncidentRetrospectiveStepDataAttributes + attributes: "UpdateIncidentRetrospectiveStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py index f9ada1a8..9b8c22d6 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,37 +16,38 @@ class UpdateIncidentRetrospectiveStepDataAttributes: """ Attributes: - title (str | Unset): The name of the incident retrospective step - description (None | str | Unset): The description of the incident retrospective step - due_date (None | str | Unset): Due date - position (int | None | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? - status (UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset): Status of the incident retrospective step + title (Union[Unset, str]): The name of the incident retrospective step + description (Union[None, Unset, str]): The description of the incident retrospective step + due_date (Union[None, Unset, str]): Due date + position (Union[None, Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? + status (Union[Unset, UpdateIncidentRetrospectiveStepDataAttributesStatus]): Status of the incident retrospective + step """ - title: str | Unset = UNSET - description: None | str | Unset = UNSET - due_date: None | str | Unset = UNSET - position: int | None | Unset = UNSET - skippable: bool | Unset = UNSET - status: UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset = UNSET + title: Unset | str = UNSET + description: None | Unset | str = UNSET + due_date: None | Unset | str = UNSET + position: None | Unset | int = UNSET + skippable: Unset | bool = UNSET + status: Unset | UpdateIncidentRetrospectiveStepDataAttributesStatus = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_date: None | str | Unset + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -56,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: skippable = self.skippable - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -83,37 +82,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) skippable = d.pop("skippable", UNSET) _status = d.pop("status", UNSET) - status: UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset + status: Unset | UpdateIncidentRetrospectiveStepDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_incident_role.py b/rootly_sdk/models/update_incident_role.py index aa1178fc..49bef496 100644 --- a/rootly_sdk/models/update_incident_role.py +++ b/rootly_sdk/models/update_incident_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentRole: data (UpdateIncidentRoleData): """ - data: UpdateIncidentRoleData + data: "UpdateIncidentRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_role_data.py b/rootly_sdk/models/update_incident_role_data.py index f5dc593f..7265f0ef 100644 --- a/rootly_sdk/models/update_incident_role_data.py +++ b/rootly_sdk/models/update_incident_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentRoleData: """ type_: UpdateIncidentRoleDataType - attributes: UpdateIncidentRoleDataAttributes + attributes: "UpdateIncidentRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_role_data_attributes.py b/rootly_sdk/models/update_incident_role_data_attributes.py index fdac0c55..4282bbfb 100644 --- a/rootly_sdk/models/update_incident_role_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,39 +12,48 @@ class UpdateIncidentRoleDataAttributes: """ Attributes: - name (str | Unset): The name of the incident role - summary (None | str | Unset): The summary of the incident role - description (None | str | Unset): The description of the incident role - position (int | None | Unset): Position of the incident role - optional (bool | Unset): - enabled (bool | Unset): - allow_multi_user_assignment (bool | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the incident role + summary (Union[None, Unset, str]): The summary of the incident role + description (Union[None, Unset, str]): The description of the incident role + position (Union[None, Unset, int]): Position of the incident role + optional (Union[Unset, bool]): + enabled (Union[Unset, bool]): + allow_multi_user_assignment (Union[Unset, bool]): """ - name: str | Unset = UNSET - summary: None | str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - optional: bool | Unset = UNSET - enabled: bool | Unset = UNSET - allow_multi_user_assignment: bool | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + summary: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + optional: Unset | bool = UNSET + enabled: Unset | bool = UNSET + allow_multi_user_assignment: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -61,6 +68,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if summary is not UNSET: @@ -81,32 +90,42 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) @@ -117,6 +136,7 @@ def _parse_position(data: object) -> int | None | Unset: allow_multi_user_assignment = d.pop("allow_multi_user_assignment", UNSET) update_incident_role_data_attributes = cls( + slug=slug, name=name, summary=summary, description=description, diff --git a/rootly_sdk/models/update_incident_role_task.py b/rootly_sdk/models/update_incident_role_task.py index 75837e60..4e894747 100644 --- a/rootly_sdk/models/update_incident_role_task.py +++ b/rootly_sdk/models/update_incident_role_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentRoleTask: data (UpdateIncidentRoleTaskData): """ - data: UpdateIncidentRoleTaskData + data: "UpdateIncidentRoleTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_role_task_data.py b/rootly_sdk/models/update_incident_role_task_data.py index 8d6727b8..e9c545b9 100644 --- a/rootly_sdk/models/update_incident_role_task_data.py +++ b/rootly_sdk/models/update_incident_role_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentRoleTaskData: """ type_: UpdateIncidentRoleTaskDataType - attributes: UpdateIncidentRoleTaskDataAttributes + attributes: "UpdateIncidentRoleTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_role_task_data_attributes.py b/rootly_sdk/models/update_incident_role_task_data_attributes.py index 2fda2b91..877ac36e 100644 --- a/rootly_sdk/models/update_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_task_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,25 +16,25 @@ class UpdateIncidentRoleTaskDataAttributes: """ Attributes: - task (str | Unset): The task of the incident task - description (None | str | Unset): The description of the incident task - priority (UpdateIncidentRoleTaskDataAttributesPriority | Unset): The priority of the incident task + task (Union[Unset, str]): The task of the incident task + description (Union[None, Unset, str]): The description of the incident task + priority (Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority]): The priority of the incident task """ - task: str | Unset = UNSET - description: None | str | Unset = UNSET - priority: UpdateIncidentRoleTaskDataAttributesPriority | Unset = UNSET + task: Unset | str = UNSET + description: None | Unset | str = UNSET + priority: Unset | UpdateIncidentRoleTaskDataAttributesPriority = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -57,17 +55,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: UpdateIncidentRoleTaskDataAttributesPriority | Unset + priority: Unset | UpdateIncidentRoleTaskDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_incident_status_page_event.py b/rootly_sdk/models/update_incident_status_page_event.py index e46300cd..a1a6fb34 100644 --- a/rootly_sdk/models/update_incident_status_page_event.py +++ b/rootly_sdk/models/update_incident_status_page_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentStatusPageEvent: data (UpdateIncidentStatusPageEventData): """ - data: UpdateIncidentStatusPageEventData + data: "UpdateIncidentStatusPageEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_status_page_event_data.py b/rootly_sdk/models/update_incident_status_page_event_data.py index 20277191..1d378c39 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data.py +++ b/rootly_sdk/models/update_incident_status_page_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentStatusPageEventData: """ type_: UpdateIncidentStatusPageEventDataType - attributes: UpdateIncidentStatusPageEventDataAttributes + attributes: "UpdateIncidentStatusPageEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_status_page_event_data_attributes.py b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py index 428524d0..a768cbf3 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,44 +18,44 @@ class UpdateIncidentStatusPageEventDataAttributes: """ Attributes: - event (str | Unset): The summary of the incident event - status_page_id (str | Unset): Unique ID of the status page you wish to post the event to - status (UpdateIncidentStatusPageEventDataAttributesStatus | Unset): The status of the incident event - notify_subscribers (bool | None | Unset): Notify all status pages subscribers Default: False. - should_tweet (bool | None | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update - Default: False. - started_at (datetime.datetime | None | Unset): When the event started. + event (Union[Unset, str]): The summary of the incident event + status_page_id (Union[Unset, str]): Unique ID of the status page you wish to post the event to + status (Union[Unset, UpdateIncidentStatusPageEventDataAttributesStatus]): The status of the incident event + notify_subscribers (Union[None, Unset, bool]): Notify all status pages subscribers Default: False. + should_tweet (Union[None, Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your + update Default: False. + started_at (Union[None, Unset, datetime.datetime]): When the event started. """ - event: str | Unset = UNSET - status_page_id: str | Unset = UNSET - status: UpdateIncidentStatusPageEventDataAttributesStatus | Unset = UNSET - notify_subscribers: bool | None | Unset = False - should_tweet: bool | None | Unset = False - started_at: datetime.datetime | None | Unset = UNSET + event: Unset | str = UNSET + status_page_id: Unset | str = UNSET + status: Unset | UpdateIncidentStatusPageEventDataAttributesStatus = UNSET + notify_subscribers: None | Unset | bool = False + should_tweet: None | Unset | bool = False + started_at: None | Unset | datetime.datetime = UNSET def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: bool | None | Unset + notify_subscribers: None | Unset | bool if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: bool | None | Unset + should_tweet: None | Unset | bool if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -91,31 +89,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: UpdateIncidentStatusPageEventDataAttributesStatus | Unset + status: Unset | UpdateIncidentStatusPageEventDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> bool | None | Unset: + def _parse_should_tweet(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -126,9 +124,9 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) diff --git a/rootly_sdk/models/update_incident_status_timestamp_task_params.py b/rootly_sdk/models/update_incident_status_timestamp_task_params.py index 552fe4a7..dca1d18e 100644 --- a/rootly_sdk/models/update_incident_status_timestamp_task_params.py +++ b/rootly_sdk/models/update_incident_status_timestamp_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class UpdateIncidentStatusTimestampTaskParams: Attributes: sub_status_id (str): Sub-status to update timestamp for assigned_at (str): Timestamp of when the sub-status was assigned - task_type (UpdateIncidentStatusTimestampTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType]): """ sub_status_id: str assigned_at: str - task_type: UpdateIncidentStatusTimestampTaskParamsTaskType | Unset = UNSET + task_type: Unset | UpdateIncidentStatusTimestampTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") _task_type = d.pop("task_type", UNSET) - task_type: UpdateIncidentStatusTimestampTaskParamsTaskType | Unset + task_type: Unset | UpdateIncidentStatusTimestampTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_incident_sub_status.py b/rootly_sdk/models/update_incident_sub_status.py index edbfd091..1e107b9b 100644 --- a/rootly_sdk/models/update_incident_sub_status.py +++ b/rootly_sdk/models/update_incident_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentSubStatus: data (UpdateIncidentSubStatusData): """ - data: UpdateIncidentSubStatusData + data: "UpdateIncidentSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_sub_status_data.py b/rootly_sdk/models/update_incident_sub_status_data.py index cf6a906f..36c0e79c 100644 --- a/rootly_sdk/models/update_incident_sub_status_data.py +++ b/rootly_sdk/models/update_incident_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentSubStatusData: """ type_: UpdateIncidentSubStatusDataType - attributes: UpdateIncidentSubStatusDataAttributes + attributes: "UpdateIncidentSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_sub_status_data_attributes.py b/rootly_sdk/models/update_incident_sub_status_data_attributes.py index b3b42330..bac58bb0 100644 --- a/rootly_sdk/models/update_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_incident_sub_status_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,23 +12,23 @@ class UpdateIncidentSubStatusDataAttributes: """ Attributes: - sub_status_id (str | Unset): Note: To change an incident's sub-status, use the PATCH /incidents/:id endpoint and - set the sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's sub-status - was assigned. - assigned_at (str | Unset): - assigned_by_user_id (int | None | Unset): + sub_status_id (Union[Unset, str]): Note: To change an incident's sub-status, use the PATCH /incidents/:id + endpoint and set the sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's + sub-status was assigned. + assigned_at (Union[Unset, str]): + assigned_by_user_id (Union[None, Unset, int]): """ - sub_status_id: str | Unset = UNSET - assigned_at: str | Unset = UNSET - assigned_by_user_id: int | None | Unset = UNSET + sub_status_id: Unset | str = UNSET + assigned_at: Unset | str = UNSET + assigned_by_user_id: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: int | None | Unset + assigned_by_user_id: None | Unset | int if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -55,12 +53,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at", UNSET) - def _parse_assigned_by_user_id(data: object) -> int | None | Unset: + def _parse_assigned_by_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/update_incident_task_params.py b/rootly_sdk/models/update_incident_task_params.py index e2d5cdc3..65baa1d0 100644 --- a/rootly_sdk/models/update_incident_task_params.py +++ b/rootly_sdk/models/update_incident_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,84 +22,84 @@ class UpdateIncidentTaskParams: """ Attributes: incident_id (str): The incident id to update or id of any attribute on the incident - task_type (UpdateIncidentTaskParamsTaskType | Unset): - attribute_to_query_by (UpdateIncidentTaskParamsAttributeToQueryBy | Unset): Default: 'id'. - title (None | str | Unset): The incident title - summary (None | str | Unset): The incident summary - status (None | str | Unset): - severity_id (None | str | Unset): - incident_type_ids (list[str] | None | Unset): - service_ids (list[str] | None | Unset): Array of service UUIDs - functionality_ids (list[str] | None | Unset): Array of functionality UUIDs - environment_ids (list[str] | None | Unset): - group_ids (list[str] | None | Unset): Array of group/team UUIDs - started_at (None | str | Unset): - detected_at (None | str | Unset): - acknowledged_at (None | str | Unset): - mitigated_at (None | str | Unset): - resolved_at (None | str | Unset): - private (bool | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateIncidentTaskParamsTaskType]): + attribute_to_query_by (Union[Unset, UpdateIncidentTaskParamsAttributeToQueryBy]): Default: 'id'. + title (Union[None, Unset, str]): The incident title + summary (Union[None, Unset, str]): The incident summary + status (Union[None, Unset, str]): + severity_id (Union[None, Unset, str]): + incident_type_ids (Union[None, Unset, list[str]]): + service_ids (Union[None, Unset, list[str]]): Array of service UUIDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality UUIDs + environment_ids (Union[None, Unset, list[str]]): + group_ids (Union[None, Unset, list[str]]): Array of group/team UUIDs + started_at (Union[None, Unset, str]): + detected_at (Union[None, Unset, str]): + acknowledged_at (Union[None, Unset, str]): + mitigated_at (Union[None, Unset, str]): + resolved_at (Union[None, Unset, str]): + private (Union[Unset, bool]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON. Use 'services', 'functionalities', or 'groups' keys with arrays of names/slugs for name/slug lookup """ incident_id: str - task_type: UpdateIncidentTaskParamsTaskType | Unset = UNSET - attribute_to_query_by: UpdateIncidentTaskParamsAttributeToQueryBy | Unset = "id" - title: None | str | Unset = UNSET - summary: None | str | Unset = UNSET - status: None | str | Unset = UNSET - severity_id: None | str | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - private: bool | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Unset | UpdateIncidentTaskParamsTaskType = UNSET + attribute_to_query_by: Unset | UpdateIncidentTaskParamsAttributeToQueryBy = "id" + title: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + status: None | Unset | str = UNSET + severity_id: None | Unset | str = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + private: Unset | bool = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: str | Unset = UNSET + attribute_to_query_by: Unset | str = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - title: None | str | Unset + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: None | str | Unset + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: status = self.status - severity_id: None | str | Unset + severity_id: None | Unset | str if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -110,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -119,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -128,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -137,7 +135,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -146,31 +144,31 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -178,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: private = self.private - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -236,56 +234,56 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_id = d.pop("incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateIncidentTaskParamsTaskType | Unset + task_type: Unset | UpdateIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_incident_task_params_task_type(_task_type) _attribute_to_query_by = d.pop("attribute_to_query_by", UNSET) - attribute_to_query_by: UpdateIncidentTaskParamsAttributeToQueryBy | Unset + attribute_to_query_by: Unset | UpdateIncidentTaskParamsAttributeToQueryBy if isinstance(_attribute_to_query_by, Unset): attribute_to_query_by = UNSET else: attribute_to_query_by = check_update_incident_task_params_attribute_to_query_by(_attribute_to_query_by) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_severity_id(data: object) -> None | str | Unset: + def _parse_severity_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -296,13 +294,13 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -313,13 +311,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -330,13 +328,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -347,13 +345,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -364,65 +362,65 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_incident_type.py b/rootly_sdk/models/update_incident_type.py index 8438b01e..5f929508 100644 --- a/rootly_sdk/models/update_incident_type.py +++ b/rootly_sdk/models/update_incident_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentType: data (UpdateIncidentTypeData): """ - data: UpdateIncidentTypeData + data: "UpdateIncidentTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_type_data.py b/rootly_sdk/models/update_incident_type_data.py index 5cde01d3..db52b409 100644 --- a/rootly_sdk/models/update_incident_type_data.py +++ b/rootly_sdk/models/update_incident_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentTypeData: """ type_: UpdateIncidentTypeDataType - attributes: UpdateIncidentTypeDataAttributes + attributes: "UpdateIncidentTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_type_data_attributes.py b/rootly_sdk/models/update_incident_type_data_attributes.py index 20fabf5e..4559b0ec 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes.py +++ b/rootly_sdk/models/update_incident_type_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -26,51 +24,67 @@ class UpdateIncidentTypeDataAttributes: """ Attributes: - name (str | Unset): The name of the incident type - description (None | str | Unset): The description of the incident type - color (None | str | Unset): The hex color of the incident type - position (int | None | Unset): Position of the incident type - notify_emails (list[str] | None | Unset): Emails to attach to the incident type - slack_channels (list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this incident type - slack_aliases (list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the incident type + description (Union[None, Unset, str]): The description of the incident type + public_description (Union[None, Unset, str]): The status page description of the incident type + color (Union[None, Unset, str]): The hex color of the incident type + position (Union[None, Unset, int]): Position of the incident type + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the incident type + slack_channels (Union[None, Unset, list['UpdateIncidentTypeDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this incident type + slack_aliases (Union[None, Unset, list['UpdateIncidentTypeDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this incident type - properties (list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset): Array of property values for this - incident type. + properties (Union[Unset, list['UpdateIncidentTypeDataAttributesPropertiesItem']]): Array of property values for + this incident type. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["UpdateIncidentTypeDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -79,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -91,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -103,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -113,10 +127,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -145,36 +163,55 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -185,15 +222,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -211,15 +248,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -237,24 +274,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_incident_type_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py b/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py index b4e47094..de4e59f0 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py index 749e159c..8d6b5b13 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py index 549b1658..b62bba36 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_jira_issue_task_params.py b/rootly_sdk/models/update_jira_issue_task_params.py index e4ae6cf7..05e65d09 100644 --- a/rootly_sdk/models/update_jira_issue_task_params.py +++ b/rootly_sdk/models/update_jira_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,49 +25,54 @@ class UpdateJiraIssueTaskParams: Attributes: issue_id (str): The issue id project_key (str): The project key - task_type (UpdateJiraIssueTaskParamsTaskType | Unset): - integration (UpdateJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have more than one - Jira instance - title (str | Unset): The issue title - description (str | Unset): The issue description - labels (str | Unset): The issue labels - assign_user_email (str | Unset): The assigned user's email - reporter_user_email (str | Unset): The reporter user's email - due_date (str | Unset): The due date - priority (UpdateJiraIssueTaskParamsPriority | Unset): The priority id and display name - status (UpdateJiraIssueTaskParamsStatus | Unset): The status id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateJiraIssueTaskParamsTaskType]): + integration (Union[Unset, UpdateJiraIssueTaskParamsIntegration]): Specify integration id if you have more than + one Jira instance + title (Union[Unset, str]): The issue title + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + assign_user_email (Union[Unset, str]): The assigned user's email + reporter_user_email (Union[Unset, str]): The reporter user's email + due_date (Union[Unset, str]): The due date + priority (Union[Unset, UpdateJiraIssueTaskParamsPriority]): The priority id and display name + status (Union[Unset, UpdateJiraIssueTaskParamsStatus]): The status id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + update_payload (Union[None, Unset, str]): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (Union[Unset, int]): Number of times to retry on rate-limit (HTTP 429) responses (0-4). 0 disables + retry. Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ issue_id: str project_key: str - task_type: UpdateJiraIssueTaskParamsTaskType | Unset = UNSET - integration: UpdateJiraIssueTaskParamsIntegration | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - reporter_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - priority: UpdateJiraIssueTaskParamsPriority | Unset = UNSET - status: UpdateJiraIssueTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - update_payload: None | str | Unset = UNSET + task_type: Unset | UpdateJiraIssueTaskParamsTaskType = UNSET + integration: Union[Unset, "UpdateJiraIssueTaskParamsIntegration"] = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + reporter_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + priority: Union[Unset, "UpdateJiraIssueTaskParamsPriority"] = UNSET + status: Union[Unset, "UpdateJiraIssueTaskParamsStatus"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + update_payload: None | Unset | str = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id project_key = self.project_key - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -85,26 +88,30 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | str | Unset + update_payload: None | Unset | str if isinstance(self.update_payload, Unset): update_payload = UNSET else: update_payload = self.update_payload + retry_count = self.retry_count + + retry_wait_time = self.retry_wait_time + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -137,6 +144,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_fields_mapping"] = custom_fields_mapping if update_payload is not UNSET: field_dict["update_payload"] = update_payload + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if retry_wait_time is not UNSET: + field_dict["retry_wait_time"] = retry_wait_time return field_dict @@ -152,14 +163,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_key = d.pop("project_key") _task_type = d.pop("task_type", UNSET) - task_type: UpdateJiraIssueTaskParamsTaskType | Unset + task_type: Unset | UpdateJiraIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: UpdateJiraIssueTaskParamsIntegration | Unset + integration: Unset | UpdateJiraIssueTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -178,37 +189,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateJiraIssueTaskParamsPriority | Unset + priority: Unset | UpdateJiraIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: UpdateJiraIssueTaskParamsStatus | Unset + status: Unset | UpdateJiraIssueTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = UpdateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | str | Unset: + def _parse_update_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + update_jira_issue_task_params = cls( issue_id=issue_id, project_key=project_key, @@ -224,6 +239,8 @@ def _parse_update_payload(data: object) -> None | str | Unset: status=status, custom_fields_mapping=custom_fields_mapping, update_payload=update_payload, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) update_jira_issue_task_params.additional_properties = d diff --git a/rootly_sdk/models/update_jira_issue_task_params_integration.py b/rootly_sdk/models/update_jira_issue_task_params_integration.py index 1e6f0b85..238ad0fc 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/update_jira_issue_task_params_integration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_jira_issue_task_params_priority.py b/rootly_sdk/models/update_jira_issue_task_params_priority.py index da36b28e..f932d3d4 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/update_jira_issue_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateJiraIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_jira_issue_task_params_status.py b/rootly_sdk/models/update_jira_issue_task_params_status.py index 83ca7fdf..f7e32704 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_status.py +++ b/rootly_sdk/models/update_jira_issue_task_params_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateJiraIssueTaskParamsStatus: """The status id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params.py b/rootly_sdk/models/update_linear_issue_task_params.py index 555aca6c..6f7c3236 100644 --- a/rootly_sdk/models/update_linear_issue_task_params.py +++ b/rootly_sdk/models/update_linear_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,28 +25,28 @@ class UpdateLinearIssueTaskParams: """ Attributes: issue_id (str): The issue id - task_type (UpdateLinearIssueTaskParamsTaskType | Unset): - title (str | Unset): The issue title - description (str | Unset): The issue description - state (None | Unset | UpdateLinearIssueTaskParamsStateType0): The state id and display name - project (UpdateLinearIssueTaskParamsProject | Unset): The project id and display name - labels (list[UpdateLinearIssueTaskParamsLabelsItem] | Unset): - priority (UpdateLinearIssueTaskParamsPriority | Unset): The priority id and display name - assign_user_email (str | Unset): The assigned user's email - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateLinearIssueTaskParamsTaskType]): + title (Union[Unset, str]): The issue title + description (Union[Unset, str]): The issue description + state (Union['UpdateLinearIssueTaskParamsStateType0', None, Unset]): The state id and display name + project (Union[Unset, UpdateLinearIssueTaskParamsProject]): The project id and display name + labels (Union[Unset, list['UpdateLinearIssueTaskParamsLabelsItem']]): + priority (Union[Unset, UpdateLinearIssueTaskParamsPriority]): The priority id and display name + assign_user_email (Union[Unset, str]): The assigned user's email + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ issue_id: str - task_type: UpdateLinearIssueTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - state: None | Unset | UpdateLinearIssueTaskParamsStateType0 = UNSET - project: UpdateLinearIssueTaskParamsProject | Unset = UNSET - labels: list[UpdateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - priority: UpdateLinearIssueTaskParamsPriority | Unset = UNSET - assign_user_email: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Unset | UpdateLinearIssueTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + state: Union["UpdateLinearIssueTaskParamsStateType0", None, Unset] = UNSET + project: Union[Unset, "UpdateLinearIssueTaskParamsProject"] = UNSET + labels: Unset | list["UpdateLinearIssueTaskParamsLabelsItem"] = UNSET + priority: Union[Unset, "UpdateLinearIssueTaskParamsPriority"] = UNSET + assign_user_email: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: issue_id = self.issue_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - state: dict[str, Any] | None | Unset + state: None | Unset | dict[str, Any] if isinstance(self.state, Unset): state = UNSET elif isinstance(self.state, UpdateLinearIssueTaskParamsStateType0): @@ -72,24 +70,24 @@ def to_dict(self) -> dict[str, Any]: else: state = self.state - project: dict[str, Any] | Unset = UNSET + project: Unset | dict[str, Any] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -134,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_id = d.pop("issue_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateLinearIssueTaskParamsTaskType | Unset + task_type: Unset | UpdateLinearIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -144,7 +142,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStateType0: + def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -155,30 +153,28 @@ def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStat state_type_0 = UpdateLinearIssueTaskParamsStateType0.from_dict(data) return state_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateLinearIssueTaskParamsStateType0, data) + return cast(Union["UpdateLinearIssueTaskParamsStateType0", None, Unset], data) state = _parse_state(d.pop("state", UNSET)) _project = d.pop("project", UNSET) - project: UpdateLinearIssueTaskParamsProject | Unset + project: Unset | UpdateLinearIssueTaskParamsProject if isinstance(_project, Unset): project = UNSET else: project = UpdateLinearIssueTaskParamsProject.from_dict(_project) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[UpdateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = UpdateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = UpdateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: UpdateLinearIssueTaskParamsPriority | Unset + priority: Unset | UpdateLinearIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -186,12 +182,12 @@ def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStat assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_linear_issue_task_params_labels_item.py b/rootly_sdk/models/update_linear_issue_task_params_labels_item.py index 79c23c9d..244efd9a 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_labels_item.py +++ b/rootly_sdk/models/update_linear_issue_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateLinearIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_priority.py b/rootly_sdk/models/update_linear_issue_task_params_priority.py index f4b9cfd4..4ca581ca 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/update_linear_issue_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateLinearIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_project.py b/rootly_sdk/models/update_linear_issue_task_params_project.py index d10f9177..7bea360a 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_project.py +++ b/rootly_sdk/models/update_linear_issue_task_params_project.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateLinearIssueTaskParamsProject: """The project id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py b/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py index e5b7c643..b18324bb 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py +++ b/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateLinearIssueTaskParamsStateType0: """The state id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_live_call_router.py b/rootly_sdk/models/update_live_call_router.py index d9316b3a..ab09a49a 100644 --- a/rootly_sdk/models/update_live_call_router.py +++ b/rootly_sdk/models/update_live_call_router.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateLiveCallRouter: data (UpdateLiveCallRouterData): """ - data: UpdateLiveCallRouterData + data: "UpdateLiveCallRouterData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_live_call_router_data.py b/rootly_sdk/models/update_live_call_router_data.py index 648e051f..1fdba004 100644 --- a/rootly_sdk/models/update_live_call_router_data.py +++ b/rootly_sdk/models/update_live_call_router_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateLiveCallRouterData: """ type_: UpdateLiveCallRouterDataType - attributes: UpdateLiveCallRouterDataAttributes + attributes: "UpdateLiveCallRouterDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_live_call_router_data_attributes.py b/rootly_sdk/models/update_live_call_router_data_attributes.py index c84e7ad7..e6799896 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -39,62 +37,69 @@ class UpdateLiveCallRouterDataAttributes: """ Attributes: - kind (UpdateLiveCallRouterDataAttributesKind | Unset): The kind of the live_call_router - enabled (bool | Unset): Whether the live_call_router is enabled - name (str | Unset): The name of the live_call_router - country_code (UpdateLiveCallRouterDataAttributesCountryCode | Unset): The country code of the live_call_router - phone_type (UpdateLiveCallRouterDataAttributesPhoneType | Unset): The phone type of the live_call_router - voicemail_greeting (str | Unset): The voicemail greeting of the live_call_router - caller_greeting (str | Unset): The caller greeting message of the live_call_router - unavailable_responder_message (None | str | Unset): The message played to the caller when a responder doesn't - answer and the call moves on to the next person in the escalation. Leave blank to use the default message. - waiting_music_url (UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset): The waiting music URL of the + kind (Union[Unset, UpdateLiveCallRouterDataAttributesKind]): The kind of the live_call_router + enabled (Union[Unset, bool]): Whether the live_call_router is enabled + name (Union[Unset, str]): The name of the live_call_router + country_code (Union[Unset, UpdateLiveCallRouterDataAttributesCountryCode]): The country code of the live_call_router - sent_to_voicemail_delay (int | Unset): The delay (seconds) after which the caller in redirected to voicemail - should_redirect_to_voicemail_on_no_answer (bool | Unset): This prompts the caller to choose voicemail or connect - live - escalation_level_delay_in_seconds (int | Unset): This overrides the delay (seconds) in escalation levels - should_auto_resolve_alert_on_call_end (bool | Unset): This overrides the delay (seconds) in escalation levels - notify_via_sms (bool | Unset): Whether responders are also notified via SMS when this router pages them - notify_via_push_notification (bool | Unset): Whether responders are also notified via push notification when - this router pages them - informational_notification_message (None | str | Unset): Optional message included in the SMS/push notification. - Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name }}. - alert_urgency_id (str | Unset): This is used in escalation paths to determine who to page - calling_tree_enabled (bool | Unset): Whether the live call router is configured as a phone tree, requiring + phone_type (Union[Unset, UpdateLiveCallRouterDataAttributesPhoneType]): The phone type of the live_call_router + voicemail_greeting (Union[Unset, str]): The voicemail greeting of the live_call_router + caller_greeting (Union[Unset, str]): The caller greeting message of the live_call_router + unavailable_responder_message (Union[None, Unset, str]): The message played to the caller when a responder + doesn't answer and the call moves on to the next person in the escalation. Leave blank to use the default + message. + waiting_music_url (Union[Unset, UpdateLiveCallRouterDataAttributesWaitingMusicUrl]): The waiting music URL of + the live_call_router + sent_to_voicemail_delay (Union[Unset, int]): The delay (seconds) after which the caller in redirected to + voicemail + should_redirect_to_voicemail_on_no_answer (Union[Unset, bool]): This prompts the caller to choose voicemail or + connect live + escalation_level_delay_in_seconds (Union[Unset, int]): This overrides the delay (seconds) in escalation levels + should_auto_resolve_alert_on_call_end (Union[Unset, bool]): This overrides the delay (seconds) in escalation + levels + notify_via_sms (Union[Unset, bool]): Whether responders are also notified via SMS when this router pages them + notify_via_push_notification (Union[Unset, bool]): Whether responders are also notified via push notification + when this router pages them + informational_notification_message (Union[None, Unset, str]): Optional message included in the SMS/push + notification. Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name + }}. + alert_urgency_id (Union[Unset, str]): This is used in escalation paths to determine who to page + calling_tree_enabled (Union[Unset, bool]): Whether the live call router is configured as a phone tree, requiring callers to press a key before being connected - calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, + calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - paging_targets (list[UpdateLiveCallRouterDataAttributesPagingTargetsItem] | Unset): Paging targets that callers - can select from when this live call router is configured as a phone tree. - escalation_policy_trigger_params (UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset): + paging_targets (Union[Unset, list['UpdateLiveCallRouterDataAttributesPagingTargetsItem']]): Paging targets that + callers can select from when this live call router is configured as a phone tree. + escalation_policy_trigger_params (Union[Unset, + UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams]): """ - kind: UpdateLiveCallRouterDataAttributesKind | Unset = UNSET - enabled: bool | Unset = UNSET - name: str | Unset = UNSET - country_code: UpdateLiveCallRouterDataAttributesCountryCode | Unset = UNSET - phone_type: UpdateLiveCallRouterDataAttributesPhoneType | Unset = UNSET - voicemail_greeting: str | Unset = UNSET - caller_greeting: str | Unset = UNSET - unavailable_responder_message: None | str | Unset = UNSET - waiting_music_url: UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset = UNSET - sent_to_voicemail_delay: int | Unset = UNSET - should_redirect_to_voicemail_on_no_answer: bool | Unset = UNSET - escalation_level_delay_in_seconds: int | Unset = UNSET - should_auto_resolve_alert_on_call_end: bool | Unset = UNSET - notify_via_sms: bool | Unset = UNSET - notify_via_push_notification: bool | Unset = UNSET - informational_notification_message: None | str | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - calling_tree_enabled: bool | Unset = UNSET - calling_tree_prompt: str | Unset = UNSET - paging_targets: list[UpdateLiveCallRouterDataAttributesPagingTargetsItem] | Unset = UNSET - escalation_policy_trigger_params: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset = UNSET + kind: Unset | UpdateLiveCallRouterDataAttributesKind = UNSET + enabled: Unset | bool = UNSET + name: Unset | str = UNSET + country_code: Unset | UpdateLiveCallRouterDataAttributesCountryCode = UNSET + phone_type: Unset | UpdateLiveCallRouterDataAttributesPhoneType = UNSET + voicemail_greeting: Unset | str = UNSET + caller_greeting: Unset | str = UNSET + unavailable_responder_message: None | Unset | str = UNSET + waiting_music_url: Unset | UpdateLiveCallRouterDataAttributesWaitingMusicUrl = UNSET + sent_to_voicemail_delay: Unset | int = UNSET + should_redirect_to_voicemail_on_no_answer: Unset | bool = UNSET + escalation_level_delay_in_seconds: Unset | int = UNSET + should_auto_resolve_alert_on_call_end: Unset | bool = UNSET + notify_via_sms: Unset | bool = UNSET + notify_via_push_notification: Unset | bool = UNSET + informational_notification_message: None | Unset | str = UNSET + alert_urgency_id: Unset | str = UNSET + calling_tree_enabled: Unset | bool = UNSET + calling_tree_prompt: Unset | str = UNSET + paging_targets: Unset | list["UpdateLiveCallRouterDataAttributesPagingTargetsItem"] = UNSET + escalation_policy_trigger_params: Union[ + Unset, "UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams" + ] = UNSET def to_dict(self) -> dict[str, Any]: - - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -102,11 +107,11 @@ def to_dict(self) -> dict[str, Any]: name = self.name - country_code: str | Unset = UNSET + country_code: Unset | str = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: str | Unset = UNSET + phone_type: Unset | str = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -114,13 +119,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | str | Unset + unavailable_responder_message: None | Unset | str if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: str | Unset = UNSET + waiting_music_url: Unset | str = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -136,7 +141,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | str | Unset + informational_notification_message: None | Unset | str if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -148,14 +153,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: list[dict[str, Any]] | Unset = UNSET + paging_targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.paging_targets, Unset): paging_targets = [] for paging_targets_item_data in self.paging_targets: paging_targets_item = paging_targets_item_data.to_dict() paging_targets.append(paging_targets_item) - escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET + escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -218,7 +223,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: UpdateLiveCallRouterDataAttributesKind | Unset + kind: Unset | UpdateLiveCallRouterDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -229,14 +234,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _country_code = d.pop("country_code", UNSET) - country_code: UpdateLiveCallRouterDataAttributesCountryCode | Unset + country_code: Unset | UpdateLiveCallRouterDataAttributesCountryCode if isinstance(_country_code, Unset): country_code = UNSET else: country_code = check_update_live_call_router_data_attributes_country_code(_country_code) _phone_type = d.pop("phone_type", UNSET) - phone_type: UpdateLiveCallRouterDataAttributesPhoneType | Unset + phone_type: Unset | UpdateLiveCallRouterDataAttributesPhoneType if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -246,19 +251,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> None | str | Unset: + def _parse_unavailable_responder_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset + waiting_music_url: Unset | UpdateLiveCallRouterDataAttributesWaitingMusicUrl if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -276,12 +281,12 @@ def _parse_unavailable_responder_message(data: object) -> None | str | Unset: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | str | Unset: + def _parse_informational_notification_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -293,19 +298,17 @@ def _parse_informational_notification_message(data: object) -> None | str | Unse calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) + paging_targets = [] _paging_targets = d.pop("paging_targets", UNSET) - paging_targets: list[UpdateLiveCallRouterDataAttributesPagingTargetsItem] | Unset = UNSET - if _paging_targets is not UNSET: - paging_targets = [] - for paging_targets_item_data in _paging_targets: - paging_targets_item = UpdateLiveCallRouterDataAttributesPagingTargetsItem.from_dict( - paging_targets_item_data - ) + for paging_targets_item_data in _paging_targets or []: + paging_targets_item = UpdateLiveCallRouterDataAttributesPagingTargetsItem.from_dict( + paging_targets_item_data + ) - paging_targets.append(paging_targets_item) + paging_targets.append(paging_targets_item) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset + escalation_policy_trigger_params: Unset | UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py b/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py index 319b895f..95a1f5e9 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py b/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py index 2fc7b043..d3526da7 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_motion_task_task_params.py b/rootly_sdk/models/update_motion_task_task_params.py index 4ea29079..47b708b5 100644 --- a/rootly_sdk/models/update_motion_task_task_params.py +++ b/rootly_sdk/models/update_motion_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,30 +22,29 @@ class UpdateMotionTaskTaskParams: """ Attributes: task_id (str): The task id - task_type (UpdateMotionTaskTaskParamsTaskType | Unset): - title (str | Unset): The task title - description (str | Unset): The task description - labels (list[str] | Unset): - priority (UpdateMotionTaskTaskParamsPriority | Unset): The priority id and display name - duration (str | Unset): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. - due_date (str | Unset): The due date + task_type (Union[Unset, UpdateMotionTaskTaskParamsTaskType]): + title (Union[Unset, str]): The task title + description (Union[Unset, str]): The task description + labels (Union[Unset, list[str]]): + priority (Union[Unset, UpdateMotionTaskTaskParamsPriority]): The priority id and display name + duration (Union[Unset, str]): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. + due_date (Union[Unset, str]): The due date """ task_id: str - task_type: UpdateMotionTaskTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: list[str] | Unset = UNSET - priority: UpdateMotionTaskTaskParamsPriority | Unset = UNSET - duration: str | Unset = UNSET - due_date: str | Unset = UNSET + task_type: Unset | UpdateMotionTaskTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | list[str] = UNSET + priority: Union[Unset, "UpdateMotionTaskTaskParamsPriority"] = UNSET + duration: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,11 +52,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - labels: list[str] | Unset = UNSET + labels: Unset | list[str] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -99,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: task_id = d.pop("task_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateMotionTaskTaskParamsTaskType | Unset + task_type: Unset | UpdateMotionTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -112,7 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels = cast(list[str], d.pop("labels", UNSET)) _priority = d.pop("priority", UNSET) - priority: UpdateMotionTaskTaskParamsPriority | Unset + priority: Unset | UpdateMotionTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_motion_task_task_params_priority.py b/rootly_sdk/models/update_motion_task_task_params_priority.py index 20e79aec..54667733 100644 --- a/rootly_sdk/models/update_motion_task_task_params_priority.py +++ b/rootly_sdk/models/update_motion_task_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateMotionTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_notion_page_task_params.py b/rootly_sdk/models/update_notion_page_task_params.py index 89bd9a23..bfc0e927 100644 --- a/rootly_sdk/models/update_notion_page_task_params.py +++ b/rootly_sdk/models/update_notion_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,28 +18,28 @@ class UpdateNotionPageTaskParams: """ Attributes: file_id (str): The Notion page ID - task_type (UpdateNotionPageTaskParamsTaskType | Unset): - title (str | Unset): The Notion page title - post_mortem_template_id (str | Unset): Retrospective template to use when creating page task, if desired - content (str | Unset): Custom page content with liquid templating support. When provided, only this content will - be rendered (no default sections) - show_timeline_as_table (bool | Unset): - show_action_items_as_table (bool | Unset): + task_type (Union[Unset, UpdateNotionPageTaskParamsTaskType]): + title (Union[Unset, str]): The Notion page title + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page task, if desired + content (Union[Unset, str]): Custom page content with liquid templating support. When provided, only this + content will be rendered (no default sections) + show_timeline_as_table (Union[Unset, bool]): + show_action_items_as_table (Union[Unset, bool]): """ file_id: str - task_type: UpdateNotionPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - content: str | Unset = UNSET - show_timeline_as_table: bool | Unset = UNSET - show_action_items_as_table: bool | Unset = UNSET + task_type: Unset | UpdateNotionPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + content: Unset | str = UNSET + show_timeline_as_table: Unset | bool = UNSET + show_action_items_as_table: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -83,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateNotionPageTaskParamsTaskType | Unset + task_type: Unset | UpdateNotionPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_on_call_pay_report.py b/rootly_sdk/models/update_on_call_pay_report.py index 932f9471..c1ca2b46 100644 --- a/rootly_sdk/models/update_on_call_pay_report.py +++ b/rootly_sdk/models/update_on_call_pay_report.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOnCallPayReport: data (UpdateOnCallPayReportData): """ - data: UpdateOnCallPayReportData + data: "UpdateOnCallPayReportData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_on_call_pay_report_data.py b/rootly_sdk/models/update_on_call_pay_report_data.py index c25845dc..ff717150 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data.py +++ b/rootly_sdk/models/update_on_call_pay_report_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateOnCallPayReportData: """ type_: UpdateOnCallPayReportDataType - attributes: UpdateOnCallPayReportDataAttributes + attributes: "UpdateOnCallPayReportDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_on_call_pay_report_data_attributes.py b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py index 513508f2..3b473545 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data_attributes.py +++ b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,30 +14,30 @@ class UpdateOnCallPayReportDataAttributes: """ Attributes: - start_date (datetime.date | Unset): The start date for the report period. - end_date (datetime.date | Unset): The end date for the report period. - schedule_ids (list[str] | Unset): List of schedule UUIDs to scope the report. - time_zone (str | Unset): IANA timezone used to compute day and weekend boundaries. - use_responders_time_zone (bool | Unset): When true, day and weekend boundaries are computed in each responder's - personal timezone instead of the report-wide timezone. + start_date (Union[Unset, datetime.date]): The start date for the report period. + end_date (Union[Unset, datetime.date]): The end date for the report period. + schedule_ids (Union[Unset, list[str]]): List of schedule UUIDs to scope the report. + time_zone (Union[Unset, str]): IANA timezone used to compute day and weekend boundaries. + use_responders_time_zone (Union[Unset, bool]): When true, day and weekend boundaries are computed in each + responder's personal timezone instead of the report-wide timezone. """ - start_date: datetime.date | Unset = UNSET - end_date: datetime.date | Unset = UNSET - schedule_ids: list[str] | Unset = UNSET - time_zone: str | Unset = UNSET - use_responders_time_zone: bool | Unset = UNSET + start_date: Unset | datetime.date = UNSET + end_date: Unset | datetime.date = UNSET + schedule_ids: Unset | list[str] = UNSET + time_zone: Unset | str = UNSET + use_responders_time_zone: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - start_date: str | Unset = UNSET + start_date: Unset | str = UNSET if not isinstance(self.start_date, Unset): start_date = self.start_date.isoformat() - end_date: str | Unset = UNSET + end_date: Unset | str = UNSET if not isinstance(self.end_date, Unset): end_date = self.end_date.isoformat() - schedule_ids: list[str] | Unset = UNSET + schedule_ids: Unset | list[str] = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids @@ -67,14 +65,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_date = d.pop("start_date", UNSET) - start_date: datetime.date | Unset + start_date: Unset | datetime.date if isinstance(_start_date, Unset): start_date = UNSET else: start_date = isoparse(_start_date).date() _end_date = d.pop("end_date", UNSET) - end_date: datetime.date | Unset + end_date: Unset | datetime.date if isinstance(_end_date, Unset): end_date = UNSET else: diff --git a/rootly_sdk/models/update_on_call_role.py b/rootly_sdk/models/update_on_call_role.py index 273c5735..ff9a0a38 100644 --- a/rootly_sdk/models/update_on_call_role.py +++ b/rootly_sdk/models/update_on_call_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOnCallRole: data (UpdateOnCallRoleData): """ - data: UpdateOnCallRoleData + data: "UpdateOnCallRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_on_call_role_data.py b/rootly_sdk/models/update_on_call_role_data.py index af8dd19a..320a3c0d 100644 --- a/rootly_sdk/models/update_on_call_role_data.py +++ b/rootly_sdk/models/update_on_call_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateOnCallRoleData: """ type_: UpdateOnCallRoleDataType - attributes: UpdateOnCallRoleDataAttributes + attributes: "UpdateOnCallRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_on_call_role_data_attributes.py b/rootly_sdk/models/update_on_call_role_data_attributes.py index bbeb6c0d..cedd2246 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -110,235 +108,249 @@ class UpdateOnCallRoleDataAttributes: """ Attributes: - name (str | Unset): The role name. - system_role (str | Unset): The kind of role (user and custom type roles are only editable) Default: 'custom'. - alert_sources_permissions (list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset): - alert_urgency_permissions (list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset): - alert_fields_permissions (list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset): - alert_groups_permissions (list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset): - alert_routing_rules_permissions (list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset): - on_call_readiness_report_permissions (list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | - Unset): - on_call_roles_permissions (list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset): - alerts_permissions (list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] | Unset): - api_keys_permissions (list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] | Unset): - contacts_permissions (list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] | Unset): - escalation_policies_permissions (list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset): - groups_permissions (list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] | Unset): - heartbeats_permissions (list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset): - integrations_permissions (list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset): - live_call_routing_permissions (list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset): - schedule_override_permissions (list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset): - schedules_permissions (list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset): - services_permissions (list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] | Unset): - functionalities_permissions (list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - webhooks_permissions (list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The role name. + system_role (Union[Unset, str]): The kind of role (user and custom type roles are only editable) Default: + 'custom'. + alert_sources_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem]]): + alert_urgency_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem]]): + alert_fields_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem]]): + alert_groups_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem]]): + alert_routing_rules_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem]]): + on_call_readiness_report_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem]]): + on_call_roles_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem]]): + alerts_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem]]): + contacts_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesContactsPermissionsItem]]): + escalation_policies_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem]]): + groups_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem]]): + heartbeats_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem]]): + integrations_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem]]): + live_call_routing_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]]): + schedule_override_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem]]): + schedules_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem]]): + services_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesServicesPermissionsItem]]): + functionalities_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem]]): """ - name: str | Unset = UNSET - system_role: str | Unset = "custom" - alert_sources_permissions: list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - alert_urgency_permissions: list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - alert_fields_permissions: list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - alert_groups_permissions: list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - alert_routing_rules_permissions: list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset = ( + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + system_role: Unset | str = "custom" + alert_sources_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] = UNSET + alert_urgency_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] = UNSET + alert_fields_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] = UNSET + alert_groups_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] = UNSET + alert_routing_rules_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] = ( UNSET ) on_call_readiness_report_permissions: ( - list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset + Unset | list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] ) = UNSET - on_call_roles_permissions: list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - alerts_permissions: list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - contacts_permissions: list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - escalation_policies_permissions: list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset = ( + on_call_roles_permissions: Unset | list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] = UNSET + alerts_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] = UNSET + contacts_permissions: Unset | list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] = UNSET + escalation_policies_permissions: Unset | list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] = ( UNSET ) - groups_permissions: list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - heartbeats_permissions: list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - integrations_permissions: list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - live_call_routing_permissions: list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = UNSET - schedule_override_permissions: list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = UNSET - schedules_permissions: list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - services_permissions: list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - functionalities_permissions: list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET + groups_permissions: Unset | list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] = UNSET + heartbeats_permissions: Unset | list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] = UNSET + integrations_permissions: Unset | list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] = UNSET + live_call_routing_permissions: Unset | list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] = UNSET + schedule_override_permissions: Unset | list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] = UNSET + schedules_permissions: Unset | list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] = UNSET + services_permissions: Unset | list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] = UNSET + functionalities_permissions: Unset | list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name system_role = self.system_role - alert_sources_permissions: list[str] | Unset = UNSET + alert_sources_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: list[str] | Unset = UNSET + alert_urgency_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alert_fields_permissions: list[str] | Unset = UNSET + alert_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: list[str] | Unset = UNSET + alert_groups_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: list[str] | Unset = UNSET + alert_routing_rules_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: list[str] | Unset = UNSET + on_call_readiness_report_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: list[str] | Unset = UNSET + on_call_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: list[str] | Unset = UNSET + contacts_permissions: Unset | list[str] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: list[str] | Unset = UNSET + escalation_policies_permissions: Unset | list[str] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: list[str] | Unset = UNSET + heartbeats_permissions: Unset | list[str] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: list[str] | Unset = UNSET + live_call_routing_permissions: Unset | list[str] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: list[str] | Unset = UNSET + schedule_override_permissions: Unset | list[str] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: list[str] | Unset = UNSET + schedules_permissions: Unset | list[str] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -348,6 +360,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if system_role is not UNSET: @@ -406,303 +420,250 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) system_role = d.pop("system_role", UNSET) + alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - alert_sources_permissions: list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - if _alert_sources_permissions is not UNSET: - alert_sources_permissions = [] - for alert_sources_permissions_item_data in _alert_sources_permissions: - alert_sources_permissions_item = ( - check_update_on_call_role_data_attributes_alert_sources_permissions_item( - alert_sources_permissions_item_data - ) - ) + for alert_sources_permissions_item_data in _alert_sources_permissions or []: + alert_sources_permissions_item = check_update_on_call_role_data_attributes_alert_sources_permissions_item( + alert_sources_permissions_item_data + ) - alert_sources_permissions.append(alert_sources_permissions_item) + alert_sources_permissions.append(alert_sources_permissions_item) + alert_urgency_permissions = [] _alert_urgency_permissions = d.pop("alert_urgency_permissions", UNSET) - alert_urgency_permissions: list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - if _alert_urgency_permissions is not UNSET: - alert_urgency_permissions = [] - for alert_urgency_permissions_item_data in _alert_urgency_permissions: - alert_urgency_permissions_item = ( - check_update_on_call_role_data_attributes_alert_urgency_permissions_item( - alert_urgency_permissions_item_data - ) - ) + for alert_urgency_permissions_item_data in _alert_urgency_permissions or []: + alert_urgency_permissions_item = check_update_on_call_role_data_attributes_alert_urgency_permissions_item( + alert_urgency_permissions_item_data + ) - alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_fields_permissions = [] _alert_fields_permissions = d.pop("alert_fields_permissions", UNSET) - alert_fields_permissions: list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - if _alert_fields_permissions is not UNSET: - alert_fields_permissions = [] - for alert_fields_permissions_item_data in _alert_fields_permissions: - alert_fields_permissions_item = check_update_on_call_role_data_attributes_alert_fields_permissions_item( - alert_fields_permissions_item_data - ) + for alert_fields_permissions_item_data in _alert_fields_permissions or []: + alert_fields_permissions_item = check_update_on_call_role_data_attributes_alert_fields_permissions_item( + alert_fields_permissions_item_data + ) - alert_fields_permissions.append(alert_fields_permissions_item) + alert_fields_permissions.append(alert_fields_permissions_item) + alert_groups_permissions = [] _alert_groups_permissions = d.pop("alert_groups_permissions", UNSET) - alert_groups_permissions: list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - if _alert_groups_permissions is not UNSET: - alert_groups_permissions = [] - for alert_groups_permissions_item_data in _alert_groups_permissions: - alert_groups_permissions_item = check_update_on_call_role_data_attributes_alert_groups_permissions_item( - alert_groups_permissions_item_data - ) + for alert_groups_permissions_item_data in _alert_groups_permissions or []: + alert_groups_permissions_item = check_update_on_call_role_data_attributes_alert_groups_permissions_item( + alert_groups_permissions_item_data + ) - alert_groups_permissions.append(alert_groups_permissions_item) + alert_groups_permissions.append(alert_groups_permissions_item) + alert_routing_rules_permissions = [] _alert_routing_rules_permissions = d.pop("alert_routing_rules_permissions", UNSET) - alert_routing_rules_permissions: ( - list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset - ) = UNSET - if _alert_routing_rules_permissions is not UNSET: - alert_routing_rules_permissions = [] - for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions: - alert_routing_rules_permissions_item = ( - check_update_on_call_role_data_attributes_alert_routing_rules_permissions_item( - alert_routing_rules_permissions_item_data - ) + for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions or []: + alert_routing_rules_permissions_item = ( + check_update_on_call_role_data_attributes_alert_routing_rules_permissions_item( + alert_routing_rules_permissions_item_data ) + ) - alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + on_call_readiness_report_permissions = [] _on_call_readiness_report_permissions = d.pop("on_call_readiness_report_permissions", UNSET) - on_call_readiness_report_permissions: ( - list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset - ) = UNSET - if _on_call_readiness_report_permissions is not UNSET: - on_call_readiness_report_permissions = [] - for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions: - on_call_readiness_report_permissions_item = ( - check_update_on_call_role_data_attributes_on_call_readiness_report_permissions_item( - on_call_readiness_report_permissions_item_data - ) + for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions or []: + on_call_readiness_report_permissions_item = ( + check_update_on_call_role_data_attributes_on_call_readiness_report_permissions_item( + on_call_readiness_report_permissions_item_data ) + ) - on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_roles_permissions = [] _on_call_roles_permissions = d.pop("on_call_roles_permissions", UNSET) - on_call_roles_permissions: list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - if _on_call_roles_permissions is not UNSET: - on_call_roles_permissions = [] - for on_call_roles_permissions_item_data in _on_call_roles_permissions: - on_call_roles_permissions_item = ( - check_update_on_call_role_data_attributes_on_call_roles_permissions_item( - on_call_roles_permissions_item_data - ) - ) + for on_call_roles_permissions_item_data in _on_call_roles_permissions or []: + on_call_roles_permissions_item = check_update_on_call_role_data_attributes_on_call_roles_permissions_item( + on_call_roles_permissions_item_data + ) - on_call_roles_permissions.append(on_call_roles_permissions_item) + on_call_roles_permissions.append(on_call_roles_permissions_item) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_update_on_call_role_data_attributes_alerts_permissions_item( - alerts_permissions_item_data - ) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_update_on_call_role_data_attributes_alerts_permissions_item( + alerts_permissions_item_data + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_update_on_call_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_update_on_call_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_update_on_call_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_update_on_call_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - contacts_permissions: list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - if _contacts_permissions is not UNSET: - contacts_permissions = [] - for contacts_permissions_item_data in _contacts_permissions: - contacts_permissions_item = check_update_on_call_role_data_attributes_contacts_permissions_item( - contacts_permissions_item_data - ) + for contacts_permissions_item_data in _contacts_permissions or []: + contacts_permissions_item = check_update_on_call_role_data_attributes_contacts_permissions_item( + contacts_permissions_item_data + ) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) + escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - escalation_policies_permissions: ( - list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset - ) = UNSET - if _escalation_policies_permissions is not UNSET: - escalation_policies_permissions = [] - for escalation_policies_permissions_item_data in _escalation_policies_permissions: - escalation_policies_permissions_item = ( - check_update_on_call_role_data_attributes_escalation_policies_permissions_item( - escalation_policies_permissions_item_data - ) + for escalation_policies_permissions_item_data in _escalation_policies_permissions or []: + escalation_policies_permissions_item = ( + check_update_on_call_role_data_attributes_escalation_policies_permissions_item( + escalation_policies_permissions_item_data ) + ) - escalation_policies_permissions.append(escalation_policies_permissions_item) + escalation_policies_permissions.append(escalation_policies_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_update_on_call_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_update_on_call_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - heartbeats_permissions: list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - if _heartbeats_permissions is not UNSET: - heartbeats_permissions = [] - for heartbeats_permissions_item_data in _heartbeats_permissions: - heartbeats_permissions_item = check_update_on_call_role_data_attributes_heartbeats_permissions_item( - heartbeats_permissions_item_data - ) + for heartbeats_permissions_item_data in _heartbeats_permissions or []: + heartbeats_permissions_item = check_update_on_call_role_data_attributes_heartbeats_permissions_item( + heartbeats_permissions_item_data + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_update_on_call_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_update_on_call_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_update_on_call_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_update_on_call_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + live_call_routing_permissions = [] _live_call_routing_permissions = d.pop("live_call_routing_permissions", UNSET) - live_call_routing_permissions: list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = ( - UNSET - ) - if _live_call_routing_permissions is not UNSET: - live_call_routing_permissions = [] - for live_call_routing_permissions_item_data in _live_call_routing_permissions: - live_call_routing_permissions_item = ( - check_update_on_call_role_data_attributes_live_call_routing_permissions_item( - live_call_routing_permissions_item_data - ) + for live_call_routing_permissions_item_data in _live_call_routing_permissions or []: + live_call_routing_permissions_item = ( + check_update_on_call_role_data_attributes_live_call_routing_permissions_item( + live_call_routing_permissions_item_data ) + ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - schedule_override_permissions: list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = ( - UNSET - ) - if _schedule_override_permissions is not UNSET: - schedule_override_permissions = [] - for schedule_override_permissions_item_data in _schedule_override_permissions: - schedule_override_permissions_item = ( - check_update_on_call_role_data_attributes_schedule_override_permissions_item( - schedule_override_permissions_item_data - ) + for schedule_override_permissions_item_data in _schedule_override_permissions or []: + schedule_override_permissions_item = ( + check_update_on_call_role_data_attributes_schedule_override_permissions_item( + schedule_override_permissions_item_data ) + ) - schedule_override_permissions.append(schedule_override_permissions_item) + schedule_override_permissions.append(schedule_override_permissions_item) + schedules_permissions = [] _schedules_permissions = d.pop("schedules_permissions", UNSET) - schedules_permissions: list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - if _schedules_permissions is not UNSET: - schedules_permissions = [] - for schedules_permissions_item_data in _schedules_permissions: - schedules_permissions_item = check_update_on_call_role_data_attributes_schedules_permissions_item( - schedules_permissions_item_data - ) + for schedules_permissions_item_data in _schedules_permissions or []: + schedules_permissions_item = check_update_on_call_role_data_attributes_schedules_permissions_item( + schedules_permissions_item_data + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_update_on_call_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_update_on_call_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = ( - check_update_on_call_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = ( + check_update_on_call_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data ) + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_update_on_call_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_update_on_call_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_update_on_call_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_update_on_call_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_update_on_call_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_update_on_call_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) update_on_call_role_data_attributes = cls( + slug=slug, name=name, system_role=system_role, alert_sources_permissions=alert_sources_permissions, diff --git a/rootly_sdk/models/update_on_call_shadow.py b/rootly_sdk/models/update_on_call_shadow.py index 1c41656b..08575554 100644 --- a/rootly_sdk/models/update_on_call_shadow.py +++ b/rootly_sdk/models/update_on_call_shadow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOnCallShadow: data (UpdateOnCallShadowData): """ - data: UpdateOnCallShadowData + data: "UpdateOnCallShadowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_on_call_shadow_data.py b/rootly_sdk/models/update_on_call_shadow_data.py index b7feab90..a31c2b12 100644 --- a/rootly_sdk/models/update_on_call_shadow_data.py +++ b/rootly_sdk/models/update_on_call_shadow_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateOnCallShadowData: """ type_: UpdateOnCallShadowDataType - attributes: UpdateOnCallShadowDataAttributes + attributes: "UpdateOnCallShadowDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_on_call_shadow_data_attributes.py b/rootly_sdk/models/update_on_call_shadow_data_attributes.py index 82161c38..5f937250 100644 --- a/rootly_sdk/models/update_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/update_on_call_shadow_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -20,25 +18,25 @@ class UpdateOnCallShadowDataAttributes: """ Attributes: - schedule_id (str | Unset): ID of schedule the shadow shift belongs to - shadowable_type (UpdateOnCallShadowDataAttributesShadowableType | Unset): - shadowable_id (str | Unset): ID of schedule or user the shadow user is shadowing - shadow_user_id (int | Unset): Which user the shadow shift belongs to. - starts_at (datetime.datetime | Unset): Start datetime of shadow shift - ends_at (datetime.datetime | Unset): End datetime for shadow shift + schedule_id (Union[Unset, str]): ID of schedule the shadow shift belongs to + shadowable_type (Union[Unset, UpdateOnCallShadowDataAttributesShadowableType]): + shadowable_id (Union[Unset, str]): ID of schedule or user the shadow user is shadowing + shadow_user_id (Union[Unset, int]): Which user the shadow shift belongs to. + starts_at (Union[Unset, datetime.datetime]): Start datetime of shadow shift + ends_at (Union[Unset, datetime.datetime]): End datetime for shadow shift """ - schedule_id: str | Unset = UNSET - shadowable_type: UpdateOnCallShadowDataAttributesShadowableType | Unset = UNSET - shadowable_id: str | Unset = UNSET - shadow_user_id: int | Unset = UNSET - starts_at: datetime.datetime | Unset = UNSET - ends_at: datetime.datetime | Unset = UNSET + schedule_id: Unset | str = UNSET + shadowable_type: Unset | UpdateOnCallShadowDataAttributesShadowableType = UNSET + shadowable_id: Unset | str = UNSET + shadow_user_id: Unset | int = UNSET + starts_at: Unset | datetime.datetime = UNSET + ends_at: Unset | datetime.datetime = UNSET def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - shadowable_type: str | Unset = UNSET + shadowable_type: Unset | str = UNSET if not isinstance(self.shadowable_type, Unset): shadowable_type = self.shadowable_type @@ -46,11 +44,11 @@ def to_dict(self) -> dict[str, Any]: shadow_user_id = self.shadow_user_id - starts_at: str | Unset = UNSET + starts_at: Unset | str = UNSET if not isinstance(self.starts_at, Unset): starts_at = self.starts_at.isoformat() - ends_at: str | Unset = UNSET + ends_at: Unset | str = UNSET if not isinstance(self.ends_at, Unset): ends_at = self.ends_at.isoformat() @@ -78,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule_id = d.pop("schedule_id", UNSET) _shadowable_type = d.pop("shadowable_type", UNSET) - shadowable_type: UpdateOnCallShadowDataAttributesShadowableType | Unset + shadowable_type: Unset | UpdateOnCallShadowDataAttributesShadowableType if isinstance(_shadowable_type, Unset): shadowable_type = UNSET else: @@ -89,14 +87,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shadow_user_id = d.pop("shadow_user_id", UNSET) _starts_at = d.pop("starts_at", UNSET) - starts_at: datetime.datetime | Unset + starts_at: Unset | datetime.datetime if isinstance(_starts_at, Unset): starts_at = UNSET else: starts_at = isoparse(_starts_at) _ends_at = d.pop("ends_at", UNSET) - ends_at: datetime.datetime | Unset + ends_at: Unset | datetime.datetime if isinstance(_ends_at, Unset): ends_at = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params.py b/rootly_sdk/models/update_opsgenie_alert_task_params.py index 729d24ad..983c4f88 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,29 +28,28 @@ class UpdateOpsgenieAlertTaskParams: alert_id (str): Opsgenie Alert ID priority (UpdateOpsgenieAlertTaskParamsPriority): completion (UpdateOpsgenieAlertTaskParamsCompletion): - task_type (UpdateOpsgenieAlertTaskParamsTaskType | Unset): - message (str | Unset): Message of the alert - description (str | Unset): Description field of the alert that is generally used to provide a detailed + task_type (Union[Unset, UpdateOpsgenieAlertTaskParamsTaskType]): + message (Union[Unset, str]): Message of the alert + description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed information about the alert """ alert_id: str priority: UpdateOpsgenieAlertTaskParamsPriority - completion: UpdateOpsgenieAlertTaskParamsCompletion - task_type: UpdateOpsgenieAlertTaskParamsTaskType | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET + completion: "UpdateOpsgenieAlertTaskParamsCompletion" + task_type: Unset | UpdateOpsgenieAlertTaskParamsTaskType = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - alert_id = self.alert_id priority: str = self.priority completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateOpsgenieAlertTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateOpsgenieAlertTaskParamsTaskType | Unset + task_type: Unset | UpdateOpsgenieAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py index f1933281..74ddc709 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateOpsgenieAlertTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params.py b/rootly_sdk/models/update_opsgenie_incident_task_params.py index 46b0c6ef..a7d8ec23 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -29,26 +27,26 @@ class UpdateOpsgenieIncidentTaskParams: Attributes: opsgenie_incident_id (str): The Opsgenie incident ID, this can also be a Rootly incident variable ex. {{ incident.opsgenie_incident_id }} - task_type (UpdateOpsgenieIncidentTaskParamsTaskType | Unset): - message (str | Unset): Message of the alert - description (str | Unset): Description field of the alert that is generally used to provide a detailed + task_type (Union[Unset, UpdateOpsgenieIncidentTaskParamsTaskType]): + message (Union[Unset, str]): Message of the alert + description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed information about the alert - status (UpdateOpsgenieIncidentTaskParamsStatus | Unset): - priority (UpdateOpsgenieIncidentTaskParamsPriority | Unset): + status (Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus]): + priority (Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority]): """ opsgenie_incident_id: str - task_type: UpdateOpsgenieIncidentTaskParamsTaskType | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET - status: UpdateOpsgenieIncidentTaskParamsStatus | Unset = UNSET - priority: UpdateOpsgenieIncidentTaskParamsPriority | Unset = UNSET + task_type: Unset | UpdateOpsgenieIncidentTaskParamsTaskType = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET + status: Unset | UpdateOpsgenieIncidentTaskParamsStatus = UNSET + priority: Unset | UpdateOpsgenieIncidentTaskParamsPriority = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: opsgenie_incident_id = self.opsgenie_incident_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,11 +54,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - priority: str | Unset = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -90,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: opsgenie_incident_id = d.pop("opsgenie_incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateOpsgenieIncidentTaskParamsTaskType | Unset + task_type: Unset | UpdateOpsgenieIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -101,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: UpdateOpsgenieIncidentTaskParamsStatus | Unset + status: Unset | UpdateOpsgenieIncidentTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_opsgenie_incident_task_params_status(_status) _priority = d.pop("priority", UNSET) - priority: UpdateOpsgenieIncidentTaskParamsPriority | Unset + priority: Unset | UpdateOpsgenieIncidentTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_override_shift.py b/rootly_sdk/models/update_override_shift.py index 236cf914..5ea83e20 100644 --- a/rootly_sdk/models/update_override_shift.py +++ b/rootly_sdk/models/update_override_shift.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOverrideShift: data (UpdateOverrideShiftData): """ - data: UpdateOverrideShiftData + data: "UpdateOverrideShiftData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_override_shift_data.py b/rootly_sdk/models/update_override_shift_data.py index e44a0bd4..e3af4213 100644 --- a/rootly_sdk/models/update_override_shift_data.py +++ b/rootly_sdk/models/update_override_shift_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateOverrideShiftData: """ type_: UpdateOverrideShiftDataType - attributes: UpdateOverrideShiftDataAttributes + attributes: "UpdateOverrideShiftDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_override_shift_data_attributes.py b/rootly_sdk/models/update_override_shift_data_attributes.py index 2a34c48e..2e7cc8df 100644 --- a/rootly_sdk/models/update_override_shift_data_attributes.py +++ b/rootly_sdk/models/update_override_shift_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params.py b/rootly_sdk/models/update_pagerduty_incident_task_params.py index 3020e135..fc8753f0 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -28,37 +26,37 @@ class UpdatePagerdutyIncidentTaskParams: """ Attributes: pagerduty_incident_id (str): Pagerduty incident id - task_type (UpdatePagerdutyIncidentTaskParamsTaskType | Unset): - title (str | Unset): Title to update to - status (UpdatePagerdutyIncidentTaskParamsStatus | Unset): - resolution (str | Unset): A message outlining the incident's resolution in PagerDuty - escalation_level (int | Unset): Escalation level of policy attached to incident Example: 1. - urgency (UpdatePagerdutyIncidentTaskParamsUrgency | Unset): PagerDuty incident urgency, selecting auto will let - Rootly auto map our incident severity - priority (str | Unset): PagerDuty incident priority, selecting auto will let Rootly auto map our incident + task_type (Union[Unset, UpdatePagerdutyIncidentTaskParamsTaskType]): + title (Union[Unset, str]): Title to update to + status (Union[Unset, UpdatePagerdutyIncidentTaskParamsStatus]): + resolution (Union[Unset, str]): A message outlining the incident's resolution in PagerDuty + escalation_level (Union[Unset, int]): Escalation level of policy attached to incident Example: 1. + urgency (Union[Unset, UpdatePagerdutyIncidentTaskParamsUrgency]): PagerDuty incident urgency, selecting auto + will let Rootly auto map our incident severity + priority (Union[Unset, str]): PagerDuty incident priority, selecting auto will let Rootly auto map our incident severity """ pagerduty_incident_id: str - task_type: UpdatePagerdutyIncidentTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - status: UpdatePagerdutyIncidentTaskParamsStatus | Unset = UNSET - resolution: str | Unset = UNSET - escalation_level: int | Unset = UNSET - urgency: UpdatePagerdutyIncidentTaskParamsUrgency | Unset = UNSET - priority: str | Unset = UNSET + task_type: Unset | UpdatePagerdutyIncidentTaskParamsTaskType = UNSET + title: Unset | str = UNSET + status: Unset | UpdatePagerdutyIncidentTaskParamsStatus = UNSET + resolution: Unset | str = UNSET + escalation_level: Unset | int = UNSET + urgency: Unset | UpdatePagerdutyIncidentTaskParamsUrgency = UNSET + priority: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: pagerduty_incident_id = self.pagerduty_incident_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type title = self.title - status: str | Unset = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - urgency: str | Unset = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -102,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pagerduty_incident_id = d.pop("pagerduty_incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdatePagerdutyIncidentTaskParamsTaskType | Unset + task_type: Unset | UpdatePagerdutyIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -111,7 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: UpdatePagerdutyIncidentTaskParamsStatus | Unset + status: Unset | UpdatePagerdutyIncidentTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: @@ -122,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalation_level = d.pop("escalation_level", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: UpdatePagerdutyIncidentTaskParamsUrgency | Unset + urgency: Unset | UpdatePagerdutyIncidentTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params.py b/rootly_sdk/models/update_pagertree_alert_task_params.py index 6b7cebfb..b59eca40 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,31 +30,30 @@ class UpdatePagertreeAlertTaskParams: """ Attributes: - task_type (UpdatePagertreeAlertTaskParamsTaskType | Unset): - pagertree_alert_id (str | Unset): The prefix ID of the Pagertree alert - title (str | Unset): Title of alert as text - description (str | Unset): Description of alert as text - urgency (UpdatePagertreeAlertTaskParamsUrgency | Unset): - severity (UpdatePagertreeAlertTaskParamsSeverity | Unset): - teams (list[UpdatePagertreeAlertTaskParamsTeamsItem] | Unset): - users (list[UpdatePagertreeAlertTaskParamsUsersItem] | Unset): - incident (bool | Unset): Setting to true makes an alert a Pagertree incident + task_type (Union[Unset, UpdatePagertreeAlertTaskParamsTaskType]): + pagertree_alert_id (Union[Unset, str]): The prefix ID of the Pagertree alert + title (Union[Unset, str]): Title of alert as text + description (Union[Unset, str]): Description of alert as text + urgency (Union[Unset, UpdatePagertreeAlertTaskParamsUrgency]): + severity (Union[Unset, UpdatePagertreeAlertTaskParamsSeverity]): + teams (Union[Unset, list['UpdatePagertreeAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['UpdatePagertreeAlertTaskParamsUsersItem']]): + incident (Union[Unset, bool]): Setting to true makes an alert a Pagertree incident """ - task_type: UpdatePagertreeAlertTaskParamsTaskType | Unset = UNSET - pagertree_alert_id: str | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - urgency: UpdatePagertreeAlertTaskParamsUrgency | Unset = UNSET - severity: UpdatePagertreeAlertTaskParamsSeverity | Unset = UNSET - teams: list[UpdatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[UpdatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - incident: bool | Unset = UNSET + task_type: Unset | UpdatePagertreeAlertTaskParamsTaskType = UNSET + pagertree_alert_id: Unset | str = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + urgency: Unset | UpdatePagertreeAlertTaskParamsUrgency = UNSET + severity: Unset | UpdatePagertreeAlertTaskParamsSeverity = UNSET + teams: Unset | list["UpdatePagertreeAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["UpdatePagertreeAlertTaskParamsUsersItem"] = UNSET + incident: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,22 +63,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: str | Unset = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: str | Unset = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: list[dict[str, Any]] | Unset = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -121,7 +118,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: UpdatePagertreeAlertTaskParamsTaskType | Unset + task_type: Unset | UpdatePagertreeAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -134,36 +131,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: UpdatePagertreeAlertTaskParamsUrgency | Unset + urgency: Unset | UpdatePagertreeAlertTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_update_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: UpdatePagertreeAlertTaskParamsSeverity | Unset + severity: Unset | UpdatePagertreeAlertTaskParamsSeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_pagertree_alert_task_params_severity(_severity) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[UpdatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = UpdatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = UpdatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[UpdatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = UpdatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = UpdatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) incident = d.pop("incident", UNSET) diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py b/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py index 6bd86d6a..1c7a5f64 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdatePagertreeAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py b/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py index 8f9a0105..fbf4cec1 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdatePagertreeAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_playbook.py b/rootly_sdk/models/update_playbook.py index acd968f6..3155be8a 100644 --- a/rootly_sdk/models/update_playbook.py +++ b/rootly_sdk/models/update_playbook.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePlaybook: data (UpdatePlaybookData): """ - data: UpdatePlaybookData + data: "UpdatePlaybookData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_playbook_data.py b/rootly_sdk/models/update_playbook_data.py index 9bd1cc08..55556936 100644 --- a/rootly_sdk/models/update_playbook_data.py +++ b/rootly_sdk/models/update_playbook_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdatePlaybookData: """ type_: UpdatePlaybookDataType - attributes: UpdatePlaybookDataAttributes + attributes: "UpdatePlaybookDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_playbook_data_attributes.py b/rootly_sdk/models/update_playbook_data_attributes.py index c98736b1..78d0a41a 100644 --- a/rootly_sdk/models/update_playbook_data_attributes.py +++ b/rootly_sdk/models/update_playbook_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,43 +12,43 @@ class UpdatePlaybookDataAttributes: """ Attributes: - title (str | Unset): The title of the playbook - summary (None | str | Unset): The summary of the playbook - external_url (None | str | Unset): The external url of the playbook - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident + title (Union[Unset, str]): The title of the playbook + summary (Union[None, Unset, str]): The summary of the playbook + external_url (Union[None, Unset, str]): The external url of the playbook + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ - title: str | Unset = UNSET - summary: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + title: Unset | str = UNSET + summary: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + severity_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: None | str | Unset + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -77,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -86,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -95,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -133,25 +131,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -162,13 +160,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -179,13 +177,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -196,13 +194,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -213,13 +211,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -230,13 +228,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -247,9 +245,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_playbook_task.py b/rootly_sdk/models/update_playbook_task.py index d18a975b..56544842 100644 --- a/rootly_sdk/models/update_playbook_task.py +++ b/rootly_sdk/models/update_playbook_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePlaybookTask: data (UpdatePlaybookTaskData): """ - data: UpdatePlaybookTaskData + data: "UpdatePlaybookTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_playbook_task_data.py b/rootly_sdk/models/update_playbook_task_data.py index fc0209c0..0eb8ab5f 100644 --- a/rootly_sdk/models/update_playbook_task_data.py +++ b/rootly_sdk/models/update_playbook_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdatePlaybookTaskData: """ type_: UpdatePlaybookTaskDataType - attributes: UpdatePlaybookTaskDataAttributes + attributes: "UpdatePlaybookTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_playbook_task_data_attributes.py b/rootly_sdk/models/update_playbook_task_data_attributes.py index a8ef0615..858224cb 100644 --- a/rootly_sdk/models/update_playbook_task_data_attributes.py +++ b/rootly_sdk/models/update_playbook_task_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,25 +12,25 @@ class UpdatePlaybookTaskDataAttributes: """ Attributes: - task (str | Unset): The task of the task - description (None | str | Unset): The description of the task - position (int | None | Unset): The position of the task + task (Union[Unset, str]): The task of the task + description (Union[None, Unset, str]): The description of the task + position (Union[None, Unset, int]): The position of the task """ - task: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + task: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -55,21 +53,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_post_mortem_template.py b/rootly_sdk/models/update_post_mortem_template.py index 459111a4..2ef52623 100644 --- a/rootly_sdk/models/update_post_mortem_template.py +++ b/rootly_sdk/models/update_post_mortem_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePostMortemTemplate: data (UpdatePostMortemTemplateData): """ - data: UpdatePostMortemTemplateData + data: "UpdatePostMortemTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_post_mortem_template_data.py b/rootly_sdk/models/update_post_mortem_template_data.py index 6c4f98ce..b7139ea7 100644 --- a/rootly_sdk/models/update_post_mortem_template_data.py +++ b/rootly_sdk/models/update_post_mortem_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdatePostMortemTemplateData: """ type_: UpdatePostMortemTemplateDataType - attributes: UpdatePostMortemTemplateDataAttributes + attributes: "UpdatePostMortemTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_post_mortem_template_data_attributes.py b/rootly_sdk/models/update_post_mortem_template_data_attributes.py index 25c498be..8ecd5181 100644 --- a/rootly_sdk/models/update_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/update_post_mortem_template_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,22 +16,31 @@ class UpdatePostMortemTemplateDataAttributes: """ Attributes: - name (str | Unset): The name of the postmortem template - default (bool | None | Unset): Default selected template when editing a postmortem - content (str | Unset): The postmortem template. Supports TipTap blocks (followup and timeline components), + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the postmortem template + default (Union[None, Unset, bool]): Default selected template when editing a postmortem + content (Union[Unset, str]): The postmortem template. Supports TipTap blocks (followup and timeline components), Liquid syntax, and HTML. Will be sanitized and applied to both content and content_html fields. - format_ (UpdatePostMortemTemplateDataAttributesFormat | Unset): The format of the input Default: 'html'. + format_ (Union[Unset, UpdatePostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. """ - name: str | Unset = UNSET - default: bool | None | Unset = UNSET - content: str | Unset = UNSET - format_: UpdatePostMortemTemplateDataAttributesFormat | Unset = "html" + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + default: None | Unset | bool = UNSET + content: Unset | str = UNSET + format_: Unset | UpdatePostMortemTemplateDataAttributesFormat = "html" def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - default: bool | None | Unset + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: @@ -41,13 +48,15 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: str | Unset = UNSET + format_: Unset | str = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if default is not UNSET: @@ -62,27 +71,38 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: UpdatePostMortemTemplateDataAttributesFormat | Unset + format_: Unset | UpdatePostMortemTemplateDataAttributesFormat if isinstance(_format_, Unset): format_ = UNSET else: format_ = check_update_post_mortem_template_data_attributes_format(_format_) update_post_mortem_template_data_attributes = cls( + slug=slug, name=name, default=default, content=content, diff --git a/rootly_sdk/models/update_pulse.py b/rootly_sdk/models/update_pulse.py index ce900954..8f92ec5b 100644 --- a/rootly_sdk/models/update_pulse.py +++ b/rootly_sdk/models/update_pulse.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePulse: data (UpdatePulseData): """ - data: UpdatePulseData + data: "UpdatePulseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_pulse_data.py b/rootly_sdk/models/update_pulse_data.py index 651fb0dc..b79e1f0b 100644 --- a/rootly_sdk/models/update_pulse_data.py +++ b/rootly_sdk/models/update_pulse_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdatePulseData: """ type_: UpdatePulseDataType - attributes: UpdatePulseDataAttributes + attributes: "UpdatePulseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_pulse_data_attributes.py b/rootly_sdk/models/update_pulse_data_attributes.py index 0defb512..8451d755 100644 --- a/rootly_sdk/models/update_pulse_data_attributes.py +++ b/rootly_sdk/models/update_pulse_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -22,35 +20,35 @@ class UpdatePulseDataAttributes: """ Attributes: - source (None | str | Unset): The source of the pulse (eg: k8s) - summary (str | Unset): The summary of the pulse - service_ids (list[str] | None | Unset): The Service IDs to attach to the pulse - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the pulse - started_at (datetime.datetime | None | Unset): Pulse start datetime - ended_at (datetime.datetime | None | Unset): Pulse end datetime - external_url (None | str | Unset): The external url of the pulse - labels (list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset): - refs (list[None | UpdatePulseDataAttributesRefsItemType0] | Unset): - data (None | Unset | UpdatePulseDataAttributesDataType0): Additional data + source (Union[None, Unset, str]): The source of the pulse (eg: k8s) + summary (Union[Unset, str]): The summary of the pulse + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the pulse + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the pulse + started_at (Union[None, Unset, datetime.datetime]): Pulse start datetime + ended_at (Union[None, Unset, datetime.datetime]): Pulse end datetime + external_url (Union[None, Unset, str]): The external url of the pulse + labels (Union[Unset, list[Union['UpdatePulseDataAttributesLabelsItemType0', None]]]): + refs (Union[Unset, list[Union['UpdatePulseDataAttributesRefsItemType0', None]]]): + data (Union['UpdatePulseDataAttributesDataType0', None, Unset]): Additional data """ - source: None | str | Unset = UNSET - summary: str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_url: None | str | Unset = UNSET - labels: list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset = UNSET - refs: list[None | UpdatePulseDataAttributesRefsItemType0] | Unset = UNSET - data: None | Unset | UpdatePulseDataAttributesDataType0 = UNSET + source: None | Unset | str = UNSET + summary: Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_url: None | Unset | str = UNSET + labels: Unset | list[Union["UpdatePulseDataAttributesLabelsItemType0", None]] = UNSET + refs: Unset | list[Union["UpdatePulseDataAttributesRefsItemType0", None]] = UNSET + data: Union["UpdatePulseDataAttributesDataType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_pulse_data_attributes_data_type_0 import UpdatePulseDataAttributesDataType0 from ..models.update_pulse_data_attributes_labels_item_type_0 import UpdatePulseDataAttributesLabelsItemType0 from ..models.update_pulse_data_attributes_refs_item_type_0 import UpdatePulseDataAttributesRefsItemType0 - source: None | str | Unset + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: @@ -58,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -67,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -92,35 +90,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: None | str | Unset + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: None | dict[str, Any] if isinstance(labels_item_data, UpdatePulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: list[dict[str, Any] | None] | Unset = UNSET + refs: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: dict[str, Any] | None + refs_item: None | dict[str, Any] if isinstance(refs_item_data, UpdatePulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: dict[str, Any] | None | Unset + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdatePulseDataAttributesDataType0): @@ -162,18 +160,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) summary = d.pop("summary", UNSET) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -184,13 +182,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -201,13 +199,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -218,13 +216,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -235,68 +233,64 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> None | UpdatePulseDataAttributesLabelsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = UpdatePulseDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["UpdatePulseDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = UpdatePulseDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdatePulseDataAttributesLabelsItemType0, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdatePulseDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) + refs = [] _refs = d.pop("refs", UNSET) - refs: list[None | UpdatePulseDataAttributesRefsItemType0] | Unset = UNSET - if _refs is not UNSET: - refs = [] - for refs_item_data in _refs: + for refs_item_data in _refs or []: - def _parse_refs_item(data: object) -> None | UpdatePulseDataAttributesRefsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - refs_item_type_0 = UpdatePulseDataAttributesRefsItemType0.from_dict(data) + def _parse_refs_item(data: object) -> Union["UpdatePulseDataAttributesRefsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + refs_item_type_0 = UpdatePulseDataAttributesRefsItemType0.from_dict(data) - return refs_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdatePulseDataAttributesRefsItemType0, data) + return refs_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdatePulseDataAttributesRefsItemType0", None], data) - refs_item = _parse_refs_item(refs_item_data) + refs_item = _parse_refs_item(refs_item_data) - refs.append(refs_item) + refs.append(refs_item) - def _parse_data(data: object) -> None | Unset | UpdatePulseDataAttributesDataType0: + def _parse_data(data: object) -> Union["UpdatePulseDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -307,9 +301,9 @@ def _parse_data(data: object) -> None | Unset | UpdatePulseDataAttributesDataTyp data_type_0 = UpdatePulseDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdatePulseDataAttributesDataType0, data) + return cast(Union["UpdatePulseDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py index 30981982..06fff96b 100644 --- a/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py +++ b/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdatePulseDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py index f677ef10..9c825e31 100644 --- a/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py index 8d76f43b..ceff1b7a 100644 --- a/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py +++ b/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_quip_page_task_params.py b/rootly_sdk/models/update_quip_page_task_params.py index 3de18173..de4bf983 100644 --- a/rootly_sdk/models/update_quip_page_task_params.py +++ b/rootly_sdk/models/update_quip_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,25 +18,25 @@ class UpdateQuipPageTaskParams: """ Attributes: file_id (str): The Quip page ID - task_type (UpdateQuipPageTaskParamsTaskType | Unset): - title (str | Unset): The Quip page title - content (str | Unset): The Quip page content - post_mortem_template_id (str | Unset): Retrospective template to use when updating page, if desired - template_id (str | Unset): The Quip file ID to use as a template + task_type (Union[Unset, UpdateQuipPageTaskParamsTaskType]): + title (Union[Unset, str]): The Quip page title + content (Union[Unset, str]): The Quip page content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating page, if desired + template_id (Union[Unset, str]): The Quip file ID to use as a template """ file_id: str - task_type: UpdateQuipPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template_id: str | Unset = UNSET + task_type: Unset | UpdateQuipPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateQuipPageTaskParamsTaskType | Unset + task_type: Unset | UpdateQuipPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_retrospective_configuration.py b/rootly_sdk/models/update_retrospective_configuration.py index e4975c8a..b193a418 100644 --- a/rootly_sdk/models/update_retrospective_configuration.py +++ b/rootly_sdk/models/update_retrospective_configuration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveConfiguration: data (UpdateRetrospectiveConfigurationData): """ - data: UpdateRetrospectiveConfigurationData + data: "UpdateRetrospectiveConfigurationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_configuration_data.py b/rootly_sdk/models/update_retrospective_configuration_data.py index 1d1cf126..35842ed6 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data.py +++ b/rootly_sdk/models/update_retrospective_configuration_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateRetrospectiveConfigurationData: """ type_: UpdateRetrospectiveConfigurationDataType - attributes: UpdateRetrospectiveConfigurationDataAttributes + attributes: "UpdateRetrospectiveConfigurationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py index 969dbf0b..318b73d8 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,17 +12,18 @@ class UpdateRetrospectiveConfigurationDataAttributes: """ Attributes: - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the retrospective configuration - group_ids (list[str] | None | Unset): The Team IDs to attach to the retrospective configuration - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the retrospective configuration + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the retrospective configuration + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the retrospective configuration + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the retrospective + configuration """ - severity_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + severity_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - severity_ids: list[str] | None | Unset + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -33,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: list[str] | None | Unset + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -42,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -67,7 +66,7 @@ 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_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -78,13 +77,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -95,13 +94,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -112,9 +111,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_retrospective_process.py b/rootly_sdk/models/update_retrospective_process.py index ca707e8e..b5e48c48 100644 --- a/rootly_sdk/models/update_retrospective_process.py +++ b/rootly_sdk/models/update_retrospective_process.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveProcess: data (UpdateRetrospectiveProcessData): """ - data: UpdateRetrospectiveProcessData + data: "UpdateRetrospectiveProcessData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_process_data.py b/rootly_sdk/models/update_retrospective_process_data.py index e5a466bb..592d517b 100644 --- a/rootly_sdk/models/update_retrospective_process_data.py +++ b/rootly_sdk/models/update_retrospective_process_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateRetrospectiveProcessData: """ type_: UpdateRetrospectiveProcessDataType - attributes: UpdateRetrospectiveProcessDataAttributes + attributes: "UpdateRetrospectiveProcessDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes.py b/rootly_sdk/models/update_retrospective_process_data_attributes.py index 2627b37f..36f56c48 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,22 +24,22 @@ class UpdateRetrospectiveProcessDataAttributes: """ Attributes: - name (str | Unset): The name of the retrospective process - description (None | str | Unset): The description of the retrospective process - retrospective_process_matching_criteria (Unset | - UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 | - UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 | - UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2): + name (Union[Unset, str]): The name of the retrospective process + description (Union[None, Unset, str]): The description of the retrospective process + retrospective_process_matching_criteria + (Union['UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0', + 'UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1', + 'UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2', Unset]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - retrospective_process_matching_criteria: ( - Unset - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - ) = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + retrospective_process_matching_criteria: Union[ + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0 import ( @@ -53,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: dict[str, Any] | Unset + retrospective_process_matching_criteria: Unset | dict[str, Any] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -102,23 +100,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) def _parse_retrospective_process_matching_criteria( data: object, - ) -> ( - Unset - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - ): + ) -> Union[ + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -129,7 +127,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -139,7 +137,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py index 5fe8b8ec..59823a93 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py index 51a20fd7..0ccf8f66 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py index f8c3eab1..4f61a7b2 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_retrospective_process_group.py b/rootly_sdk/models/update_retrospective_process_group.py index feef5994..95e59d85 100644 --- a/rootly_sdk/models/update_retrospective_process_group.py +++ b/rootly_sdk/models/update_retrospective_process_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveProcessGroup: data (UpdateRetrospectiveProcessGroupData): """ - data: UpdateRetrospectiveProcessGroupData + data: "UpdateRetrospectiveProcessGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_process_group_data.py b/rootly_sdk/models/update_retrospective_process_group_data.py index 8230d21d..8a9b04c0 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data.py +++ b/rootly_sdk/models/update_retrospective_process_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateRetrospectiveProcessGroupData: """ type_: UpdateRetrospectiveProcessGroupDataType - attributes: UpdateRetrospectiveProcessGroupDataAttributes + attributes: "UpdateRetrospectiveProcessGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py index b34d1eac..6c573ac5 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +12,12 @@ class UpdateRetrospectiveProcessGroupDataAttributes: """ Attributes: - sub_status_id (str | Unset): - position (int | Unset): + sub_status_id (Union[Unset, str]): + position (Union[Unset, int]): """ - sub_status_id: str | Unset = UNSET - position: int | Unset = UNSET + sub_status_id: Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id diff --git a/rootly_sdk/models/update_retrospective_process_group_step.py b/rootly_sdk/models/update_retrospective_process_group_step.py index ef0b3d24..59c0725f 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step.py +++ b/rootly_sdk/models/update_retrospective_process_group_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveProcessGroupStep: data (UpdateRetrospectiveProcessGroupStepData): """ - data: UpdateRetrospectiveProcessGroupStepData + data: "UpdateRetrospectiveProcessGroupStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_process_group_step_data.py b/rootly_sdk/models/update_retrospective_process_group_step_data.py index 40bd1a00..72ecd8b3 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateRetrospectiveProcessGroupStepData: """ type_: UpdateRetrospectiveProcessGroupStepDataType - attributes: UpdateRetrospectiveProcessGroupStepDataAttributes + attributes: "UpdateRetrospectiveProcessGroupStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py index 76b6e3c0..2568f90e 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,10 +12,10 @@ class UpdateRetrospectiveProcessGroupStepDataAttributes: """ Attributes: - position (int | Unset): + position (Union[Unset, int]): """ - position: int | Unset = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: position = self.position diff --git a/rootly_sdk/models/update_retrospective_step.py b/rootly_sdk/models/update_retrospective_step.py index e6088f73..bc6d3b12 100644 --- a/rootly_sdk/models/update_retrospective_step.py +++ b/rootly_sdk/models/update_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveStep: data (UpdateRetrospectiveStepData): """ - data: UpdateRetrospectiveStepData + data: "UpdateRetrospectiveStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_step_data.py b/rootly_sdk/models/update_retrospective_step_data.py index 7d559d60..1034ebad 100644 --- a/rootly_sdk/models/update_retrospective_step_data.py +++ b/rootly_sdk/models/update_retrospective_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateRetrospectiveStepData: """ type_: UpdateRetrospectiveStepDataType - attributes: UpdateRetrospectiveStepDataAttributes + attributes: "UpdateRetrospectiveStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_step_data_attributes.py b/rootly_sdk/models/update_retrospective_step_data_attributes.py index 421a8240..a1e7a4fa 100644 --- a/rootly_sdk/models/update_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_step_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,44 +12,53 @@ class UpdateRetrospectiveStepDataAttributes: """ Attributes: - title (str | Unset): The name of the step - description (None | str | Unset): The description of the step - incident_role_id (None | str | Unset): Users assigned to the selected incident role will be the default owners - for this step - due_after_days (int | None | Unset): Due date in days - position (int | None | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + title (Union[Unset, str]): The name of the step + description (Union[None, Unset, str]): The description of the step + incident_role_id (Union[None, Unset, str]): Users assigned to the selected incident role will be the default + owners for this step + due_after_days (Union[None, Unset, int]): Due date in days + position (Union[None, Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ - title: str | Unset = UNSET - description: None | str | Unset = UNSET - incident_role_id: None | str | Unset = UNSET - due_after_days: int | None | Unset = UNSET - position: int | None | Unset = UNSET - skippable: bool | Unset = UNSET + slug: None | Unset | str = UNSET + title: Unset | str = UNSET + description: None | Unset | str = UNSET + incident_role_id: None | Unset | str = UNSET + due_after_days: None | Unset | int = UNSET + position: None | Unset | int = UNSET + skippable: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + title = self.title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: None | str | Unset + incident_role_id: None | Unset | str if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: int | None | Unset + due_after_days: None | Unset | int if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -62,6 +69,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if title is not UNSET: field_dict["title"] = title if description is not UNSET: @@ -80,47 +89,58 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + title = d.pop("title", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> None | str | Unset: + def _parse_incident_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> int | None | Unset: + def _parse_due_after_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) skippable = d.pop("skippable", UNSET) update_retrospective_step_data_attributes = cls( + slug=slug, title=title, description=description, incident_role_id=incident_role_id, diff --git a/rootly_sdk/models/update_role.py b/rootly_sdk/models/update_role.py index fa829337..0e36ba39 100644 --- a/rootly_sdk/models/update_role.py +++ b/rootly_sdk/models/update_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRole: data (UpdateRoleData): """ - data: UpdateRoleData + data: "UpdateRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_role_data.py b/rootly_sdk/models/update_role_data.py index 0237e351..c334e4fe 100644 --- a/rootly_sdk/models/update_role_data.py +++ b/rootly_sdk/models/update_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateRoleData: """ type_: UpdateRoleDataType - attributes: UpdateRoleDataAttributes + attributes: "UpdateRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_role_data_attributes.py b/rootly_sdk/models/update_role_data_attributes.py index 07ecec3c..b802aa29 100644 --- a/rootly_sdk/models/update_role_data_attributes.py +++ b/rootly_sdk/models/update_role_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -138,85 +136,96 @@ class UpdateRoleDataAttributes: """ Attributes: - name (str | Unset): The role name. - incident_permission_set_id (None | str | Unset): Associated incident permissions set. - is_deletable (bool | Unset): Whether the role can be deleted. - is_editable (bool | Unset): Whether the role can be edited. - api_keys_permissions (list[UpdateRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[UpdateRoleDataAttributesAuditsPermissionsItem] | Unset): - billing_permissions (list[UpdateRoleDataAttributesBillingPermissionsItem] | Unset): - environments_permissions (list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] | Unset): - form_fields_permissions (list[UpdateRoleDataAttributesFormFieldsPermissionsItem] | Unset): - functionalities_permissions (list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - groups_permissions (list[UpdateRoleDataAttributesGroupsPermissionsItem] | Unset): - incident_causes_permissions (list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] | Unset): - incident_feedbacks_permissions (list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset): - incident_roles_permissions (list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] | Unset): - incident_types_permissions (list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] | Unset): - incidents_permissions (list[UpdateRoleDataAttributesIncidentsPermissionsItem] | Unset): - integrations_permissions (list[UpdateRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[UpdateRoleDataAttributesInvitationsPermissionsItem] | Unset): - playbooks_permissions (list[UpdateRoleDataAttributesPlaybooksPermissionsItem] | Unset): - private_incidents_permissions (list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset): - retrospective_permissions (list[UpdateRoleDataAttributesRetrospectivePermissionsItem] | Unset): - roles_permissions (list[UpdateRoleDataAttributesRolesPermissionsItem] | Unset): - secrets_permissions (list[UpdateRoleDataAttributesSecretsPermissionsItem] | Unset): - services_permissions (list[UpdateRoleDataAttributesServicesPermissionsItem] | Unset): - severities_permissions (list[UpdateRoleDataAttributesSeveritiesPermissionsItem] | Unset): - status_pages_permissions (list[UpdateRoleDataAttributesStatusPagesPermissionsItem] | Unset): - webhooks_permissions (list[UpdateRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[UpdateRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[UpdateRoleDataAttributesCatalogsPermissionsItem] | Unset): - sub_statuses_permissions (list[UpdateRoleDataAttributesSubStatusesPermissionsItem] | Unset): - edge_connector_permissions (list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] | Unset): - slas_permissions (list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset): - paging_permissions (list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset): - incident_communication_permissions (list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset): - communication_permissions (list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. Custom role slugs remain accepted temporarily. Stop setting `slug`; + it will become read-only and be derived from `name` when this property is removed from the request schema in a + future version. + name (Union[Unset, str]): The role name. + incident_permission_set_id (Union[None, Unset, str]): Associated incident permissions set. + is_deletable (Union[Unset, bool]): Whether the role can be deleted. + is_editable (Union[Unset, bool]): Whether the role can be edited. + api_keys_permissions (Union[Unset, list[UpdateRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[UpdateRoleDataAttributesAuditsPermissionsItem]]): + billing_permissions (Union[Unset, list[UpdateRoleDataAttributesBillingPermissionsItem]]): + environments_permissions (Union[Unset, list[UpdateRoleDataAttributesEnvironmentsPermissionsItem]]): + form_fields_permissions (Union[Unset, list[UpdateRoleDataAttributesFormFieldsPermissionsItem]]): + functionalities_permissions (Union[Unset, list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem]]): + groups_permissions (Union[Unset, list[UpdateRoleDataAttributesGroupsPermissionsItem]]): + incident_causes_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentCausesPermissionsItem]]): + incident_feedbacks_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem]]): + incident_roles_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentRolesPermissionsItem]]): + incident_types_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentTypesPermissionsItem]]): + incidents_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentsPermissionsItem]]): + integrations_permissions (Union[Unset, list[UpdateRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[UpdateRoleDataAttributesInvitationsPermissionsItem]]): + playbooks_permissions (Union[Unset, list[UpdateRoleDataAttributesPlaybooksPermissionsItem]]): + private_incidents_permissions (Union[Unset, list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem]]): + retrospective_permissions (Union[Unset, list[UpdateRoleDataAttributesRetrospectivePermissionsItem]]): + roles_permissions (Union[Unset, list[UpdateRoleDataAttributesRolesPermissionsItem]]): + secrets_permissions (Union[Unset, list[UpdateRoleDataAttributesSecretsPermissionsItem]]): + services_permissions (Union[Unset, list[UpdateRoleDataAttributesServicesPermissionsItem]]): + severities_permissions (Union[Unset, list[UpdateRoleDataAttributesSeveritiesPermissionsItem]]): + status_pages_permissions (Union[Unset, list[UpdateRoleDataAttributesStatusPagesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[UpdateRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[UpdateRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[UpdateRoleDataAttributesCatalogsPermissionsItem]]): + sub_statuses_permissions (Union[Unset, list[UpdateRoleDataAttributesSubStatusesPermissionsItem]]): + edge_connector_permissions (Union[Unset, list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem]]): + slas_permissions (Union[Unset, list[UpdateRoleDataAttributesSlasPermissionsItem]]): + paging_permissions (Union[Unset, list[UpdateRoleDataAttributesPagingPermissionsItem]]): + incident_communication_permissions (Union[Unset, + list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem]]): + communication_permissions (Union[Unset, list[UpdateRoleDataAttributesCommunicationPermissionsItem]]): """ - name: str | Unset = UNSET - incident_permission_set_id: None | str | Unset = UNSET - is_deletable: bool | Unset = UNSET - is_editable: bool | Unset = UNSET - api_keys_permissions: list[UpdateRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[UpdateRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - billing_permissions: list[UpdateRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - environments_permissions: list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - form_fields_permissions: list[UpdateRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - functionalities_permissions: list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - groups_permissions: list[UpdateRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - incident_causes_permissions: list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - incident_feedbacks_permissions: list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - incident_roles_permissions: list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - incident_types_permissions: list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - incidents_permissions: list[UpdateRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - integrations_permissions: list[UpdateRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[UpdateRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - playbooks_permissions: list[UpdateRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - private_incidents_permissions: list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - retrospective_permissions: list[UpdateRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - roles_permissions: list[UpdateRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - secrets_permissions: list[UpdateRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - services_permissions: list[UpdateRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - severities_permissions: list[UpdateRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - status_pages_permissions: list[UpdateRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[UpdateRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[UpdateRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[UpdateRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - sub_statuses_permissions: list[UpdateRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - edge_connector_permissions: list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - slas_permissions: list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - paging_permissions: list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - incident_communication_permissions: list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = ( + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + incident_permission_set_id: None | Unset | str = UNSET + is_deletable: Unset | bool = UNSET + is_editable: Unset | bool = UNSET + api_keys_permissions: Unset | list[UpdateRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[UpdateRoleDataAttributesAuditsPermissionsItem] = UNSET + billing_permissions: Unset | list[UpdateRoleDataAttributesBillingPermissionsItem] = UNSET + environments_permissions: Unset | list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] = UNSET + form_fields_permissions: Unset | list[UpdateRoleDataAttributesFormFieldsPermissionsItem] = UNSET + functionalities_permissions: Unset | list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + groups_permissions: Unset | list[UpdateRoleDataAttributesGroupsPermissionsItem] = UNSET + incident_causes_permissions: Unset | list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] = UNSET + incident_feedbacks_permissions: Unset | list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] = UNSET + incident_roles_permissions: Unset | list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] = UNSET + incident_types_permissions: Unset | list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] = UNSET + incidents_permissions: Unset | list[UpdateRoleDataAttributesIncidentsPermissionsItem] = UNSET + integrations_permissions: Unset | list[UpdateRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[UpdateRoleDataAttributesInvitationsPermissionsItem] = UNSET + playbooks_permissions: Unset | list[UpdateRoleDataAttributesPlaybooksPermissionsItem] = UNSET + private_incidents_permissions: Unset | list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] = UNSET + retrospective_permissions: Unset | list[UpdateRoleDataAttributesRetrospectivePermissionsItem] = UNSET + roles_permissions: Unset | list[UpdateRoleDataAttributesRolesPermissionsItem] = UNSET + secrets_permissions: Unset | list[UpdateRoleDataAttributesSecretsPermissionsItem] = UNSET + services_permissions: Unset | list[UpdateRoleDataAttributesServicesPermissionsItem] = UNSET + severities_permissions: Unset | list[UpdateRoleDataAttributesSeveritiesPermissionsItem] = UNSET + status_pages_permissions: Unset | list[UpdateRoleDataAttributesStatusPagesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[UpdateRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[UpdateRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[UpdateRoleDataAttributesCatalogsPermissionsItem] = UNSET + sub_statuses_permissions: Unset | list[UpdateRoleDataAttributesSubStatusesPermissionsItem] = UNSET + edge_connector_permissions: Unset | list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] = UNSET + slas_permissions: Unset | list[UpdateRoleDataAttributesSlasPermissionsItem] = UNSET + paging_permissions: Unset | list[UpdateRoleDataAttributesPagingPermissionsItem] = UNSET + incident_communication_permissions: Unset | list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] = ( UNSET ) - communication_permissions: list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET + communication_permissions: Unset | list[UpdateRoleDataAttributesCommunicationPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - incident_permission_set_id: None | str | Unset + incident_permission_set_id: None | Unset | str if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -226,217 +235,217 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: list[str] | Unset = UNSET + billing_permissions: Unset | list[str] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: list[str] | Unset = UNSET + environments_permissions: Unset | list[str] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: list[str] | Unset = UNSET + form_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: list[str] | Unset = UNSET + incident_causes_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: list[str] | Unset = UNSET + incident_feedbacks_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: list[str] | Unset = UNSET + incident_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: list[str] | Unset = UNSET + incident_types_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: list[str] | Unset = UNSET + incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: list[str] | Unset = UNSET + playbooks_permissions: Unset | list[str] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: list[str] | Unset = UNSET + private_incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - retrospective_permissions: list[str] | Unset = UNSET + retrospective_permissions: Unset | list[str] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: list[str] | Unset = UNSET + roles_permissions: Unset | list[str] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: list[str] | Unset = UNSET + secrets_permissions: Unset | list[str] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: list[str] | Unset = UNSET + severities_permissions: Unset | list[str] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: list[str] | Unset = UNSET + status_pages_permissions: Unset | list[str] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: list[str] | Unset = UNSET + sub_statuses_permissions: Unset | list[str] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: list[str] | Unset = UNSET + edge_connector_permissions: Unset | list[str] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: list[str] | Unset = UNSET + slas_permissions: Unset | list[str] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: list[str] | Unset = UNSET + paging_permissions: Unset | list[str] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: list[str] | Unset = UNSET + incident_communication_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: list[str] | Unset = UNSET + communication_permissions: Unset | list[str] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -446,6 +455,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if incident_permission_set_id is not UNSET: @@ -522,14 +533,24 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_incident_permission_set_id(data: object) -> None | str | Unset: + def _parse_incident_permission_set_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) @@ -537,356 +558,287 @@ def _parse_incident_permission_set_id(data: object) -> None | str | Unset: is_editable = d.pop("is_editable", UNSET) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[UpdateRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_update_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_update_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[UpdateRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_update_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_update_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - billing_permissions: list[UpdateRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - if _billing_permissions is not UNSET: - billing_permissions = [] - for billing_permissions_item_data in _billing_permissions: - billing_permissions_item = check_update_role_data_attributes_billing_permissions_item( - billing_permissions_item_data - ) + for billing_permissions_item_data in _billing_permissions or []: + billing_permissions_item = check_update_role_data_attributes_billing_permissions_item( + billing_permissions_item_data + ) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) + environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - environments_permissions: list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - if _environments_permissions is not UNSET: - environments_permissions = [] - for environments_permissions_item_data in _environments_permissions: - environments_permissions_item = check_update_role_data_attributes_environments_permissions_item( - environments_permissions_item_data - ) + for environments_permissions_item_data in _environments_permissions or []: + environments_permissions_item = check_update_role_data_attributes_environments_permissions_item( + environments_permissions_item_data + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) + form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - form_fields_permissions: list[UpdateRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - if _form_fields_permissions is not UNSET: - form_fields_permissions = [] - for form_fields_permissions_item_data in _form_fields_permissions: - form_fields_permissions_item = check_update_role_data_attributes_form_fields_permissions_item( - form_fields_permissions_item_data - ) + for form_fields_permissions_item_data in _form_fields_permissions or []: + form_fields_permissions_item = check_update_role_data_attributes_form_fields_permissions_item( + form_fields_permissions_item_data + ) - form_fields_permissions.append(form_fields_permissions_item) + form_fields_permissions.append(form_fields_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_update_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_update_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[UpdateRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_update_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_update_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - incident_causes_permissions: list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - if _incident_causes_permissions is not UNSET: - incident_causes_permissions = [] - for incident_causes_permissions_item_data in _incident_causes_permissions: - incident_causes_permissions_item = check_update_role_data_attributes_incident_causes_permissions_item( - incident_causes_permissions_item_data - ) + for incident_causes_permissions_item_data in _incident_causes_permissions or []: + incident_causes_permissions_item = check_update_role_data_attributes_incident_causes_permissions_item( + incident_causes_permissions_item_data + ) - incident_causes_permissions.append(incident_causes_permissions_item) + incident_causes_permissions.append(incident_causes_permissions_item) + incident_feedbacks_permissions = [] _incident_feedbacks_permissions = d.pop("incident_feedbacks_permissions", UNSET) - incident_feedbacks_permissions: list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - if _incident_feedbacks_permissions is not UNSET: - incident_feedbacks_permissions = [] - for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions: - incident_feedbacks_permissions_item = ( - check_update_role_data_attributes_incident_feedbacks_permissions_item( - incident_feedbacks_permissions_item_data - ) - ) + for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions or []: + incident_feedbacks_permissions_item = check_update_role_data_attributes_incident_feedbacks_permissions_item( + incident_feedbacks_permissions_item_data + ) - incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_roles_permissions = [] _incident_roles_permissions = d.pop("incident_roles_permissions", UNSET) - incident_roles_permissions: list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - if _incident_roles_permissions is not UNSET: - incident_roles_permissions = [] - for incident_roles_permissions_item_data in _incident_roles_permissions: - incident_roles_permissions_item = check_update_role_data_attributes_incident_roles_permissions_item( - incident_roles_permissions_item_data - ) + for incident_roles_permissions_item_data in _incident_roles_permissions or []: + incident_roles_permissions_item = check_update_role_data_attributes_incident_roles_permissions_item( + incident_roles_permissions_item_data + ) - incident_roles_permissions.append(incident_roles_permissions_item) + incident_roles_permissions.append(incident_roles_permissions_item) + incident_types_permissions = [] _incident_types_permissions = d.pop("incident_types_permissions", UNSET) - incident_types_permissions: list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - if _incident_types_permissions is not UNSET: - incident_types_permissions = [] - for incident_types_permissions_item_data in _incident_types_permissions: - incident_types_permissions_item = check_update_role_data_attributes_incident_types_permissions_item( - incident_types_permissions_item_data - ) + for incident_types_permissions_item_data in _incident_types_permissions or []: + incident_types_permissions_item = check_update_role_data_attributes_incident_types_permissions_item( + incident_types_permissions_item_data + ) - incident_types_permissions.append(incident_types_permissions_item) + incident_types_permissions.append(incident_types_permissions_item) + incidents_permissions = [] _incidents_permissions = d.pop("incidents_permissions", UNSET) - incidents_permissions: list[UpdateRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - if _incidents_permissions is not UNSET: - incidents_permissions = [] - for incidents_permissions_item_data in _incidents_permissions: - incidents_permissions_item = check_update_role_data_attributes_incidents_permissions_item( - incidents_permissions_item_data - ) + for incidents_permissions_item_data in _incidents_permissions or []: + incidents_permissions_item = check_update_role_data_attributes_incidents_permissions_item( + incidents_permissions_item_data + ) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[UpdateRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_update_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_update_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[UpdateRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_update_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_update_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - playbooks_permissions: list[UpdateRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - if _playbooks_permissions is not UNSET: - playbooks_permissions = [] - for playbooks_permissions_item_data in _playbooks_permissions: - playbooks_permissions_item = check_update_role_data_attributes_playbooks_permissions_item( - playbooks_permissions_item_data - ) + for playbooks_permissions_item_data in _playbooks_permissions or []: + playbooks_permissions_item = check_update_role_data_attributes_playbooks_permissions_item( + playbooks_permissions_item_data + ) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) + private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - private_incidents_permissions: list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - if _private_incidents_permissions is not UNSET: - private_incidents_permissions = [] - for private_incidents_permissions_item_data in _private_incidents_permissions: - private_incidents_permissions_item = ( - check_update_role_data_attributes_private_incidents_permissions_item( - private_incidents_permissions_item_data - ) - ) + for private_incidents_permissions_item_data in _private_incidents_permissions or []: + private_incidents_permissions_item = check_update_role_data_attributes_private_incidents_permissions_item( + private_incidents_permissions_item_data + ) - private_incidents_permissions.append(private_incidents_permissions_item) + private_incidents_permissions.append(private_incidents_permissions_item) + retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - retrospective_permissions: list[UpdateRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - if _retrospective_permissions is not UNSET: - retrospective_permissions = [] - for retrospective_permissions_item_data in _retrospective_permissions: - retrospective_permissions_item = check_update_role_data_attributes_retrospective_permissions_item( - retrospective_permissions_item_data - ) + for retrospective_permissions_item_data in _retrospective_permissions or []: + retrospective_permissions_item = check_update_role_data_attributes_retrospective_permissions_item( + retrospective_permissions_item_data + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) + roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - roles_permissions: list[UpdateRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - if _roles_permissions is not UNSET: - roles_permissions = [] - for roles_permissions_item_data in _roles_permissions: - roles_permissions_item = check_update_role_data_attributes_roles_permissions_item( - roles_permissions_item_data - ) + for roles_permissions_item_data in _roles_permissions or []: + roles_permissions_item = check_update_role_data_attributes_roles_permissions_item( + roles_permissions_item_data + ) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) + secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - secrets_permissions: list[UpdateRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - if _secrets_permissions is not UNSET: - secrets_permissions = [] - for secrets_permissions_item_data in _secrets_permissions: - secrets_permissions_item = check_update_role_data_attributes_secrets_permissions_item( - secrets_permissions_item_data - ) + for secrets_permissions_item_data in _secrets_permissions or []: + secrets_permissions_item = check_update_role_data_attributes_secrets_permissions_item( + secrets_permissions_item_data + ) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[UpdateRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_update_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_update_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - severities_permissions: list[UpdateRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - if _severities_permissions is not UNSET: - severities_permissions = [] - for severities_permissions_item_data in _severities_permissions: - severities_permissions_item = check_update_role_data_attributes_severities_permissions_item( - severities_permissions_item_data - ) + for severities_permissions_item_data in _severities_permissions or []: + severities_permissions_item = check_update_role_data_attributes_severities_permissions_item( + severities_permissions_item_data + ) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) + status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - status_pages_permissions: list[UpdateRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - if _status_pages_permissions is not UNSET: - status_pages_permissions = [] - for status_pages_permissions_item_data in _status_pages_permissions: - status_pages_permissions_item = check_update_role_data_attributes_status_pages_permissions_item( - status_pages_permissions_item_data - ) + for status_pages_permissions_item_data in _status_pages_permissions or []: + status_pages_permissions_item = check_update_role_data_attributes_status_pages_permissions_item( + status_pages_permissions_item_data + ) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[UpdateRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_update_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_update_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[UpdateRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_update_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_update_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[UpdateRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_update_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_update_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) + sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - sub_statuses_permissions: list[UpdateRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - if _sub_statuses_permissions is not UNSET: - sub_statuses_permissions = [] - for sub_statuses_permissions_item_data in _sub_statuses_permissions: - sub_statuses_permissions_item = check_update_role_data_attributes_sub_statuses_permissions_item( - sub_statuses_permissions_item_data - ) + for sub_statuses_permissions_item_data in _sub_statuses_permissions or []: + sub_statuses_permissions_item = check_update_role_data_attributes_sub_statuses_permissions_item( + sub_statuses_permissions_item_data + ) - sub_statuses_permissions.append(sub_statuses_permissions_item) + sub_statuses_permissions.append(sub_statuses_permissions_item) + edge_connector_permissions = [] _edge_connector_permissions = d.pop("edge_connector_permissions", UNSET) - edge_connector_permissions: list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - if _edge_connector_permissions is not UNSET: - edge_connector_permissions = [] - for edge_connector_permissions_item_data in _edge_connector_permissions: - edge_connector_permissions_item = check_update_role_data_attributes_edge_connector_permissions_item( - edge_connector_permissions_item_data - ) + for edge_connector_permissions_item_data in _edge_connector_permissions or []: + edge_connector_permissions_item = check_update_role_data_attributes_edge_connector_permissions_item( + edge_connector_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - slas_permissions: list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - if _slas_permissions is not UNSET: - slas_permissions = [] - for slas_permissions_item_data in _slas_permissions: - slas_permissions_item = check_update_role_data_attributes_slas_permissions_item( - slas_permissions_item_data - ) + for slas_permissions_item_data in _slas_permissions or []: + slas_permissions_item = check_update_role_data_attributes_slas_permissions_item(slas_permissions_item_data) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) + paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - paging_permissions: list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - if _paging_permissions is not UNSET: - paging_permissions = [] - for paging_permissions_item_data in _paging_permissions: - paging_permissions_item = check_update_role_data_attributes_paging_permissions_item( - paging_permissions_item_data - ) + for paging_permissions_item_data in _paging_permissions or []: + paging_permissions_item = check_update_role_data_attributes_paging_permissions_item( + paging_permissions_item_data + ) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) + incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - incident_communication_permissions: ( - list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset - ) = UNSET - if _incident_communication_permissions is not UNSET: - incident_communication_permissions = [] - for incident_communication_permissions_item_data in _incident_communication_permissions: - incident_communication_permissions_item = ( - check_update_role_data_attributes_incident_communication_permissions_item( - incident_communication_permissions_item_data - ) + for incident_communication_permissions_item_data in _incident_communication_permissions or []: + incident_communication_permissions_item = ( + check_update_role_data_attributes_incident_communication_permissions_item( + incident_communication_permissions_item_data ) + ) - incident_communication_permissions.append(incident_communication_permissions_item) + incident_communication_permissions.append(incident_communication_permissions_item) + communication_permissions = [] _communication_permissions = d.pop("communication_permissions", UNSET) - communication_permissions: list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET - if _communication_permissions is not UNSET: - communication_permissions = [] - for communication_permissions_item_data in _communication_permissions: - communication_permissions_item = check_update_role_data_attributes_communication_permissions_item( - communication_permissions_item_data - ) + for communication_permissions_item_data in _communication_permissions or []: + communication_permissions_item = check_update_role_data_attributes_communication_permissions_item( + communication_permissions_item_data + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) update_role_data_attributes = cls( + slug=slug, name=name, incident_permission_set_id=incident_permission_set_id, is_deletable=is_deletable, diff --git a/rootly_sdk/models/update_schedule.py b/rootly_sdk/models/update_schedule.py index ad2083f3..102bd7ae 100644 --- a/rootly_sdk/models/update_schedule.py +++ b/rootly_sdk/models/update_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSchedule: data (UpdateScheduleData): """ - data: UpdateScheduleData + data: "UpdateScheduleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_data.py b/rootly_sdk/models/update_schedule_data.py index 4cbf9034..58501025 100644 --- a/rootly_sdk/models/update_schedule_data.py +++ b/rootly_sdk/models/update_schedule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateScheduleData: """ type_: UpdateScheduleDataType - attributes: UpdateScheduleDataAttributes + attributes: "UpdateScheduleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_data_attributes.py b/rootly_sdk/models/update_schedule_data_attributes.py index a8609097..894682df 100644 --- a/rootly_sdk/models/update_schedule_data_attributes.py +++ b/rootly_sdk/models/update_schedule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -25,45 +23,45 @@ class UpdateScheduleDataAttributes: """ Attributes: - name (str | Unset): The name of the schedule - description (None | str | Unset): The description of the schedule - all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule - slack_user_group (UpdateScheduleDataAttributesSlackUserGroup | Unset): - slack_channel (None | Unset | UpdateScheduleDataAttributesSlackChannelType0): - owner_group_ids (list[str] | Unset): Owning teams. - owner_user_id (int | None | Unset): ID of the owner of the schedule - sync_linear_enabled (bool | None | Unset): Whether the schedule is synced with Linear - include_shadows_in_slack_notifications (bool | None | Unset): Whether shadow users are included in Slack + name (Union[Unset, str]): The name of the schedule + description (Union[None, Unset, str]): The description of the schedule + all_time_coverage (Union[None, Unset, bool]): 24/7 coverage of the schedule + slack_user_group (Union[Unset, UpdateScheduleDataAttributesSlackUserGroup]): + slack_channel (Union['UpdateScheduleDataAttributesSlackChannelType0', None, Unset]): + owner_group_ids (Union[Unset, list[str]]): Owning teams. + owner_user_id (Union[None, Unset, int]): ID of the owner of the schedule + sync_linear_enabled (Union[None, Unset, bool]): Whether the schedule is synced with Linear + include_shadows_in_slack_notifications (Union[None, Unset, bool]): Whether shadow users are included in Slack notifications and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_start_notifications_enabled (bool | None | Unset): Whether shift-start notifications are enabled. Requires - `slack_channel` to be set; otherwise this value is forced to false on save. - shift_update_notifications_enabled (bool | None | Unset): Whether shift-update notifications are enabled. + shift_start_notifications_enabled (Union[None, Unset, bool]): Whether shift-start notifications are enabled. + Requires `slack_channel` to be set; otherwise this value is forced to false on save. + shift_update_notifications_enabled (Union[None, Unset, bool]): Whether shift-update notifications are enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (bool | None | Unset): Whether the weekly shift summary report is enabled. Requires + shift_report_enabled (Union[None, Unset, bool]): Whether the weekly shift summary report is enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_day_of_week (UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset): Day of week the weekly - shift summary is sent - shift_report_time_of_day (None | str | Unset): Time of day the weekly shift summary is sent, in HH:MM 24-hour - format - shift_report_time_zone (None | str | Unset): IANA time zone used for the weekly shift summary + shift_report_day_of_week (Union[Unset, UpdateScheduleDataAttributesShiftReportDayOfWeek]): Day of week the + weekly shift summary is sent + shift_report_time_of_day (Union[None, Unset, str]): Time of day the weekly shift summary is sent, in HH:MM + 24-hour format + shift_report_time_zone (Union[None, Unset, str]): IANA time zone used for the weekly shift summary """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - all_time_coverage: bool | None | Unset = UNSET - slack_user_group: UpdateScheduleDataAttributesSlackUserGroup | Unset = UNSET - slack_channel: None | Unset | UpdateScheduleDataAttributesSlackChannelType0 = UNSET - owner_group_ids: list[str] | Unset = UNSET - owner_user_id: int | None | Unset = UNSET - sync_linear_enabled: bool | None | Unset = UNSET - include_shadows_in_slack_notifications: bool | None | Unset = UNSET - shift_start_notifications_enabled: bool | None | Unset = UNSET - shift_update_notifications_enabled: bool | None | Unset = UNSET - shift_report_enabled: bool | None | Unset = UNSET - shift_report_day_of_week: UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset = UNSET - shift_report_time_of_day: None | str | Unset = UNSET - shift_report_time_zone: None | str | Unset = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + all_time_coverage: None | Unset | bool = UNSET + slack_user_group: Union[Unset, "UpdateScheduleDataAttributesSlackUserGroup"] = UNSET + slack_channel: Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset] = UNSET + owner_group_ids: Unset | list[str] = UNSET + owner_user_id: None | Unset | int = UNSET + sync_linear_enabled: None | Unset | bool = UNSET + include_shadows_in_slack_notifications: None | Unset | bool = UNSET + shift_start_notifications_enabled: None | Unset | bool = UNSET + shift_update_notifications_enabled: None | Unset | bool = UNSET + shift_report_enabled: None | Unset | bool = UNSET + shift_report_day_of_week: Unset | UpdateScheduleDataAttributesShiftReportDayOfWeek = UNSET + shift_report_time_of_day: None | Unset | str = UNSET + shift_report_time_zone: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_schedule_data_attributes_slack_channel_type_0 import ( @@ -72,23 +70,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: bool | None | Unset + all_time_coverage: None | Unset | bool if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: dict[str, Any] | Unset = UNSET + slack_user_group: Unset | dict[str, Any] = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: dict[str, Any] | None | Unset + slack_channel: None | Unset | dict[str, Any] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, UpdateScheduleDataAttributesSlackChannelType0): @@ -96,57 +94,57 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - owner_user_id: int | None | Unset + owner_user_id: None | Unset | int if isinstance(self.owner_user_id, Unset): owner_user_id = UNSET else: owner_user_id = self.owner_user_id - sync_linear_enabled: bool | None | Unset + sync_linear_enabled: None | Unset | bool if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: bool | None | Unset + include_shadows_in_slack_notifications: None | Unset | bool if isinstance(self.include_shadows_in_slack_notifications, Unset): include_shadows_in_slack_notifications = UNSET else: include_shadows_in_slack_notifications = self.include_shadows_in_slack_notifications - shift_start_notifications_enabled: bool | None | Unset + shift_start_notifications_enabled: None | Unset | bool if isinstance(self.shift_start_notifications_enabled, Unset): shift_start_notifications_enabled = UNSET else: shift_start_notifications_enabled = self.shift_start_notifications_enabled - shift_update_notifications_enabled: bool | None | Unset + shift_update_notifications_enabled: None | Unset | bool if isinstance(self.shift_update_notifications_enabled, Unset): shift_update_notifications_enabled = UNSET else: shift_update_notifications_enabled = self.shift_update_notifications_enabled - shift_report_enabled: bool | None | Unset + shift_report_enabled: None | Unset | bool if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: str | Unset = UNSET + shift_report_day_of_week: Unset | str = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week - shift_report_time_of_day: None | str | Unset + shift_report_time_of_day: None | Unset | str if isinstance(self.shift_report_time_of_day, Unset): shift_report_time_of_day = UNSET else: shift_report_time_of_day = self.shift_report_time_of_day - shift_report_time_zone: None | str | Unset + shift_report_time_zone: None | Unset | str if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: @@ -198,32 +196,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> bool | None | Unset: + def _parse_all_time_coverage(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: UpdateScheduleDataAttributesSlackUserGroup | Unset + slack_user_group: Unset | UpdateScheduleDataAttributesSlackUserGroup if isinstance(_slack_user_group, Unset): slack_user_group = UNSET else: slack_user_group = UpdateScheduleDataAttributesSlackUserGroup.from_dict(_slack_user_group) - def _parse_slack_channel(data: object) -> None | Unset | UpdateScheduleDataAttributesSlackChannelType0: + def _parse_slack_channel(data: object) -> Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -234,76 +232,76 @@ def _parse_slack_channel(data: object) -> None | Unset | UpdateScheduleDataAttri slack_channel_type_0 = UpdateScheduleDataAttributesSlackChannelType0.from_dict(data) return slack_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateScheduleDataAttributesSlackChannelType0, data) + return cast(Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset], data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_id(data: object) -> int | None | Unset: + def _parse_owner_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) - def _parse_sync_linear_enabled(data: object) -> bool | None | Unset: + def _parse_sync_linear_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> bool | None | Unset: + def _parse_include_shadows_in_slack_notifications(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) include_shadows_in_slack_notifications = _parse_include_shadows_in_slack_notifications( d.pop("include_shadows_in_slack_notifications", UNSET) ) - def _parse_shift_start_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_start_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) shift_start_notifications_enabled = _parse_shift_start_notifications_enabled( d.pop("shift_start_notifications_enabled", UNSET) ) - def _parse_shift_update_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_update_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> bool | None | Unset: + def _parse_shift_report_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) shift_report_enabled = _parse_shift_report_enabled(d.pop("shift_report_enabled", UNSET)) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset + shift_report_day_of_week: Unset | UpdateScheduleDataAttributesShiftReportDayOfWeek if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -311,21 +309,21 @@ def _parse_shift_report_enabled(data: object) -> bool | None | Unset: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> None | str | Unset: + def _parse_shift_report_time_of_day(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shift_report_time_of_day = _parse_shift_report_time_of_day(d.pop("shift_report_time_of_day", UNSET)) - def _parse_shift_report_time_zone(data: object) -> None | str | Unset: + def _parse_shift_report_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) diff --git a/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py b/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py index 3c23e5e9..46ca63e0 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py +++ b/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateScheduleDataAttributesSlackChannelType0: """ Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py index c8444389..23c6060f 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py +++ b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateScheduleDataAttributesSlackUserGroup: """ Attributes: - id (str | Unset): Slack user group ID - name (str | Unset): Slack user group name + id (Union[Unset, str]): Slack user group ID + name (Union[Unset, str]): Slack user group name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation.py b/rootly_sdk/models/update_schedule_rotation.py index 70ac37af..921f3797 100644 --- a/rootly_sdk/models/update_schedule_rotation.py +++ b/rootly_sdk/models/update_schedule_rotation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateScheduleRotation: data (UpdateScheduleRotationData): """ - data: UpdateScheduleRotationData + data: "UpdateScheduleRotationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_rotation_active_day.py b/rootly_sdk/models/update_schedule_rotation_active_day.py index 397dded0..e76df6e6 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateScheduleRotationActiveDay: data (UpdateScheduleRotationActiveDayData): """ - data: UpdateScheduleRotationActiveDayData + data: "UpdateScheduleRotationActiveDayData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data.py b/rootly_sdk/models/update_schedule_rotation_active_day_data.py index 9ddf97ca..515b3780 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateScheduleRotationActiveDayData: """ type_: UpdateScheduleRotationActiveDayDataType - attributes: UpdateScheduleRotationActiveDayDataAttributes + attributes: "UpdateScheduleRotationActiveDayDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py index b25922b5..90525656 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,22 +22,24 @@ class UpdateScheduleRotationActiveDayDataAttributes: """ Attributes: - day_name (UpdateScheduleRotationActiveDayDataAttributesDayName | Unset): Schedule rotation day name for which - active times to be created - active_time_attributes (list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset): - Schedule rotation active times per day + day_name (Union[Unset, UpdateScheduleRotationActiveDayDataAttributesDayName]): Schedule rotation day name for + which active times to be created + active_time_attributes (Union[Unset, + list['UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem']]): Schedule rotation active times + per day """ - day_name: UpdateScheduleRotationActiveDayDataAttributesDayName | Unset = UNSET - active_time_attributes: list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset = UNSET + day_name: Unset | UpdateScheduleRotationActiveDayDataAttributesDayName = UNSET + active_time_attributes: Unset | list["UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: - - day_name: str | Unset = UNSET + day_name: Unset | str = UNSET if not isinstance(self.day_name, Unset): day_name = self.day_name - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -64,26 +64,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _day_name = d.pop("day_name", UNSET) - day_name: UpdateScheduleRotationActiveDayDataAttributesDayName | Unset + day_name: Unset | UpdateScheduleRotationActiveDayDataAttributesDayName if isinstance(_day_name, Unset): day_name = UNSET else: day_name = check_update_schedule_rotation_active_day_data_attributes_day_name(_day_name) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset = ( - UNSET - ) - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = ( - UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = ( + UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data ) + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) update_schedule_rotation_active_day_data_attributes = cls( day_name=day_name, diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py index 2b671883..1c322623 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: """ Attributes: - start_time (str | Unset): Start time for schedule rotation active time - end_time (str | Unset): End time for schedule rotation active time + start_time (Union[Unset, str]): Start time for schedule rotation active time + end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_data.py b/rootly_sdk/models/update_schedule_rotation_data.py index 4cfacf30..4e9691fc 100644 --- a/rootly_sdk/models/update_schedule_rotation_data.py +++ b/rootly_sdk/models/update_schedule_rotation_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateScheduleRotationData: """ type_: UpdateScheduleRotationDataType - attributes: UpdateScheduleRotationDataAttributes + attributes: "UpdateScheduleRotationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_data_attributes.py index dfa4b3af..33ed6694 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -47,46 +45,47 @@ class UpdateScheduleRotationDataAttributes: Attributes: schedule_rotationable_type (UpdateScheduleRotationDataAttributesScheduleRotationableType): Schedule rotation type - name (str | Unset): The name of the schedule rotation - position (int | Unset): Position of the schedule rotation - active_all_week (bool | Unset): Schedule rotation active all week? Default: True. - active_days (list[UpdateScheduleRotationDataAttributesActiveDaysItem] | Unset): - active_time_type (str | Unset): - active_time_attributes (list[UpdateScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset): Schedule - rotation's active times - time_zone (str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - schedule_rotationable_attributes (Unset | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3): - start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be + name (Union[Unset, str]): The name of the schedule rotation + position (Union[Unset, int]): Position of the schedule rotation + active_all_week (Union[Unset, bool]): Schedule rotation active all week? Default: True. + active_days (Union[Unset, list[UpdateScheduleRotationDataAttributesActiveDaysItem]]): + active_time_type (Union[Unset, str]): + active_time_attributes (Union[Unset, list['UpdateScheduleRotationDataAttributesActiveTimeAttributesItem']]): + Schedule rotation's active times + time_zone (Union[Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + schedule_rotationable_attributes + (Union['UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0', + 'UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1', + 'UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2', + 'UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3', Unset]): + start_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation ends. Shifts will only be created - before this time. - schedule_rotation_members (list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | - Unset): You can only update schedule rotation members if your account has schedule nesting feature enabled + end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be + created before this time. + schedule_rotation_members (Union[None, Unset, + list['UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item']]): You can only update schedule + rotation members if your account has schedule nesting feature enabled """ schedule_rotationable_type: UpdateScheduleRotationDataAttributesScheduleRotationableType - name: str | Unset = UNSET - position: int | Unset = UNSET - active_all_week: bool | Unset = True - active_days: list[UpdateScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - active_time_type: str | Unset = UNSET - active_time_attributes: list[UpdateScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - time_zone: str | Unset = "Etc/UTC" - schedule_rotationable_attributes: ( - Unset - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ) = UNSET - start_time: datetime.datetime | None | Unset = UNSET - end_time: datetime.datetime | None | Unset = UNSET + name: Unset | str = UNSET + position: Unset | int = UNSET + active_all_week: Unset | bool = True + active_days: Unset | list[UpdateScheduleRotationDataAttributesActiveDaysItem] = UNSET + active_time_type: Unset | str = UNSET + active_time_attributes: Unset | list["UpdateScheduleRotationDataAttributesActiveTimeAttributesItem"] = UNSET + time_zone: Unset | str = "Etc/UTC" + schedule_rotationable_attributes: Union[ + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3", + Unset, + ] = UNSET + start_time: None | Unset | datetime.datetime = UNSET + end_time: None | Unset | datetime.datetime = UNSET schedule_rotation_members: ( - list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset + None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"] ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -108,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: list[str] | Unset = UNSET + active_days: Unset | list[str] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -117,7 +116,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -126,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - schedule_rotationable_attributes: dict[str, Any] | Unset + schedule_rotationable_attributes: Unset | dict[str, Any] if isinstance(self.schedule_rotationable_attributes, Unset): schedule_rotationable_attributes = UNSET elif isinstance( @@ -147,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: else: schedule_rotationable_attributes = self.schedule_rotationable_attributes.to_dict() - start_time: None | str | Unset + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -155,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | str | Unset + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -163,7 +162,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: list[dict[str, Any]] | None | Unset + schedule_rotation_members: None | Unset | list[dict[str, Any]] if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -239,41 +238,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: active_all_week = d.pop("active_all_week", UNSET) + active_days = [] _active_days = d.pop("active_days", UNSET) - active_days: list[UpdateScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - if _active_days is not UNSET: - active_days = [] - for active_days_item_data in _active_days: - active_days_item = check_update_schedule_rotation_data_attributes_active_days_item( - active_days_item_data - ) + for active_days_item_data in _active_days or []: + active_days_item = check_update_schedule_rotation_data_attributes_active_days_item(active_days_item_data) - active_days.append(active_days_item) + active_days.append(active_days_item) active_time_type = d.pop("active_time_type", UNSET) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[UpdateScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = UpdateScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = UpdateScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) time_zone = d.pop("time_zone", UNSET) def _parse_schedule_rotationable_attributes( data: object, - ) -> ( - Unset - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ): + ) -> Union[ + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -284,7 +277,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -294,7 +287,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -304,7 +297,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -318,7 +311,7 @@ def _parse_schedule_rotationable_attributes( d.pop("schedule_rotationable_attributes", UNSET) ) - def _parse_start_time(data: object) -> datetime.datetime | None | Unset: + def _parse_start_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -329,13 +322,13 @@ def _parse_start_time(data: object) -> datetime.datetime | None | Unset: start_time_type_0 = isoparse(data) return start_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> datetime.datetime | None | Unset: + def _parse_end_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -346,15 +339,15 @@ def _parse_end_time(data: object) -> datetime.datetime | None | Unset: end_time_type_0 = isoparse(data) return end_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset: + ) -> None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -374,9 +367,11 @@ def _parse_schedule_rotation_members( schedule_rotation_members_type_0.append(schedule_rotation_members_type_0_item) return schedule_rotation_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset, data) + return cast( + None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"], data + ) schedule_rotation_members = _parse_schedule_rotation_members(d.pop("schedule_rotation_members", UNSET)) diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py index 16999eca..d2f97054 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py index fd3c09dc..26bb8869 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -21,12 +19,12 @@ class UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item: Attributes: member_type (UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType): Type of member member_id (str): ID of the member - position (int | Unset): Position of the member in rotation + position (Union[Unset, int]): Position of the member in rotation """ member_type: UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: int | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py index 252cbab7..d43b06fc 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py index dd465bea..389f8b8b 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py index b9b2c88f..451c364f 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py index 53f98ff3..b36bed23 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_user.py b/rootly_sdk/models/update_schedule_rotation_user.py index 0750bafd..2d3d11c9 100644 --- a/rootly_sdk/models/update_schedule_rotation_user.py +++ b/rootly_sdk/models/update_schedule_rotation_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateScheduleRotationUser: data (UpdateScheduleRotationUserData): """ - data: UpdateScheduleRotationUserData + data: "UpdateScheduleRotationUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_rotation_user_data.py b/rootly_sdk/models/update_schedule_rotation_user_data.py index 460b1e6e..69217cc6 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateScheduleRotationUserData: """ type_: UpdateScheduleRotationUserDataType - attributes: UpdateScheduleRotationUserDataAttributes + attributes: "UpdateScheduleRotationUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py index 7b8c2006..7861c6a9 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +12,12 @@ class UpdateScheduleRotationUserDataAttributes: """ Attributes: - user_id (int | Unset): Schedule rotation user - position (int | Unset): Position of the user inside rotation + user_id (Union[Unset, int]): Schedule rotation user + position (Union[Unset, int]): Position of the user inside rotation """ - user_id: int | Unset = UNSET - position: int | Unset = UNSET + user_id: Unset | int = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_secret.py b/rootly_sdk/models/update_secret.py index 09fb2dc2..cb35d785 100644 --- a/rootly_sdk/models/update_secret.py +++ b/rootly_sdk/models/update_secret.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSecret: data (UpdateSecretData): """ - data: UpdateSecretData + data: "UpdateSecretData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_secret_data.py b/rootly_sdk/models/update_secret_data.py index ed599fda..cebfeff5 100644 --- a/rootly_sdk/models/update_secret_data.py +++ b/rootly_sdk/models/update_secret_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSecretData: """ type_: UpdateSecretDataType - attributes: UpdateSecretDataAttributes + attributes: "UpdateSecretDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_secret_data_attributes.py b/rootly_sdk/models/update_secret_data_attributes.py index 9aaed46f..58b2ee38 100644 --- a/rootly_sdk/models/update_secret_data_attributes.py +++ b/rootly_sdk/models/update_secret_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,36 +13,36 @@ class UpdateSecretDataAttributes: """ Attributes: name (str): The name of the secret - secret (str | Unset): The secret - hashicorp_vault_mount (None | str | Unset): The HashiCorp Vault secret mount path Default: 'secret'. - hashicorp_vault_path (None | str | Unset): The HashiCorp Vault secret path - hashicorp_vault_version (int | None | Unset): The HashiCorp Vault secret version Default: 0. + secret (Union[Unset, str]): The secret + hashicorp_vault_mount (Union[None, Unset, str]): The HashiCorp Vault secret mount path Default: 'secret'. + hashicorp_vault_path (Union[None, Unset, str]): The HashiCorp Vault secret path + hashicorp_vault_version (Union[None, Unset, int]): The HashiCorp Vault secret version Default: 0. """ name: str - secret: str | Unset = UNSET - hashicorp_vault_mount: None | str | Unset = "secret" - hashicorp_vault_path: None | str | Unset = UNSET - hashicorp_vault_version: int | None | Unset = 0 + secret: Unset | str = UNSET + hashicorp_vault_mount: None | Unset | str = "secret" + hashicorp_vault_path: None | Unset | str = UNSET + hashicorp_vault_version: None | Unset | int = 0 def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - hashicorp_vault_mount: None | str | Unset + hashicorp_vault_mount: None | Unset | str if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | str | Unset + hashicorp_vault_path: None | Unset | str if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: int | None | Unset + hashicorp_vault_version: None | Unset | int if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: @@ -75,30 +73,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret", UNSET) - def _parse_hashicorp_vault_mount(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_mount(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> int | None | Unset: + def _parse_hashicorp_vault_version(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) diff --git a/rootly_sdk/models/update_service.py b/rootly_sdk/models/update_service.py index f5bf5217..e1c9b8af 100644 --- a/rootly_sdk/models/update_service.py +++ b/rootly_sdk/models/update_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateService: data (UpdateServiceData): """ - data: UpdateServiceData + data: "UpdateServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_service_data.py b/rootly_sdk/models/update_service_data.py index f37ffa9f..66ba895b 100644 --- a/rootly_sdk/models/update_service_data.py +++ b/rootly_sdk/models/update_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateServiceData: """ type_: UpdateServiceDataType - attributes: UpdateServiceDataAttributes + attributes: "UpdateServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_service_data_attributes.py b/rootly_sdk/models/update_service_data_attributes.py index 2f07c2ad..3782a4e9 100644 --- a/rootly_sdk/models/update_service_data_attributes.py +++ b/rootly_sdk/models/update_service_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -30,78 +28,86 @@ class UpdateServiceDataAttributes: """ Attributes: - name (str | Unset): The name of the service - description (None | str | Unset): The description of the service - public_description (None | str | Unset): The public description of the service - notify_emails (list[str] | None | Unset): Emails to attach to the service - color (None | str | Unset): The hex color of the service - position (int | None | Unset): Position of the service - backstage_id (None | str | Unset): The Backstage entity id associated to this service. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the service + description (Union[None, Unset, str]): The description of the service + public_description (Union[None, Unset, str]): The status page description of the service + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the service + color (Union[None, Unset, str]): The hex color of the service + position (Union[None, Unset, int]): Position of the service + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this service. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this service - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this service - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this service - cortex_id (None | str | Unset): The Cortex group id associated to this service - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this service - github_repository_name (None | str | Unset): The GitHub repository name associated to this service. eg: + external_id (Union[None, Unset, str]): The external id associated to this service + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this service + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this service + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this service + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this service + github_repository_name (Union[None, Unset, str]): The GitHub repository name associated to this service. eg: rootlyhq/my-service - github_repository_branch (None | str | Unset): The GitHub repository branch associated to this service. eg: main - gitlab_repository_name (None | str | Unset): The GitLab repository name associated to this service. eg: + github_repository_branch (Union[None, Unset, str]): The GitHub repository branch associated to this service. eg: + main + gitlab_repository_name (Union[None, Unset, str]): The GitLab repository name associated to this service. eg: rootlyhq/my-service - gitlab_repository_branch (None | str | Unset): The GitLab repository branch associated to this service. eg: main - environment_ids (list[str] | None | Unset): Environments associated with this service - service_ids (list[str] | None | Unset): Services dependent on this service - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this service - owner_user_ids (list[int] | None | Unset): Owner Users associated with this service - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the service - escalation_policy_id (None | str | Unset): The escalation policy id of the service - kubernetes_deployment_name (None | str | Unset): The Kubernetes deployment name associated to this service. eg: - namespace/deployment-name - slack_channels (list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + gitlab_repository_branch (Union[None, Unset, str]): The GitLab repository branch associated to this service. eg: + main + environment_ids (Union[None, Unset, list[str]]): Environments associated with this service + service_ids (Union[None, Unset, list[str]]): Services dependent on this service + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this service. Empty array removes + all; omitting or null leaves unchanged. + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this service. Empty array removes + all; omitting or null leaves unchanged. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the service + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the service + kubernetes_deployment_name (Union[None, Unset, str]): The Kubernetes deployment name associated to this service. + eg: namespace/deployment-name + slack_channels (Union[None, Unset, list['UpdateServiceDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this service + slack_aliases (Union[None, Unset, list['UpdateServiceDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this service - slack_aliases (list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this service - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0): Slack - channel to broadcast incidents to - properties (list[UpdateServiceDataAttributesPropertiesItem] | Unset): Array of property values for this service. + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['UpdateServiceDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack + channel to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['UpdateServiceDataAttributesIncidentBroadcastChannelType0', None, Unset]): + Slack channel to broadcast incidents to + properties (Union[Unset, list['UpdateServiceDataAttributesPropertiesItem']]): Array of property values for this + service. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - slack_channels: list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0 = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0 = UNSET - properties: list[UpdateServiceDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + escalation_policy_id: None | Unset | str = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + slack_channels: None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET + alert_broadcast_channel: Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET + incident_broadcast_channel: Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + properties: Unset | list["UpdateServiceDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -111,21 +117,27 @@ def to_dict(self) -> dict[str, Any]: UpdateServiceDataAttributesIncidentBroadcastChannelType0, ) + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -134,79 +146,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: None | str | Unset + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: list[str] | None | Unset + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -215,7 +227,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -224,7 +236,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -233,7 +245,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -242,31 +254,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | str | Unset + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -278,7 +290,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -290,13 +302,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateServiceDataAttributesAlertBroadcastChannelType0): @@ -304,13 +316,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateServiceDataAttributesIncidentBroadcastChannelType0): @@ -318,7 +330,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -328,6 +340,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -410,27 +424,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -441,121 +465,121 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -566,13 +590,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -583,13 +607,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -600,13 +624,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -617,51 +641,51 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -679,13 +703,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -703,24 +729,24 @@ def _parse_slack_aliases(data: object) -> list[UpdateServiceDataAttributesSlackA slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0: + ) -> Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -731,24 +757,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = UpdateServiceDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0, data) + return cast(Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0: + ) -> Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -761,22 +787,21 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0, data) + return cast(Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateServiceDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateServiceDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateServiceDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_service_data_attributes = cls( + slug=slug, name=name, description=description, public_description=public_description, diff --git a/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py index ec637d7b..d153a8a6 100644 --- a/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class UpdateServiceDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py index aff0a0b6..8de96ac0 100644 --- a/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class UpdateServiceDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_data_attributes_properties_item.py b/rootly_sdk/models/update_service_data_attributes_properties_item.py index ed866804..c548afb0 100644 --- a/rootly_sdk/models/update_service_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_service_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py index 1f0653e1..fda97fed 100644 --- a/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py index 42f2f67c..fb934d04 100644 --- a/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_service_now_incident_task_params.py b/rootly_sdk/models/update_service_now_incident_task_params.py index ac5e8b1a..2b6e9bdc 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params.py +++ b/rootly_sdk/models/update_service_now_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,29 +23,28 @@ class UpdateServiceNowIncidentTaskParams: """ Attributes: incident_id (str): The incident id - task_type (UpdateServiceNowIncidentTaskParamsTaskType | Unset): - title (str | Unset): The incident title - description (str | Unset): The incident description - priority (UpdateServiceNowIncidentTaskParamsPriority | Unset): The priority id and display name - completion (UpdateServiceNowIncidentTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateServiceNowIncidentTaskParamsTaskType]): + title (Union[Unset, str]): The incident title + description (Union[Unset, str]): The incident description + priority (Union[Unset, UpdateServiceNowIncidentTaskParamsPriority]): The priority id and display name + completion (Union[Unset, UpdateServiceNowIncidentTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ incident_id: str - task_type: UpdateServiceNowIncidentTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - priority: UpdateServiceNowIncidentTaskParamsPriority | Unset = UNSET - completion: UpdateServiceNowIncidentTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Unset | UpdateServiceNowIncidentTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + priority: Union[Unset, "UpdateServiceNowIncidentTaskParamsPriority"] = UNSET + completion: Union[Unset, "UpdateServiceNowIncidentTaskParamsCompletion"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_id = self.incident_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,15 +52,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -102,7 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_id = d.pop("incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateServiceNowIncidentTaskParamsTaskType | Unset + task_type: Unset | UpdateServiceNowIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -113,25 +110,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateServiceNowIncidentTaskParamsPriority | Unset + priority: Unset | UpdateServiceNowIncidentTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: UpdateServiceNowIncidentTaskParamsCompletion | Unset + completion: Unset | UpdateServiceNowIncidentTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_service_now_incident_task_params_completion.py b/rootly_sdk/models/update_service_now_incident_task_params_completion.py index f88a1164..8c295c19 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_completion.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateServiceNowIncidentTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_now_incident_task_params_priority.py b/rootly_sdk/models/update_service_now_incident_task_params_priority.py index a48fa9a6..f71ab86f 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_priority.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateServiceNowIncidentTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_severity.py b/rootly_sdk/models/update_severity.py index c4018f33..eea36150 100644 --- a/rootly_sdk/models/update_severity.py +++ b/rootly_sdk/models/update_severity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSeverity: data (UpdateSeverityData): """ - data: UpdateSeverityData + data: "UpdateSeverityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_severity_data.py b/rootly_sdk/models/update_severity_data.py index 7e03bb83..3e607d77 100644 --- a/rootly_sdk/models/update_severity_data.py +++ b/rootly_sdk/models/update_severity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSeverityData: """ type_: UpdateSeverityDataType - attributes: UpdateSeverityDataAttributes + attributes: "UpdateSeverityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_severity_data_attributes.py b/rootly_sdk/models/update_severity_data_attributes.py index 0cba8e42..4eac8106 100644 --- a/rootly_sdk/models/update_severity_data_attributes.py +++ b/rootly_sdk/models/update_severity_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,54 +25,62 @@ class UpdateSeverityDataAttributes: """ Attributes: - name (str | Unset): The name of the severity - description (None | str | Unset): The description of the severity - severity (UpdateSeverityDataAttributesSeverity | Unset): The severity of the severity - color (None | str | Unset): The hex color of the severity - position (int | None | Unset): Position of the severity - notify_emails (list[str] | None | Unset): Emails to attach to the severity - slack_channels (list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the severity + description (Union[None, Unset, str]): The description of the severity + severity (Union[Unset, UpdateSeverityDataAttributesSeverity]): The severity of the severity + color (Union[None, Unset, str]): The hex color of the severity + position (Union[None, Unset, int]): Position of the severity + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the severity + slack_channels (Union[None, Unset, list['UpdateSeverityDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this severity + slack_aliases (Union[None, Unset, list['UpdateSeverityDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this severity - slack_aliases (list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this severity """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - severity: UpdateSeverityDataAttributesSeverity | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + severity: Unset | UpdateSeverityDataAttributesSeverity = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: str | Unset = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -83,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -95,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -110,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -139,43 +147,53 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: UpdateSeverityDataAttributesSeverity | Unset + severity: Unset | UpdateSeverityDataAttributesSeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -186,15 +204,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -212,15 +230,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -238,13 +256,14 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) update_severity_data_attributes = cls( + slug=slug, name=name, description=description, severity=severity, diff --git a/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py index ac383ddc..bfe51d70 100644 --- a/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py index e4b47c5e..f429bb07 100644 --- a/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_sharepoint_page_task_params.py b/rootly_sdk/models/update_sharepoint_page_task_params.py index c8af9115..280b8bbb 100644 --- a/rootly_sdk/models/update_sharepoint_page_task_params.py +++ b/rootly_sdk/models/update_sharepoint_page_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -20,23 +18,23 @@ class UpdateSharepointPageTaskParams: """ Attributes: file_id (str): The SharePoint file ID - task_type (UpdateSharepointPageTaskParamsTaskType | Unset): - title (str | Unset): The SharePoint document title - content (str | Unset): The SharePoint document content - post_mortem_template_id (str | Unset): Retrospective template to use when updating document, if desired + task_type (Union[Unset, UpdateSharepointPageTaskParamsTaskType]): + title (Union[Unset, str]): The SharePoint document title + content (Union[Unset, str]): The SharePoint document content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating document, if desired """ file_id: str - task_type: UpdateSharepointPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET + task_type: Unset | UpdateSharepointPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateSharepointPageTaskParamsTaskType | Unset + task_type: Unset | UpdateSharepointPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_story_task_params.py b/rootly_sdk/models/update_shortcut_story_task_params.py index 9064d34c..96ad23fa 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params.py +++ b/rootly_sdk/models/update_shortcut_story_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,29 +23,28 @@ class UpdateShortcutStoryTaskParams: Attributes: story_id (str): The story id archivation (UpdateShortcutStoryTaskParamsArchivation): The archivation id and display name - task_type (UpdateShortcutStoryTaskParamsTaskType | Unset): - title (str | Unset): The incident title - description (str | Unset): The incident description - labels (str | Unset): The story labels - due_date (str | Unset): The due date + task_type (Union[Unset, UpdateShortcutStoryTaskParamsTaskType]): + title (Union[Unset, str]): The incident title + description (Union[Unset, str]): The incident description + labels (Union[Unset, str]): The story labels + due_date (Union[Unset, str]): The due date """ story_id: str - archivation: UpdateShortcutStoryTaskParamsArchivation - task_type: UpdateShortcutStoryTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET + archivation: "UpdateShortcutStoryTaskParamsArchivation" + task_type: Unset | UpdateShortcutStoryTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - story_id = self.story_id archivation = self.archivation.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: archivation = UpdateShortcutStoryTaskParamsArchivation.from_dict(d.pop("archivation")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateShortcutStoryTaskParamsTaskType | Unset + task_type: Unset | UpdateShortcutStoryTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py index faabfdc3..95ac2aae 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py +++ b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateShortcutStoryTaskParamsArchivation: """The archivation id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_shortcut_task_task_params.py b/rootly_sdk/models/update_shortcut_task_task_params.py index 4d0d99c3..e1168caf 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params.py +++ b/rootly_sdk/models/update_shortcut_task_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,26 +24,25 @@ class UpdateShortcutTaskTaskParams: task_id (str): The task id parent_story_id (str): The parent story completion (UpdateShortcutTaskTaskParamsCompletion): The completion id and display name - task_type (UpdateShortcutTaskTaskParamsTaskType | Unset): - description (str | Unset): The task description + task_type (Union[Unset, UpdateShortcutTaskTaskParamsTaskType]): + description (Union[Unset, str]): The task description """ task_id: str parent_story_id: str - completion: UpdateShortcutTaskTaskParamsCompletion - task_type: UpdateShortcutTaskTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET + completion: "UpdateShortcutTaskTaskParamsCompletion" + task_type: Unset | UpdateShortcutTaskTaskParamsTaskType = UNSET + description: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id parent_story_id = self.parent_story_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateShortcutTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateShortcutTaskTaskParamsTaskType | Unset + task_type: Unset | UpdateShortcutTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_task_task_params_completion.py b/rootly_sdk/models/update_shortcut_task_task_params_completion.py index 1d7d80bf..fed6aadd 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/update_shortcut_task_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateShortcutTaskTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_sla.py b/rootly_sdk/models/update_sla.py index 37dabf11..06214811 100644 --- a/rootly_sdk/models/update_sla.py +++ b/rootly_sdk/models/update_sla.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSla: data (UpdateSlaData): """ - data: UpdateSlaData + data: "UpdateSlaData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_sla_data.py b/rootly_sdk/models/update_sla_data.py index d172f4f3..8676003f 100644 --- a/rootly_sdk/models/update_sla_data.py +++ b/rootly_sdk/models/update_sla_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSlaData: """ type_: UpdateSlaDataType - attributes: UpdateSlaDataAttributes + attributes: "UpdateSlaDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_sla_data_attributes.py b/rootly_sdk/models/update_sla_data_attributes.py index 76ae5a32..e16d8136 100644 --- a/rootly_sdk/models/update_sla_data_attributes.py +++ b/rootly_sdk/models/update_sla_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -42,73 +40,81 @@ class UpdateSlaDataAttributes: """ Attributes: - name (str | Unset): The name of the SLA - description (None | str | Unset): A description of the SLA - position (int | None | Unset): Position of the SLA for ordering - condition_match_type (UpdateSlaDataAttributesConditionMatchType | Unset): Whether all or any conditions must - match - manager_role_id (None | Unset | UUID): The ID of the incident role responsible for this SLA. Exactly one of + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the SLA + description (Union[None, Unset, str]): A description of the SLA + position (Union[None, Unset, int]): Position of the SLA for ordering + condition_match_type (Union[Unset, UpdateSlaDataAttributesConditionMatchType]): Whether all or any conditions + must match + manager_role_id (Union[None, UUID, Unset]): The ID of the incident role responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. - manager_user_id (int | None | Unset): The ID of the user responsible for this SLA. Exactly one of + manager_user_id (Union[None, Unset, int]): The ID of the user responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. - assignment_deadline_days (UpdateSlaDataAttributesAssignmentDeadlineDays | Unset): Number of days for the + assignment_deadline_days (Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays]): Number of days for the assignment deadline - assignment_deadline_parent_status (UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset): The incident - parent status that triggers the assignment deadline - assignment_deadline_sub_status_id (None | Unset | UUID): Sub-status for the assignment deadline. Required when - custom lifecycle statuses are enabled on the team. - assignment_skip_weekends (bool | Unset): Whether to skip weekends when calculating the assignment deadline - completion_deadline_days (UpdateSlaDataAttributesCompletionDeadlineDays | Unset): Number of days for the + assignment_deadline_parent_status (Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineParentStatus]): The + incident parent status that triggers the assignment deadline + assignment_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the assignment deadline. Required + when custom lifecycle statuses are enabled on the team. + assignment_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the assignment deadline + completion_deadline_days (Union[Unset, UpdateSlaDataAttributesCompletionDeadlineDays]): Number of days for the completion deadline - completion_deadline_parent_status (UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset): The incident - parent status that triggers the completion deadline - completion_deadline_sub_status_id (None | Unset | UUID): Sub-status for the completion deadline. Required when - custom lifecycle statuses are enabled on the team. - completion_skip_weekends (bool | Unset): Whether to skip weekends when calculating the completion deadline - conditions (list[UpdateSlaDataAttributesConditionsItem] | Unset): Conditions that determine which incidents this - SLA applies to. Replaces all existing conditions. - notification_configurations (list[UpdateSlaDataAttributesNotificationConfigurationsItem] | Unset): Notification - timing configurations. Replaces all existing configurations. + completion_deadline_parent_status (Union[Unset, UpdateSlaDataAttributesCompletionDeadlineParentStatus]): The + incident parent status that triggers the completion deadline + completion_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the completion deadline. Required + when custom lifecycle statuses are enabled on the team. + completion_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the completion deadline + conditions (Union[Unset, list['UpdateSlaDataAttributesConditionsItem']]): Conditions that determine which + incidents this SLA applies to. Replaces all existing conditions. + notification_configurations (Union[Unset, list['UpdateSlaDataAttributesNotificationConfigurationsItem']]): + Notification timing configurations. Replaces all existing configurations. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - condition_match_type: UpdateSlaDataAttributesConditionMatchType | Unset = UNSET - manager_role_id: None | Unset | UUID = UNSET - manager_user_id: int | None | Unset = UNSET - assignment_deadline_days: UpdateSlaDataAttributesAssignmentDeadlineDays | Unset = UNSET - assignment_deadline_parent_status: UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset = UNSET - assignment_deadline_sub_status_id: None | Unset | UUID = UNSET - assignment_skip_weekends: bool | Unset = UNSET - completion_deadline_days: UpdateSlaDataAttributesCompletionDeadlineDays | Unset = UNSET - completion_deadline_parent_status: UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset = UNSET - completion_deadline_sub_status_id: None | Unset | UUID = UNSET - completion_skip_weekends: bool | Unset = UNSET - conditions: list[UpdateSlaDataAttributesConditionsItem] | Unset = UNSET - notification_configurations: list[UpdateSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + condition_match_type: Unset | UpdateSlaDataAttributesConditionMatchType = UNSET + manager_role_id: None | UUID | Unset = UNSET + manager_user_id: None | Unset | int = UNSET + assignment_deadline_days: Unset | UpdateSlaDataAttributesAssignmentDeadlineDays = UNSET + assignment_deadline_parent_status: Unset | UpdateSlaDataAttributesAssignmentDeadlineParentStatus = UNSET + assignment_deadline_sub_status_id: None | UUID | Unset = UNSET + assignment_skip_weekends: Unset | bool = UNSET + completion_deadline_days: Unset | UpdateSlaDataAttributesCompletionDeadlineDays = UNSET + completion_deadline_parent_status: Unset | UpdateSlaDataAttributesCompletionDeadlineParentStatus = UNSET + completion_deadline_sub_status_id: None | UUID | Unset = UNSET + completion_skip_weekends: Unset | bool = UNSET + conditions: Unset | list["UpdateSlaDataAttributesConditionsItem"] = UNSET + notification_configurations: Unset | list["UpdateSlaDataAttributesNotificationConfigurationsItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: str | Unset = UNSET + condition_match_type: Unset | str = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: None | str | Unset + manager_role_id: None | Unset | str if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -116,21 +122,21 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: int | None | Unset + manager_user_id: None | Unset | int if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_days: int | Unset = UNSET + assignment_deadline_days: Unset | int = UNSET if not isinstance(self.assignment_deadline_days, Unset): assignment_deadline_days = self.assignment_deadline_days - assignment_deadline_parent_status: str | Unset = UNSET + assignment_deadline_parent_status: Unset | str = UNSET if not isinstance(self.assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = self.assignment_deadline_parent_status - assignment_deadline_sub_status_id: None | str | Unset + assignment_deadline_sub_status_id: None | Unset | str if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -140,15 +146,15 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_days: int | Unset = UNSET + completion_deadline_days: Unset | int = UNSET if not isinstance(self.completion_deadline_days, Unset): completion_deadline_days = self.completion_deadline_days - completion_deadline_parent_status: str | Unset = UNSET + completion_deadline_parent_status: Unset | str = UNSET if not isinstance(self.completion_deadline_parent_status, Unset): completion_deadline_parent_status = self.completion_deadline_parent_status - completion_deadline_sub_status_id: None | str | Unset + completion_deadline_sub_status_id: None | Unset | str if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -158,14 +164,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: list[dict[str, Any]] | Unset = UNSET + notification_configurations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -175,6 +181,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -218,34 +226,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: UpdateSlaDataAttributesConditionMatchType | Unset + condition_match_type: Unset | UpdateSlaDataAttributesConditionMatchType if isinstance(_condition_match_type, Unset): condition_match_type = UNSET else: condition_match_type = check_update_sla_data_attributes_condition_match_type(_condition_match_type) - def _parse_manager_role_id(data: object) -> None | Unset | UUID: + def _parse_manager_role_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -256,23 +274,23 @@ def _parse_manager_role_id(data: object) -> None | Unset | UUID: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> int | None | Unset: + def _parse_manager_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) _assignment_deadline_days = d.pop("assignment_deadline_days", UNSET) - assignment_deadline_days: UpdateSlaDataAttributesAssignmentDeadlineDays | Unset + assignment_deadline_days: Unset | UpdateSlaDataAttributesAssignmentDeadlineDays if isinstance(_assignment_deadline_days, Unset): assignment_deadline_days = UNSET else: @@ -281,7 +299,7 @@ def _parse_manager_user_id(data: object) -> int | None | Unset: ) _assignment_deadline_parent_status = d.pop("assignment_deadline_parent_status", UNSET) - assignment_deadline_parent_status: UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset + assignment_deadline_parent_status: Unset | UpdateSlaDataAttributesAssignmentDeadlineParentStatus if isinstance(_assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = UNSET else: @@ -289,7 +307,7 @@ def _parse_manager_user_id(data: object) -> int | None | Unset: _assignment_deadline_parent_status ) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -300,9 +318,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -311,7 +329,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) _completion_deadline_days = d.pop("completion_deadline_days", UNSET) - completion_deadline_days: UpdateSlaDataAttributesCompletionDeadlineDays | Unset + completion_deadline_days: Unset | UpdateSlaDataAttributesCompletionDeadlineDays if isinstance(_completion_deadline_days, Unset): completion_deadline_days = UNSET else: @@ -320,7 +338,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI ) _completion_deadline_parent_status = d.pop("completion_deadline_parent_status", UNSET) - completion_deadline_parent_status: UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset + completion_deadline_parent_status: Unset | UpdateSlaDataAttributesCompletionDeadlineParentStatus if isinstance(_completion_deadline_parent_status, Unset): completion_deadline_parent_status = UNSET else: @@ -328,7 +346,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI _completion_deadline_parent_status ) - def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -339,9 +357,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -349,27 +367,24 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[UpdateSlaDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = UpdateSlaDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = UpdateSlaDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) + notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - notification_configurations: list[UpdateSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET - if _notification_configurations is not UNSET: - notification_configurations = [] - for notification_configurations_item_data in _notification_configurations: - notification_configurations_item = UpdateSlaDataAttributesNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + for notification_configurations_item_data in _notification_configurations or []: + notification_configurations_item = UpdateSlaDataAttributesNotificationConfigurationsItem.from_dict( + notification_configurations_item_data + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) update_sla_data_attributes = cls( + slug=slug, name=name, description=description, position=position, diff --git a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py index 2b02950b..82f24748 100644 --- a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -26,21 +24,21 @@ class UpdateSlaDataAttributesConditionsItem: Attributes: conditionable_type (UpdateSlaDataAttributesConditionsItemConditionableType): The type of condition operator (str): The comparison operator - property_ (UpdateSlaDataAttributesConditionsItemProperty | Unset): The property to evaluate (for built-in field - conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as + property_ (Union[Unset, UpdateSlaDataAttributesConditionsItemProperty]): The property to evaluate (for built-in + field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. - values (list[str] | None | Unset): The values to compare against - form_field_id (None | Unset | UUID): The ID of the form field (for custom field conditions) - position (int | Unset): The position of the condition for ordering + values (Union[None, Unset, list[str]]): The values to compare against + form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) + position (Union[Unset, int]): The position of the condition for ordering """ conditionable_type: UpdateSlaDataAttributesConditionsItemConditionableType operator: str - property_: UpdateSlaDataAttributesConditionsItemProperty | Unset = UNSET - values: list[str] | None | Unset = UNSET - form_field_id: None | Unset | UUID = UNSET - position: int | Unset = UNSET + property_: Unset | UpdateSlaDataAttributesConditionsItemProperty = UNSET + values: None | Unset | list[str] = UNSET + form_field_id: None | UUID | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,11 +46,11 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - property_: str | Unset = UNSET + property_: Unset | str = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: list[str] | None | Unset + values: None | Unset | list[str] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -61,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | str | Unset + form_field_id: None | Unset | str if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -100,13 +98,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = d.pop("operator") _property_ = d.pop("property", UNSET) - property_: UpdateSlaDataAttributesConditionsItemProperty | Unset + property_: Unset | UpdateSlaDataAttributesConditionsItemProperty if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_update_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> list[str] | None | Unset: + def _parse_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -117,13 +115,13 @@ def _parse_values(data: object) -> list[str] | None | Unset: values_type_0 = cast(list[str], data) return values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | Unset | UUID: + def _parse_form_field_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -134,9 +132,9 @@ def _parse_form_field_id(data: object) -> None | Unset | UUID: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(None | UUID | Unset, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py b/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py index d4296bf0..9e6b7a2c 100644 --- a/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py +++ b/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_slack_channel_topic_task_params.py b/rootly_sdk/models/update_slack_channel_topic_task_params.py index bad81d39..50023adc 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,21 +23,20 @@ class UpdateSlackChannelTopicTaskParams: Attributes: channel (UpdateSlackChannelTopicTaskParamsChannel): topic (str): - task_type (UpdateSlackChannelTopicTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType]): """ - channel: UpdateSlackChannelTopicTaskParamsChannel + channel: "UpdateSlackChannelTopicTaskParamsChannel" topic: str - task_type: UpdateSlackChannelTopicTaskParamsTaskType | Unset = UNSET + task_type: Unset | UpdateSlackChannelTopicTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() topic = self.topic - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: UpdateSlackChannelTopicTaskParamsTaskType | Unset + task_type: Unset | UpdateSlackChannelTopicTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py b/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py index 134f02c9..fc44769d 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateSlackChannelTopicTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_status_page.py b/rootly_sdk/models/update_status_page.py index cd6792b0..3cbbccdd 100644 --- a/rootly_sdk/models/update_status_page.py +++ b/rootly_sdk/models/update_status_page.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateStatusPage: data (UpdateStatusPageData): """ - data: UpdateStatusPageData + data: "UpdateStatusPageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_status_page_announcement.py b/rootly_sdk/models/update_status_page_announcement.py new file mode 100644 index 00000000..4fa689e1 --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_status_page_announcement_data import UpdateStatusPageAnnouncementData + + +T = TypeVar("T", bound="UpdateStatusPageAnnouncement") + + +@_attrs_define +class UpdateStatusPageAnnouncement: + """ + Attributes: + data (UpdateStatusPageAnnouncementData): + """ + + data: "UpdateStatusPageAnnouncementData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_announcement_data import UpdateStatusPageAnnouncementData + + d = dict(src_dict) + data = UpdateStatusPageAnnouncementData.from_dict(d.pop("data")) + + update_status_page_announcement = cls( + data=data, + ) + + update_status_page_announcement.additional_properties = d + return update_status_page_announcement + + @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/rootly_sdk/models/update_status_page_announcement_data.py b/rootly_sdk/models/update_status_page_announcement_data.py new file mode 100644 index 00000000..d3144c10 --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_status_page_announcement_data_type import ( + UpdateStatusPageAnnouncementDataType, + check_update_status_page_announcement_data_type, +) + +if TYPE_CHECKING: + from ..models.update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageAnnouncementData") + + +@_attrs_define +class UpdateStatusPageAnnouncementData: + """ + Attributes: + type_ (UpdateStatusPageAnnouncementDataType): + attributes (UpdateStatusPageAnnouncementDataAttributes): + """ + + type_: UpdateStatusPageAnnouncementDataType + attributes: "UpdateStatusPageAnnouncementDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes + + d = dict(src_dict) + type_ = check_update_status_page_announcement_data_type(d.pop("type")) + + attributes = UpdateStatusPageAnnouncementDataAttributes.from_dict(d.pop("attributes")) + + update_status_page_announcement_data = cls( + type_=type_, + attributes=attributes, + ) + + update_status_page_announcement_data.additional_properties = d + return update_status_page_announcement_data + + @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/rootly_sdk/models/update_status_page_announcement_data_attributes.py b/rootly_sdk/models/update_status_page_announcement_data_attributes.py new file mode 100644 index 00000000..3e6c7fbe --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement_data_attributes.py @@ -0,0 +1,49 @@ +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="UpdateStatusPageAnnouncementDataAttributes") + + +@_attrs_define +class UpdateStatusPageAnnouncementDataAttributes: + """ + Attributes: + title (Union[Unset, str]): Title of the announcement + body (Union[Unset, str]): Body of the announcement + """ + + title: Unset | str = UNSET + body: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + title = self.title + + body = self.body + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if body is not UNSET: + field_dict["body"] = body + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + title = d.pop("title", UNSET) + + body = d.pop("body", UNSET) + + update_status_page_announcement_data_attributes = cls( + title=title, + body=body, + ) + + return update_status_page_announcement_data_attributes diff --git a/rootly_sdk/models/update_status_page_announcement_data_type.py b/rootly_sdk/models/update_status_page_announcement_data_type.py new file mode 100644 index 00000000..503f646e --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +UpdateStatusPageAnnouncementDataType = Literal["status_page_announcements"] + +UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: set[UpdateStatusPageAnnouncementDataType] = { + "status_page_announcements", +} + + +def check_update_status_page_announcement_data_type(value: str | None) -> UpdateStatusPageAnnouncementDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: + return cast(UpdateStatusPageAnnouncementDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_page_component.py b/rootly_sdk/models/update_status_page_component.py new file mode 100644 index 00000000..a2aeabac --- /dev/null +++ b/rootly_sdk/models/update_status_page_component.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_status_page_component_data import UpdateStatusPageComponentData + + +T = TypeVar("T", bound="UpdateStatusPageComponent") + + +@_attrs_define +class UpdateStatusPageComponent: + """ + Attributes: + data (UpdateStatusPageComponentData): + """ + + data: "UpdateStatusPageComponentData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_data import UpdateStatusPageComponentData + + d = dict(src_dict) + data = UpdateStatusPageComponentData.from_dict(d.pop("data")) + + update_status_page_component = cls( + data=data, + ) + + update_status_page_component.additional_properties = d + return update_status_page_component + + @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/rootly_sdk/models/update_status_page_component_data.py b/rootly_sdk/models/update_status_page_component_data.py new file mode 100644 index 00000000..f41707fe --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_status_page_component_data_type import ( + UpdateStatusPageComponentDataType, + check_update_status_page_component_data_type, +) + +if TYPE_CHECKING: + from ..models.update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageComponentData") + + +@_attrs_define +class UpdateStatusPageComponentData: + """ + Attributes: + type_ (UpdateStatusPageComponentDataType): + attributes (UpdateStatusPageComponentDataAttributes): + """ + + type_: UpdateStatusPageComponentDataType + attributes: "UpdateStatusPageComponentDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes + + d = dict(src_dict) + type_ = check_update_status_page_component_data_type(d.pop("type")) + + attributes = UpdateStatusPageComponentDataAttributes.from_dict(d.pop("attributes")) + + update_status_page_component_data = cls( + type_=type_, + attributes=attributes, + ) + + update_status_page_component_data.additional_properties = d + return update_status_page_component_data + + @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/rootly_sdk/models/update_status_page_component_data_attributes.py b/rootly_sdk/models/update_status_page_component_data_attributes.py new file mode 100644 index 00000000..ede7577d --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_data_attributes.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateStatusPageComponentDataAttributes") + + +@_attrs_define +class UpdateStatusPageComponentDataAttributes: + """ + Attributes: + name (Union[None, Unset, str]): Name of the component (ad-hoc components only) + description (Union[None, Unset, str]): Description of the component (ad-hoc components only) + status_page_component_group_id (Union[None, Unset, str]): ID of the component group on the same status page + (null moves the component to the top level) + position (Union[Unset, int]): Position of the component (within its group, or on the page's top-level list when + ungrouped) + """ + + name: None | Unset | str = UNSET + description: None | Unset | str = UNSET + status_page_component_group_id: None | Unset | str = UNSET + position: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + name: None | Unset | str + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: None | Unset | str + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + status_page_component_group_id: None | Unset | str + if isinstance(self.status_page_component_group_id, Unset): + status_page_component_group_id = UNSET + else: + status_page_component_group_id = self.status_page_component_group_id + + position = self.position + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if status_page_component_group_id is not UNSET: + field_dict["status_page_component_group_id"] = status_page_component_group_id + if position is not UNSET: + field_dict["position"] = position + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_name(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_status_page_component_group_id(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + status_page_component_group_id = _parse_status_page_component_group_id( + d.pop("status_page_component_group_id", UNSET) + ) + + position = d.pop("position", UNSET) + + update_status_page_component_data_attributes = cls( + name=name, + description=description, + status_page_component_group_id=status_page_component_group_id, + position=position, + ) + + return update_status_page_component_data_attributes diff --git a/rootly_sdk/models/update_status_page_component_data_type.py b/rootly_sdk/models/update_status_page_component_data_type.py new file mode 100644 index 00000000..297ae8c3 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +UpdateStatusPageComponentDataType = Literal["status_page_components"] + +UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: set[UpdateStatusPageComponentDataType] = { + "status_page_components", +} + + +def check_update_status_page_component_data_type(value: str | None) -> UpdateStatusPageComponentDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: + return cast(UpdateStatusPageComponentDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_page_component_group.py b/rootly_sdk/models/update_status_page_component_group.py new file mode 100644 index 00000000..1832b9ce --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_status_page_component_group_data import UpdateStatusPageComponentGroupData + + +T = TypeVar("T", bound="UpdateStatusPageComponentGroup") + + +@_attrs_define +class UpdateStatusPageComponentGroup: + """ + Attributes: + data (UpdateStatusPageComponentGroupData): + """ + + data: "UpdateStatusPageComponentGroupData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_group_data import UpdateStatusPageComponentGroupData + + d = dict(src_dict) + data = UpdateStatusPageComponentGroupData.from_dict(d.pop("data")) + + update_status_page_component_group = cls( + data=data, + ) + + update_status_page_component_group.additional_properties = d + return update_status_page_component_group + + @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/rootly_sdk/models/update_status_page_component_group_data.py b/rootly_sdk/models/update_status_page_component_group_data.py new file mode 100644 index 00000000..3ff92539 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group_data.py @@ -0,0 +1,80 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_status_page_component_group_data_type import ( + UpdateStatusPageComponentGroupDataType, + check_update_status_page_component_group_data_type, +) + +if TYPE_CHECKING: + from ..models.update_status_page_component_group_data_attributes import UpdateStatusPageComponentGroupDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageComponentGroupData") + + +@_attrs_define +class UpdateStatusPageComponentGroupData: + """ + Attributes: + type_ (UpdateStatusPageComponentGroupDataType): + attributes (UpdateStatusPageComponentGroupDataAttributes): + """ + + type_: UpdateStatusPageComponentGroupDataType + attributes: "UpdateStatusPageComponentGroupDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_group_data_attributes import ( + UpdateStatusPageComponentGroupDataAttributes, + ) + + d = dict(src_dict) + type_ = check_update_status_page_component_group_data_type(d.pop("type")) + + attributes = UpdateStatusPageComponentGroupDataAttributes.from_dict(d.pop("attributes")) + + update_status_page_component_group_data = cls( + type_=type_, + attributes=attributes, + ) + + update_status_page_component_group_data.additional_properties = d + return update_status_page_component_group_data + + @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/rootly_sdk/models/update_status_page_component_group_data_attributes.py b/rootly_sdk/models/update_status_page_component_group_data_attributes.py new file mode 100644 index 00000000..addfcaed --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group_data_attributes.py @@ -0,0 +1,90 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateStatusPageComponentGroupDataAttributes") + + +@_attrs_define +class UpdateStatusPageComponentGroupDataAttributes: + """ + Attributes: + name (Union[Unset, str]): Name of the component group + description (Union[None, Unset, str]): Description of the component group + position (Union[Unset, int]): Position of the group on the status page's top-level list (shared with ungrouped + components) + collapsed_by_default (Union[None, Unset, bool]): Whether the group renders collapsed on the public page + """ + + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: Unset | int = UNSET + collapsed_by_default: None | Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description: None | Unset | str + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + position = self.position + + collapsed_by_default: None | Unset | bool + if isinstance(self.collapsed_by_default, Unset): + collapsed_by_default = UNSET + else: + collapsed_by_default = self.collapsed_by_default + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if position is not UNSET: + field_dict["position"] = position + if collapsed_by_default is not UNSET: + field_dict["collapsed_by_default"] = collapsed_by_default + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name", UNSET) + + def _parse_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + description = _parse_description(d.pop("description", UNSET)) + + position = d.pop("position", UNSET) + + def _parse_collapsed_by_default(data: object) -> None | Unset | bool: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | bool, data) + + collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) + + update_status_page_component_group_data_attributes = cls( + name=name, + description=description, + position=position, + collapsed_by_default=collapsed_by_default, + ) + + return update_status_page_component_group_data_attributes diff --git a/rootly_sdk/models/update_status_page_component_group_data_type.py b/rootly_sdk/models/update_status_page_component_group_data_type.py new file mode 100644 index 00000000..6ae36636 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +UpdateStatusPageComponentGroupDataType = Literal["status_page_component_groups"] + +UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: set[UpdateStatusPageComponentGroupDataType] = { + "status_page_component_groups", +} + + +def check_update_status_page_component_group_data_type( + value: str | None, +) -> UpdateStatusPageComponentGroupDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: + return cast(UpdateStatusPageComponentGroupDataType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_status_page_data.py b/rootly_sdk/models/update_status_page_data.py index ee8c76f2..a0601657 100644 --- a/rootly_sdk/models/update_status_page_data.py +++ b/rootly_sdk/models/update_status_page_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateStatusPageData: """ type_: UpdateStatusPageDataType - attributes: UpdateStatusPageDataAttributes + attributes: "UpdateStatusPageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_status_page_data_attributes.py b/rootly_sdk/models/update_status_page_data_attributes.py index ee451103..49be7823 100644 --- a/rootly_sdk/models/update_status_page_data_attributes.py +++ b/rootly_sdk/models/update_status_page_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -30,172 +28,181 @@ class UpdateStatusPageDataAttributes: """ Attributes: - title (str | Unset): The title of the status page - public_title (None | str | Unset): The public title of the status page - description (None | str | Unset): The description of the status page - public_description (None | str | Unset): The public description of the status page - header_color (None | str | Unset): The color of the header. Eg. "#0061F2" - footer_color (None | str | Unset): The color of the footer. Eg. "#1F2F41" - allow_search_engine_index (bool | None | Unset): Allow search engines to include your public status page in + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + title (Union[Unset, str]): The title of the status page + public_title (Union[None, Unset, str]): The public title of the status page + description (Union[None, Unset, str]): The description of the status page + public_description (Union[None, Unset, str]): The public description of the status page + header_color (Union[None, Unset, str]): The color of the header. Eg. "#0061F2" + footer_color (Union[None, Unset, str]): The color of the footer. Eg. "#1F2F41" + allow_search_engine_index (Union[None, Unset, bool]): Allow search engines to include your public status page in search results - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (UpdateStatusPageDataAttributesShowUptimeLastDays | Unset): Show uptime over x days - success_message (None | str | Unset): Message showing when all components are operational - failure_message (None | str | Unset): Message showing when at least one component is not operational - authentication_method (UpdateStatusPageDataAttributesAuthenticationMethod | Unset): Authentication method + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, UpdateStatusPageDataAttributesShowUptimeLastDays]): Show uptime over x days + success_message (Union[None, Unset, str]): Message showing when all components are operational + failure_message (Union[None, Unset, str]): Message showing when at least one component is not operational + authentication_method (Union[Unset, UpdateStatusPageDataAttributesAuthenticationMethod]): Authentication method Default: 'none'. - authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method + authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method instead) Default: False. - authentication_password (None | str | Unset): Authentication password - saml_idp_sso_service_url (None | str | Unset): SAML IdP SSO service URL - saml_idp_slo_service_url (None | str | Unset): SAML IdP SLO service URL - saml_idp_cert (None | str | Unset): SAML IdP certificate - saml_name_identifier_format (UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset): SAML name + authentication_password (Union[None, Unset, str]): Authentication password + saml_idp_sso_service_url (Union[None, Unset, str]): SAML IdP SSO service URL + saml_idp_slo_service_url (Union[None, Unset, str]): SAML IdP SLO service URL + saml_idp_cert (Union[None, Unset, str]): SAML IdP certificate + saml_name_identifier_format (Union[Unset, UpdateStatusPageDataAttributesSamlNameIdentifierFormat]): SAML name identifier format - section_order (list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset): Order of sections on - the status page - external_domain_names (list[str] | None | Unset): External domain names attached to the status page - website_url (None | str | Unset): Website URL - website_privacy_url (None | str | Unset): Website Privacy URL - website_support_url (None | str | Unset): Website Support URL - ga_tracking_id (None | str | Unset): Google Analytics tracking ID - time_zone (None | str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - public (bool | None | Unset): Make the status page accessible to the public - service_ids (list[str] | Unset): Services attached to the status page - functionality_ids (list[str] | Unset): Functionalities attached to the status page - enabled (bool | None | Unset): Enabled / Disable the status page + section_order (Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]]): Order of sections + on the status page + external_domain_names (Union[None, Unset, list[str]]): External domain names attached to the status page + website_url (Union[None, Unset, str]): Website URL + website_privacy_url (Union[None, Unset, str]): Website Privacy URL + website_support_url (Union[None, Unset, str]): Website Support URL + ga_tracking_id (Union[None, Unset, str]): Google Analytics tracking ID + time_zone (Union[None, Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + public (Union[None, Unset, bool]): Make the status page accessible to the public + service_ids (Union[Unset, list[str]]): Services attached to the status page + functionality_ids (Union[Unset, list[str]]): Functionalities attached to the status page + enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ - title: str | Unset = UNSET - public_title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - header_color: None | str | Unset = UNSET - footer_color: None | str | Unset = UNSET - allow_search_engine_index: bool | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: UpdateStatusPageDataAttributesShowUptimeLastDays | Unset = UNSET - success_message: None | str | Unset = UNSET - failure_message: None | str | Unset = UNSET - authentication_method: UpdateStatusPageDataAttributesAuthenticationMethod | Unset = "none" - authentication_enabled: bool | None | Unset = False - authentication_password: None | str | Unset = UNSET - saml_idp_sso_service_url: None | str | Unset = UNSET - saml_idp_slo_service_url: None | str | Unset = UNSET - saml_idp_cert: None | str | Unset = UNSET - saml_name_identifier_format: UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset = UNSET - section_order: list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset = UNSET - external_domain_names: list[str] | None | Unset = UNSET - website_url: None | str | Unset = UNSET - website_privacy_url: None | str | Unset = UNSET - website_support_url: None | str | Unset = UNSET - ga_tracking_id: None | str | Unset = UNSET - time_zone: None | str | Unset = "Etc/UTC" - public: bool | None | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - enabled: bool | None | Unset = UNSET + slug: None | Unset | str = UNSET + title: Unset | str = UNSET + public_title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + header_color: None | Unset | str = UNSET + footer_color: None | Unset | str = UNSET + allow_search_engine_index: None | Unset | bool = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | UpdateStatusPageDataAttributesShowUptimeLastDays = UNSET + success_message: None | Unset | str = UNSET + failure_message: None | Unset | str = UNSET + authentication_method: Unset | UpdateStatusPageDataAttributesAuthenticationMethod = "none" + authentication_enabled: None | Unset | bool = False + authentication_password: None | Unset | str = UNSET + saml_idp_sso_service_url: None | Unset | str = UNSET + saml_idp_slo_service_url: None | Unset | str = UNSET + saml_idp_cert: None | Unset | str = UNSET + saml_name_identifier_format: Unset | UpdateStatusPageDataAttributesSamlNameIdentifierFormat = UNSET + section_order: None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item] = UNSET + external_domain_names: None | Unset | list[str] = UNSET + website_url: None | Unset | str = UNSET + website_privacy_url: None | Unset | str = UNSET + website_support_url: None | Unset | str = UNSET + ga_tracking_id: None | Unset | str = UNSET + time_zone: None | Unset | str = "Etc/UTC" + public: None | Unset | bool = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + title = self.title - public_title: None | str | Unset + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | str | Unset + header_color: None | Unset | str if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | str | Unset + footer_color: None | Unset | str if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: bool | None | Unset + allow_search_engine_index: None | Unset | bool if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: bool | None | Unset + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | str | Unset + success_message: None | Unset | str if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | str | Unset + failure_message: None | Unset | str if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: str | Unset = UNSET + authentication_method: Unset | str = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: bool | None | Unset + authentication_enabled: None | Unset | bool if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | str | Unset + authentication_password: None | Unset | str if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | str | Unset + saml_idp_sso_service_url: None | Unset | str if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: None | str | Unset + saml_idp_slo_service_url: None | Unset | str if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: None | str | Unset + saml_idp_cert: None | Unset | str if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: str | Unset = UNSET + saml_name_identifier_format: Unset | str = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: list[str] | None | Unset + section_order: None | Unset | list[str] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -207,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: list[str] | None | Unset + external_domain_names: None | Unset | list[str] if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -216,51 +223,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: None | str | Unset + website_url: None | Unset | str if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | str | Unset + website_privacy_url: None | Unset | str if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | str | Unset + website_support_url: None | Unset | str if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | str | Unset + ga_tracking_id: None | Unset | str if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: bool | None | Unset + public: None | Unset | bool if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: bool | None | Unset + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -269,6 +276,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if title is not UNSET: field_dict["title"] = title if public_title is not UNSET: @@ -333,73 +342,83 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + title = d.pop("title", UNSET) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | str | Unset: + def _parse_header_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | str | Unset: + def _parse_footer_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: + def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: UpdateStatusPageDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Unset | UpdateStatusPageDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -407,26 +426,26 @@ def _parse_show_uptime(data: object) -> bool | None | Unset: _show_uptime_last_days ) - def _parse_success_message(data: object) -> None | str | Unset: + def _parse_success_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | str | Unset: + def _parse_failure_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: UpdateStatusPageDataAttributesAuthenticationMethod | Unset + authentication_method: Unset | UpdateStatusPageDataAttributesAuthenticationMethod if isinstance(_authentication_method, Unset): authentication_method = UNSET else: @@ -434,53 +453,53 @@ def _parse_failure_message(data: object) -> None | str | Unset: _authentication_method ) - def _parse_authentication_enabled(data: object) -> bool | None | Unset: + def _parse_authentication_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | str | Unset: + def _parse_authentication_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_slo_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> None | str | Unset: + def _parse_saml_idp_cert(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset + saml_name_identifier_format: Unset | UpdateStatusPageDataAttributesSamlNameIdentifierFormat if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -490,7 +509,7 @@ def _parse_saml_idp_cert(data: object) -> None | str | Unset: def _parse_section_order( data: object, - ) -> list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset: + ) -> None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item]: if data is None: return data if isinstance(data, Unset): @@ -508,13 +527,13 @@ def _parse_section_order( section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset, data) + return cast(None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> list[str] | None | Unset: + def _parse_external_domain_names(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -525,63 +544,63 @@ def _parse_external_domain_names(data: object) -> list[str] | None | Unset: external_domain_names_type_0 = cast(list[str], data) return external_domain_names_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> None | str | Unset: + def _parse_website_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | str | Unset: + def _parse_website_privacy_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | str | Unset: + def _parse_website_support_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | str | Unset: + def _parse_ga_tracking_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> bool | None | Unset: + def _parse_public(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) public = _parse_public(d.pop("public", UNSET)) @@ -589,16 +608,17 @@ def _parse_public(data: object) -> bool | None | Unset: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) update_status_page_data_attributes = cls( + slug=slug, title=title, public_title=public_title, description=description, diff --git a/rootly_sdk/models/update_status_page_template.py b/rootly_sdk/models/update_status_page_template.py index e02434c5..2d1d2500 100644 --- a/rootly_sdk/models/update_status_page_template.py +++ b/rootly_sdk/models/update_status_page_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateStatusPageTemplate: data (UpdateStatusPageTemplateData): """ - data: UpdateStatusPageTemplateData + data: "UpdateStatusPageTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_status_page_template_data.py b/rootly_sdk/models/update_status_page_template_data.py index ac86327b..008f3102 100644 --- a/rootly_sdk/models/update_status_page_template_data.py +++ b/rootly_sdk/models/update_status_page_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateStatusPageTemplateData: """ type_: UpdateStatusPageTemplateDataType - attributes: UpdateStatusPageTemplateDataAttributes + attributes: "UpdateStatusPageTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_status_page_template_data_attributes.py b/rootly_sdk/models/update_status_page_template_data_attributes.py index 9efc9b6b..a05b3365 100644 --- a/rootly_sdk/models/update_status_page_template_data_attributes.py +++ b/rootly_sdk/models/update_status_page_template_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,44 +22,44 @@ class UpdateStatusPageTemplateDataAttributes: Attributes: title (str): Title of the template body (str): Description of the event the template will populate - update_title (None | str | Unset): Title that will be used for the status page update - update_status (UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset): Status of the event the template - will populate - kind (UpdateStatusPageTemplateDataAttributesKind | Unset): The kind of the status page template - should_notify_subscribers (bool | None | Unset): Controls if incident subscribers should be notified - position (int | Unset): Position of the workflow task - enabled (bool | None | Unset): Enable / Disable the status page template + update_title (Union[None, Unset, str]): Title that will be used for the status page update + update_status (Union[Unset, UpdateStatusPageTemplateDataAttributesUpdateStatus]): Status of the event the + template will populate + kind (Union[Unset, UpdateStatusPageTemplateDataAttributesKind]): The kind of the status page template + should_notify_subscribers (Union[None, Unset, bool]): Controls if incident subscribers should be notified + position (Union[Unset, int]): Position of the workflow task + enabled (Union[None, Unset, bool]): Enable / Disable the status page template """ title: str body: str - update_title: None | str | Unset = UNSET - update_status: UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset = UNSET - kind: UpdateStatusPageTemplateDataAttributesKind | Unset = UNSET - should_notify_subscribers: bool | None | Unset = UNSET - position: int | Unset = UNSET - enabled: bool | None | Unset = UNSET + update_title: None | Unset | str = UNSET + update_status: Unset | UpdateStatusPageTemplateDataAttributesUpdateStatus = UNSET + kind: Unset | UpdateStatusPageTemplateDataAttributesKind = UNSET + should_notify_subscribers: None | Unset | bool = UNSET + position: Unset | int = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title body = self.body - update_title: None | str | Unset + update_title: None | Unset | str if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: str | Unset = UNSET + update_status: Unset | str = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: bool | None | Unset + should_notify_subscribers: None | Unset | bool if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -69,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: bool | None | Unset + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -105,46 +103,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") - def _parse_update_title(data: object) -> None | str | Unset: + def _parse_update_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset + update_status: Unset | UpdateStatusPageTemplateDataAttributesUpdateStatus if isinstance(_update_status, Unset): update_status = UNSET else: update_status = check_update_status_page_template_data_attributes_update_status(_update_status) _kind = d.pop("kind", UNSET) - kind: UpdateStatusPageTemplateDataAttributesKind | Unset + kind: Unset | UpdateStatusPageTemplateDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/update_status_task_params.py b/rootly_sdk/models/update_status_task_params.py index d623cf43..24deaf51 100644 --- a/rootly_sdk/models/update_status_task_params.py +++ b/rootly_sdk/models/update_status_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -24,19 +22,19 @@ class UpdateStatusTaskParams: """ Attributes: status (UpdateStatusTaskParamsStatus): - task_type (UpdateStatusTaskParamsTaskType | Unset): - inactivity_timeout (str | Unset): In format '1 hour', '1 day', etc Example: 1 hour. + task_type (Union[Unset, UpdateStatusTaskParamsTaskType]): + inactivity_timeout (Union[Unset, str]): In format '1 hour', '1 day', etc Example: 1 hour. """ status: UpdateStatusTaskParamsStatus - task_type: UpdateStatusTaskParamsTaskType | Unset = UNSET - inactivity_timeout: str | Unset = UNSET + task_type: Unset | UpdateStatusTaskParamsTaskType = UNSET + inactivity_timeout: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_status_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateStatusTaskParamsTaskType | Unset + task_type: Unset | UpdateStatusTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_sub_status.py b/rootly_sdk/models/update_sub_status.py index e5aa52fa..6fda819a 100644 --- a/rootly_sdk/models/update_sub_status.py +++ b/rootly_sdk/models/update_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSubStatus: data (UpdateSubStatusData): """ - data: UpdateSubStatusData + data: "UpdateSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_sub_status_data.py b/rootly_sdk/models/update_sub_status_data.py index 8216557b..9ff74dae 100644 --- a/rootly_sdk/models/update_sub_status_data.py +++ b/rootly_sdk/models/update_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSubStatusData: """ type_: UpdateSubStatusDataType - attributes: UpdateSubStatusDataAttributes + attributes: "UpdateSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_sub_status_data_attributes.py b/rootly_sdk/models/update_sub_status_data_attributes.py index 06db078d..ff3812d8 100644 --- a/rootly_sdk/models/update_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_sub_status_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,25 +12,34 @@ class UpdateSubStatusDataAttributes: """ Attributes: - name (str | Unset): - description (None | str | Unset): - position (int | None | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + description (Union[None, Unset, str]): + position (Union[None, Unset, int]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -41,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -53,27 +62,38 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) update_sub_status_data_attributes = cls( + slug=slug, name=name, description=description, position=position, diff --git a/rootly_sdk/models/update_team.py b/rootly_sdk/models/update_team.py index 77cd58e9..54e99506 100644 --- a/rootly_sdk/models/update_team.py +++ b/rootly_sdk/models/update_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateTeam: data (UpdateTeamData): """ - data: UpdateTeamData + data: "UpdateTeamData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_team_data.py b/rootly_sdk/models/update_team_data.py index 52c08654..faa345fa 100644 --- a/rootly_sdk/models/update_team_data.py +++ b/rootly_sdk/models/update_team_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateTeamData: """ type_: UpdateTeamDataType - attributes: UpdateTeamDataAttributes + attributes: "UpdateTeamDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_team_data_attributes.py b/rootly_sdk/models/update_team_data_attributes.py index 46c7c643..b3563194 100644 --- a/rootly_sdk/models/update_team_data_attributes.py +++ b/rootly_sdk/models/update_team_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -34,70 +32,77 @@ class UpdateTeamDataAttributes: """ Attributes: - name (str | Unset): The name of the team - description (None | str | Unset): The description of the team - notify_emails (list[str] | None | Unset): Emails to attach to the team - color (None | str | Unset): The hex color of the team - position (int | None | Unset): Position of the team - backstage_id (None | str | Unset): The Backstage entity id associated to this team. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the team + description (Union[None, Unset, str]): The description of the team + public_description (Union[None, Unset, str]): The status page description of the team + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the team + color (Union[None, Unset, str]): The hex color of the team + position (Union[None, Unset, int]): Position of the team + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this team. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this team - pagerduty_id (None | str | Unset): The PagerDuty group id associated to this team - pagerduty_service_id (None | str | Unset): The PagerDuty service id associated to this team - opsgenie_id (None | str | Unset): The Opsgenie group id associated to this team - victor_ops_id (None | str | Unset): The VictorOps group id associated to this team - pagertree_id (None | str | Unset): The PagerTree group id associated to this team - cortex_id (None | str | Unset): The Cortex group id associated to this team - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this team - user_ids (list[int] | None | Unset): The user ids of the members of this team. - admin_ids (list[int] | None | Unset): The user ids of the admins of this team. These users must also be present - in user_ids attribute. - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the team - slack_channels (list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated - with this team - slack_aliases (list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this team - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0): Slack channel - to broadcast incidents to - auto_add_members_when_attached (bool | None | Unset): Auto add members to incident channel when team is attached - auto_add_members_scope (UpdateTeamDataAttributesAutoAddMembersScope | Unset): Visibility-scoped auto-add + external_id (Union[None, Unset, str]): The external id associated to this team + pagerduty_id (Union[None, Unset, str]): The PagerDuty group id associated to this team + pagerduty_service_id (Union[None, Unset, str]): The PagerDuty service id associated to this team + opsgenie_id (Union[None, Unset, str]): The Opsgenie group id associated to this team + victor_ops_id (Union[None, Unset, str]): The VictorOps group id associated to this team + pagertree_id (Union[None, Unset, str]): The PagerTree group id associated to this team + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this team + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this team + user_ids (Union[None, Unset, list[int]]): The user ids of the members of this team. + admin_ids (Union[None, Unset, list[int]]): The user ids of the admins of this team. These users must also be + present in user_ids attribute. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the team + slack_channels (Union[None, Unset, list['UpdateTeamDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this team + slack_aliases (Union[None, Unset, list['UpdateTeamDataAttributesSlackAliasesType0Item']]): Slack Aliases + associated with this team + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['UpdateTeamDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack + channel to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['UpdateTeamDataAttributesIncidentBroadcastChannelType0', None, Unset]): Slack + channel to broadcast incidents to + auto_add_members_when_attached (Union[None, Unset, bool]): Auto add members to incident channel when team is + attached + auto_add_members_scope (Union[Unset, UpdateTeamDataAttributesAutoAddMembersScope]): Visibility-scoped auto-add behavior. Only present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When set, it overrides `auto_add_members_when_attached`. - properties (list[UpdateTeamDataAttributesPropertiesItem] | Unset): Array of property values for this team. + properties (Union[Unset, list['UpdateTeamDataAttributesPropertiesItem']]): Array of property values for this + team. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - user_ids: list[int] | None | Unset = UNSET - admin_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - slack_channels: list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0 = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0 = UNSET - auto_add_members_when_attached: bool | None | Unset = UNSET - auto_add_members_scope: UpdateTeamDataAttributesAutoAddMembersScope | Unset = UNSET - properties: list[UpdateTeamDataAttributesPropertiesItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + user_ids: None | Unset | list[int] = UNSET + admin_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET + alert_broadcast_channel: Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET + incident_broadcast_channel: Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + auto_add_members_when_attached: None | Unset | bool = UNSET + auto_add_members_scope: Unset | UpdateTeamDataAttributesAutoAddMembersScope = UNSET + properties: Unset | list["UpdateTeamDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -107,15 +112,27 @@ def to_dict(self) -> dict[str, Any]: UpdateTeamDataAttributesIncidentBroadcastChannelType0, ) + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: None | Unset | str + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -124,73 +141,73 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | str | Unset + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | str | Unset + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: list[int] | None | Unset + user_ids: None | Unset | list[int] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -199,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: list[int] | None | Unset + admin_ids: None | Unset | list[int] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -208,19 +225,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -232,7 +249,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -244,13 +261,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateTeamDataAttributesAlertBroadcastChannelType0): @@ -258,13 +275,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateTeamDataAttributesIncidentBroadcastChannelType0): @@ -272,17 +289,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: bool | None | Unset + auto_add_members_when_attached: None | Unset | bool if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: str | Unset = UNSET + auto_add_members_scope: Unset | str = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: list[dict[str, Any]] | Unset = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -292,10 +309,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -366,18 +387,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -388,112 +428,112 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> list[int] | None | Unset: + def _parse_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -504,13 +544,13 @@ def _parse_user_ids(data: object) -> list[int] | None | Unset: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> list[int] | None | Unset: + def _parse_admin_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -521,31 +561,33 @@ def _parse_admin_ids(data: object) -> list[int] | None | Unset: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(None | Unset | list[int], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -563,13 +605,15 @@ def _parse_slack_channels(data: object) -> list[UpdateTeamDataAttributesSlackCha slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -587,24 +631,24 @@ def _parse_slack_aliases(data: object) -> list[UpdateTeamDataAttributesSlackAlia slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0: + ) -> Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -615,24 +659,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = UpdateTeamDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0, data) + return cast(Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0: + ) -> Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -645,42 +689,42 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0, data) + return cast(Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: + def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: UpdateTeamDataAttributesAutoAddMembersScope | Unset + auto_add_members_scope: Unset | UpdateTeamDataAttributesAutoAddMembersScope if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_update_team_data_attributes_auto_add_members_scope(_auto_add_members_scope) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateTeamDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateTeamDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateTeamDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_team_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py index d609ce1e..bb588d8e 100644 --- a/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class UpdateTeamDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py index 66230036..88354504 100644 --- a/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -17,11 +15,11 @@ class UpdateTeamDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_team_data_attributes_properties_item.py b/rootly_sdk/models/update_team_data_attributes_properties_item.py index 4a14f3eb..d5ce8d26 100644 --- a/rootly_sdk/models/update_team_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_team_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py index 9ed2220b..ed8d4c01 100644 --- a/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py index 0d642c32..3c22919f 100644 --- a/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_trello_card_task_params.py b/rootly_sdk/models/update_trello_card_task_params.py index ebb78f45..36e4ee8b 100644 --- a/rootly_sdk/models/update_trello_card_task_params.py +++ b/rootly_sdk/models/update_trello_card_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,33 +26,32 @@ class UpdateTrelloCardTaskParams: Attributes: card_id (str): The card id archivation (UpdateTrelloCardTaskParamsArchivation): The archivation id and display name - task_type (UpdateTrelloCardTaskParamsTaskType | Unset): - title (str | Unset): The card title - description (str | Unset): The card description - due_date (str | Unset): The due date - board (UpdateTrelloCardTaskParamsBoard | Unset): The board id and display name - list_ (UpdateTrelloCardTaskParamsList | Unset): The list id and display name - labels (list[UpdateTrelloCardTaskParamsLabelsItem] | Unset): + task_type (Union[Unset, UpdateTrelloCardTaskParamsTaskType]): + title (Union[Unset, str]): The card title + description (Union[Unset, str]): The card description + due_date (Union[Unset, str]): The due date + board (Union[Unset, UpdateTrelloCardTaskParamsBoard]): The board id and display name + list_ (Union[Unset, UpdateTrelloCardTaskParamsList]): The list id and display name + labels (Union[Unset, list['UpdateTrelloCardTaskParamsLabelsItem']]): """ card_id: str - archivation: UpdateTrelloCardTaskParamsArchivation - task_type: UpdateTrelloCardTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - due_date: str | Unset = UNSET - board: UpdateTrelloCardTaskParamsBoard | Unset = UNSET - list_: UpdateTrelloCardTaskParamsList | Unset = UNSET - labels: list[UpdateTrelloCardTaskParamsLabelsItem] | Unset = UNSET + archivation: "UpdateTrelloCardTaskParamsArchivation" + task_type: Unset | UpdateTrelloCardTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + due_date: Unset | str = UNSET + board: Union[Unset, "UpdateTrelloCardTaskParamsBoard"] = UNSET + list_: Union[Unset, "UpdateTrelloCardTaskParamsList"] = UNSET + labels: Unset | list["UpdateTrelloCardTaskParamsLabelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - card_id = self.card_id archivation = self.archivation.to_dict() - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,15 +61,15 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - board: dict[str, Any] | Unset = UNSET + board: Unset | dict[str, Any] = UNSET if not isinstance(self.board, Unset): board = self.board.to_dict() - list_: dict[str, Any] | Unset = UNSET + list_: Unset | dict[str, Any] = UNSET if not isinstance(self.list_, Unset): list_ = self.list_.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -117,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: archivation = UpdateTrelloCardTaskParamsArchivation.from_dict(d.pop("archivation")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateTrelloCardTaskParamsTaskType | Unset + task_type: Unset | UpdateTrelloCardTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -130,27 +127,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _board = d.pop("board", UNSET) - board: UpdateTrelloCardTaskParamsBoard | Unset + board: Unset | UpdateTrelloCardTaskParamsBoard if isinstance(_board, Unset): board = UNSET else: board = UpdateTrelloCardTaskParamsBoard.from_dict(_board) _list_ = d.pop("list", UNSET) - list_: UpdateTrelloCardTaskParamsList | Unset + list_: Unset | UpdateTrelloCardTaskParamsList if isinstance(_list_, Unset): list_ = UNSET else: list_ = UpdateTrelloCardTaskParamsList.from_dict(_list_) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[UpdateTrelloCardTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = UpdateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = UpdateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) update_trello_card_task_params = cls( card_id=card_id, diff --git a/rootly_sdk/models/update_trello_card_task_params_archivation.py b/rootly_sdk/models/update_trello_card_task_params_archivation.py index 14b2a7be..6196d586 100644 --- a/rootly_sdk/models/update_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/update_trello_card_task_params_archivation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateTrelloCardTaskParamsArchivation: """The archivation id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_board.py b/rootly_sdk/models/update_trello_card_task_params_board.py index 586b06c8..71073b9f 100644 --- a/rootly_sdk/models/update_trello_card_task_params_board.py +++ b/rootly_sdk/models/update_trello_card_task_params_board.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateTrelloCardTaskParamsBoard: """The board id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_labels_item.py b/rootly_sdk/models/update_trello_card_task_params_labels_item.py index 061422b6..ab0604a8 100644 --- a/rootly_sdk/models/update_trello_card_task_params_labels_item.py +++ b/rootly_sdk/models/update_trello_card_task_params_labels_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,12 +13,12 @@ class UpdateTrelloCardTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_list.py b/rootly_sdk/models/update_trello_card_task_params_list.py index bd084e60..1fd02aee 100644 --- a/rootly_sdk/models/update_trello_card_task_params_list.py +++ b/rootly_sdk/models/update_trello_card_task_params_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateTrelloCardTaskParamsList: """The list id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_user.py b/rootly_sdk/models/update_user.py index bfd07c3b..afb8ad14 100644 --- a/rootly_sdk/models/update_user.py +++ b/rootly_sdk/models/update_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUser: data (UpdateUserData): """ - data: UpdateUserData + data: "UpdateUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_data.py b/rootly_sdk/models/update_user_data.py index a24938b0..019d9d74 100644 --- a/rootly_sdk/models/update_user_data.py +++ b/rootly_sdk/models/update_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateUserData: """ type_: UpdateUserDataType - attributes: UpdateUserDataAttributes + attributes: "UpdateUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_data_attributes.py b/rootly_sdk/models/update_user_data_attributes.py index 1ef584d0..acf3a634 100644 --- a/rootly_sdk/models/update_user_data_attributes.py +++ b/rootly_sdk/models/update_user_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,37 +12,37 @@ class UpdateUserDataAttributes: """ Attributes: - first_name (None | str | Unset): First name of the user - last_name (None | str | Unset): Last name of the user - role_id (None | str | Unset): ID of the role to assign - on_call_role_id (None | str | Unset): ID of the on-call role to assign + first_name (Union[None, Unset, str]): First name of the user + last_name (Union[None, Unset, str]): Last name of the user + role_id (Union[None, Unset, str]): ID of the role to assign + on_call_role_id (Union[None, Unset, str]): ID of the on-call role to assign """ - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - first_name: None | str | Unset + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - role_id: None | str | Unset + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -68,39 +66,39 @@ 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_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/update_user_email_address.py b/rootly_sdk/models/update_user_email_address.py index 68b98497..31757578 100644 --- a/rootly_sdk/models/update_user_email_address.py +++ b/rootly_sdk/models/update_user_email_address.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUserEmailAddress: data (UpdateUserEmailAddressData): """ - data: UpdateUserEmailAddressData + data: "UpdateUserEmailAddressData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_email_address_data.py b/rootly_sdk/models/update_user_email_address_data.py index d94f4368..2b87d935 100644 --- a/rootly_sdk/models/update_user_email_address_data.py +++ b/rootly_sdk/models/update_user_email_address_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateUserEmailAddressData: """ type_: UpdateUserEmailAddressDataType - attributes: UpdateUserEmailAddressDataAttributes + attributes: "UpdateUserEmailAddressDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_email_address_data_attributes.py b/rootly_sdk/models/update_user_email_address_data_attributes.py index 977a87b2..021d4325 100644 --- a/rootly_sdk/models/update_user_email_address_data_attributes.py +++ b/rootly_sdk/models/update_user_email_address_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,10 +12,10 @@ class UpdateUserEmailAddressDataAttributes: """ Attributes: - email (str | Unset): Email address + email (Union[Unset, str]): Email address """ - email: str | Unset = UNSET + email: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: email = self.email diff --git a/rootly_sdk/models/update_user_notification_rule.py b/rootly_sdk/models/update_user_notification_rule.py index 8550ba96..5e02a9df 100644 --- a/rootly_sdk/models/update_user_notification_rule.py +++ b/rootly_sdk/models/update_user_notification_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUserNotificationRule: data (UpdateUserNotificationRuleData): """ - data: UpdateUserNotificationRuleData + data: "UpdateUserNotificationRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_notification_rule_data.py b/rootly_sdk/models/update_user_notification_rule_data.py index 0c45fc09..dd48e99d 100644 --- a/rootly_sdk/models/update_user_notification_rule_data.py +++ b/rootly_sdk/models/update_user_notification_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateUserNotificationRuleData: """ type_: UpdateUserNotificationRuleDataType - attributes: UpdateUserNotificationRuleDataAttributes + attributes: "UpdateUserNotificationRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_notification_rule_data_attributes.py b/rootly_sdk/models/update_user_notification_rule_data_attributes.py index 8c2a5196..145fe36f 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/update_user_notification_rule_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,62 +16,62 @@ class UpdateUserNotificationRuleDataAttributes: """ Attributes: - delay (int | None | Unset): Delay after which rule gets triggered - position (int | None | Unset): Position of the rule - user_email_address_id (None | str | Unset): User email address to which notification to be sent - user_call_number_id (None | str | Unset): User phone number to which notification to be sent - user_sms_number_id (None | str | Unset): User sms number to which notification to be sent - user_device_id (None | str | Unset): User device to which notification to be sent - enabled_contact_types (list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] | Unset): Contact - types for which notification needs to be enabled + delay (Union[None, Unset, int]): Delay after which rule gets triggered + position (Union[None, Unset, int]): Position of the rule + user_email_address_id (Union[None, Unset, str]): User email address to which notification to be sent + user_call_number_id (Union[None, Unset, str]): User phone number to which notification to be sent + user_sms_number_id (Union[None, Unset, str]): User sms number to which notification to be sent + user_device_id (Union[None, Unset, str]): User device to which notification to be sent + enabled_contact_types (Union[Unset, list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem]]): + Contact types for which notification needs to be enabled """ - delay: int | None | Unset = UNSET - position: int | None | Unset = UNSET - user_email_address_id: None | str | Unset = UNSET - user_call_number_id: None | str | Unset = UNSET - user_sms_number_id: None | str | Unset = UNSET - user_device_id: None | str | Unset = UNSET - enabled_contact_types: list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] | Unset = UNSET + delay: None | Unset | int = UNSET + position: None | Unset | int = UNSET + user_email_address_id: None | Unset | str = UNSET + user_call_number_id: None | Unset | str = UNSET + user_sms_number_id: None | Unset | str = UNSET + user_device_id: None | Unset | str = UNSET + enabled_contact_types: Unset | list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] = UNSET def to_dict(self) -> dict[str, Any]: - delay: int | None | Unset + delay: None | Unset | int if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | str | Unset + user_email_address_id: None | Unset | str if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: None | str | Unset + user_call_number_id: None | Unset | str if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: None | str | Unset + user_sms_number_id: None | Unset | str if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: None | str | Unset + user_device_id: None | Unset | str if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: list[str] | Unset = UNSET + enabled_contact_types: Unset | list[str] = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: @@ -104,72 +102,68 @@ 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_delay(data: object) -> int | None | Unset: + def _parse_delay(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | str | Unset: + def _parse_user_email_address_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> None | str | Unset: + def _parse_user_call_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> None | str | Unset: + def _parse_user_sms_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> None | str | Unset: + def _parse_user_device_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) + enabled_contact_types = [] _enabled_contact_types = d.pop("enabled_contact_types", UNSET) - enabled_contact_types: list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] | Unset = UNSET - if _enabled_contact_types is not UNSET: - enabled_contact_types = [] - for enabled_contact_types_item_data in _enabled_contact_types: - enabled_contact_types_item = ( - check_update_user_notification_rule_data_attributes_enabled_contact_types_item( - enabled_contact_types_item_data - ) - ) + for enabled_contact_types_item_data in _enabled_contact_types or []: + enabled_contact_types_item = check_update_user_notification_rule_data_attributes_enabled_contact_types_item( + enabled_contact_types_item_data + ) - enabled_contact_types.append(enabled_contact_types_item) + enabled_contact_types.append(enabled_contact_types_item) update_user_notification_rule_data_attributes = cls( delay=delay, diff --git a/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py b/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py index 481a0d9a..149df040 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py +++ b/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py @@ -1,7 +1,7 @@ from typing import Literal, cast UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem = Literal[ - "call", "device", "email", "google_chat", "non_critical_device", "slack", "sms" + "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" ] UPDATE_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES: set[ @@ -11,6 +11,7 @@ "device", "email", "google_chat", + "microsoft_teams", "non_critical_device", "slack", "sms", diff --git a/rootly_sdk/models/update_user_phone_number.py b/rootly_sdk/models/update_user_phone_number.py index b6e60d61..14c053e0 100644 --- a/rootly_sdk/models/update_user_phone_number.py +++ b/rootly_sdk/models/update_user_phone_number.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUserPhoneNumber: data (UpdateUserPhoneNumberData): """ - data: UpdateUserPhoneNumberData + data: "UpdateUserPhoneNumberData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_phone_number_data.py b/rootly_sdk/models/update_user_phone_number_data.py index 10339845..196d946f 100644 --- a/rootly_sdk/models/update_user_phone_number_data.py +++ b/rootly_sdk/models/update_user_phone_number_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateUserPhoneNumberData: """ type_: UpdateUserPhoneNumberDataType - attributes: UpdateUserPhoneNumberDataAttributes + attributes: "UpdateUserPhoneNumberDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_phone_number_data_attributes.py b/rootly_sdk/models/update_user_phone_number_data_attributes.py index 28772c0b..bb449a53 100644 --- a/rootly_sdk/models/update_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/update_user_phone_number_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -14,10 +12,10 @@ class UpdateUserPhoneNumberDataAttributes: """ Attributes: - phone (str | Unset): Phone number in international format + phone (Union[Unset, str]): Phone number in international format """ - phone: str | Unset = UNSET + phone: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: phone = self.phone diff --git a/rootly_sdk/models/update_victor_ops_incident_task_params.py b/rootly_sdk/models/update_victor_ops_incident_task_params.py index 861fb6d5..990a3a5b 100644 --- a/rootly_sdk/models/update_victor_ops_incident_task_params.py +++ b/rootly_sdk/models/update_victor_ops_incident_task_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -26,14 +24,14 @@ class UpdateVictorOpsIncidentTaskParams: victor_ops_incident_id (str): The victor_ops incident ID, this can also be a Rootly incident variable ex. {{ incident.victor_ops_incident_id }} status (UpdateVictorOpsIncidentTaskParamsStatus): - task_type (UpdateVictorOpsIncidentTaskParamsTaskType | Unset): - resolution_message (str | Unset): Resolution message + task_type (Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType]): + resolution_message (Union[Unset, str]): Resolution message """ victor_ops_incident_id: str status: UpdateVictorOpsIncidentTaskParamsStatus - task_type: UpdateVictorOpsIncidentTaskParamsTaskType | Unset = UNSET - resolution_message: str | Unset = UNSET + task_type: Unset | UpdateVictorOpsIncidentTaskParamsTaskType = UNSET + resolution_message: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_victor_ops_incident_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateVictorOpsIncidentTaskParamsTaskType | Unset + task_type: Unset | UpdateVictorOpsIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_webhooks_endpoint.py b/rootly_sdk/models/update_webhooks_endpoint.py index a6e4f061..8825d130 100644 --- a/rootly_sdk/models/update_webhooks_endpoint.py +++ b/rootly_sdk/models/update_webhooks_endpoint.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWebhooksEndpoint: data (UpdateWebhooksEndpointData): """ - data: UpdateWebhooksEndpointData + data: "UpdateWebhooksEndpointData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_webhooks_endpoint_data.py b/rootly_sdk/models/update_webhooks_endpoint_data.py index c206aef7..3d7f75a2 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateWebhooksEndpointData: """ type_: UpdateWebhooksEndpointDataType - attributes: UpdateWebhooksEndpointDataAttributes + attributes: "UpdateWebhooksEndpointDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py index b69e2934..99f06e24 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,23 +22,32 @@ class UpdateWebhooksEndpointDataAttributes: """ Attributes: - name (str | Unset): The name of the endpoint - event_types (list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset): - enabled (bool | Unset): - custom_headers (list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset): Custom HTTP headers sent - with each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the endpoint + event_types (Union[Unset, list[UpdateWebhooksEndpointDataAttributesEventTypesItem]]): + enabled (Union[Unset, bool]): + custom_headers (Union[Unset, list['UpdateWebhooksEndpointDataAttributesCustomHeadersItem']]): Custom HTTP + headers sent with each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are + rejected. """ - name: str | Unset = UNSET - event_types: list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - enabled: bool | Unset = UNSET - custom_headers: list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + event_types: Unset | list[UpdateWebhooksEndpointDataAttributesEventTypesItem] = UNSET + enabled: Unset | bool = UNSET + custom_headers: Unset | list["UpdateWebhooksEndpointDataAttributesCustomHeadersItem"] = UNSET def to_dict(self) -> dict[str, Any]: + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - event_types: list[str] | Unset = UNSET + event_types: Unset | list[str] = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -49,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: list[dict[str, Any]] | Unset = UNSET + custom_headers: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -59,6 +66,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if event_types is not UNSET: @@ -77,33 +86,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) + event_types = [] _event_types = d.pop("event_types", UNSET) - event_types: list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - if _event_types is not UNSET: - event_types = [] - for event_types_item_data in _event_types: - event_types_item = check_update_webhooks_endpoint_data_attributes_event_types_item( - event_types_item_data - ) + for event_types_item_data in _event_types or []: + event_types_item = check_update_webhooks_endpoint_data_attributes_event_types_item(event_types_item_data) - event_types.append(event_types_item) + event_types.append(event_types_item) enabled = d.pop("enabled", UNSET) + custom_headers = [] _custom_headers = d.pop("custom_headers", UNSET) - custom_headers: list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET - if _custom_headers is not UNSET: - custom_headers = [] - for custom_headers_item_data in _custom_headers: - custom_headers_item = UpdateWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( - custom_headers_item_data - ) + for custom_headers_item_data in _custom_headers or []: + custom_headers_item = UpdateWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( + custom_headers_item_data + ) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) update_webhooks_endpoint_data_attributes = cls( + slug=slug, name=name, event_types=event_types, enabled=enabled, diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py index e08d3e1f..5927d14e 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py index 9cdc03f1..67f69ba4 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py @@ -2,6 +2,7 @@ UpdateWebhooksEndpointDataAttributesEventTypesItem = Literal[ "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", @@ -38,6 +39,7 @@ UpdateWebhooksEndpointDataAttributesEventTypesItem ] = { "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", diff --git a/rootly_sdk/models/update_workflow.py b/rootly_sdk/models/update_workflow.py index 5364c155..66d9c7cd 100644 --- a/rootly_sdk/models/update_workflow.py +++ b/rootly_sdk/models/update_workflow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflow: data (UpdateWorkflowData): """ - data: UpdateWorkflowData + data: "UpdateWorkflowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition.py index 1433a89b..cdfdb15b 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class UpdateWorkflowActionItemFormFieldCondition: data (UpdateWorkflowActionItemFormFieldConditionData): """ - data: UpdateWorkflowActionItemFormFieldConditionData + data: "UpdateWorkflowActionItemFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py index 72950187..f6692ebc 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateWorkflowActionItemFormFieldConditionData: """ type_: UpdateWorkflowActionItemFormFieldConditionDataType - attributes: UpdateWorkflowActionItemFormFieldConditionDataAttributes + attributes: "UpdateWorkflowActionItemFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py index c44ebd68..a13ba23d 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,74 +16,75 @@ class UpdateWorkflowActionItemFormFieldConditionDataAttributes: """ Attributes: - action_item_condition (UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset): The - trigger condition Default: 'ANY'. - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + action_item_condition (Union[Unset, + UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition]): The trigger condition Default: + 'ANY'. + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ - action_item_condition: UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset = "ANY" - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + action_item_condition: Unset | UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = "ANY" + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - action_item_condition: str | Unset = UNSET + action_item_condition: Unset | str = UNSET if not isinstance(self.action_item_condition, Unset): action_item_condition = self.action_item_condition - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -121,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action_item_condition = d.pop("action_item_condition", UNSET) - action_item_condition: UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset + action_item_condition: Unset | UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition if isinstance(_action_item_condition, Unset): action_item_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_custom_field_selection.py b/rootly_sdk/models/update_workflow_custom_field_selection.py index 638a1ec9..931ab1c2 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowCustomFieldSelection: data (UpdateWorkflowCustomFieldSelectionData): """ - data: UpdateWorkflowCustomFieldSelectionData + data: "UpdateWorkflowCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data.py b/rootly_sdk/models/update_workflow_custom_field_selection_data.py index e1ba2a31..dc4ebd9c 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateWorkflowCustomFieldSelectionData: """ type_: UpdateWorkflowCustomFieldSelectionDataType - attributes: UpdateWorkflowCustomFieldSelectionDataAttributes + attributes: "UpdateWorkflowCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py index 6aa9476a..f895b861 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,26 +16,26 @@ class UpdateWorkflowCustomFieldSelectionDataAttributes: """ Attributes: - incident_condition (UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset): The trigger - condition Default: 'ANY'. - values (list[str] | Unset): - selected_option_ids (list[int] | Unset): + incident_condition (Union[Unset, UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition]): The + trigger condition Default: 'ANY'. + values (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[int]]): """ - incident_condition: UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset = "ANY" - values: list[str] | Unset = UNSET - selected_option_ids: list[int] | Unset = UNSET + incident_condition: Unset | UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" + values: Unset | list[str] = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: str | Unset = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -57,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset + incident_condition: Unset | UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_data.py b/rootly_sdk/models/update_workflow_data.py index 2da420ed..0e2ef268 100644 --- a/rootly_sdk/models/update_workflow_data.py +++ b/rootly_sdk/models/update_workflow_data.py @@ -1,12 +1,10 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_workflow_data_type import UpdateWorkflowDataType, check_update_workflow_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_data_attributes import UpdateWorkflowDataAttributes @@ -21,26 +19,31 @@ class UpdateWorkflowData: Attributes: type_ (UpdateWorkflowDataType): attributes (UpdateWorkflowDataAttributes): + id (Union[Unset, str]): Accepted for JSON:API client compatibility, but ignored. The workflow to update is + identified by the id in the path. """ type_: UpdateWorkflowDataType - attributes: UpdateWorkflowDataAttributes - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: "UpdateWorkflowDataAttributes" + id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() + id = self.id + field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, "attributes": attributes, } ) + if id is not UNSET: + field_dict["id"] = id return field_dict @@ -53,26 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_data.additional_properties = d return update_workflow_data - - @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/rootly_sdk/models/update_workflow_data_attributes.py b/rootly_sdk/models/update_workflow_data_attributes.py index be178cbf..0a0ddd2f 100644 --- a/rootly_sdk/models/update_workflow_data_attributes.py +++ b/rootly_sdk/models/update_workflow_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,66 +20,69 @@ class UpdateWorkflowDataAttributes: """ Attributes: - name (str | Unset): The title of the workflow - description (None | str | Unset): The description of the workflow - command (None | str | Unset): Workflow command - command_feedback_enabled (bool | None | Unset): This will notify you back when the workflow is starting - wait (None | str | Unset): Wait this duration before executing - repeat_every_duration (None | str | Unset): Repeat workflow every duration - repeat_condition_duration_since_first_run (None | str | Unset): The workflow will stop repeating if its runtime - since it's first workflow run exceeds the duration set in this field - repeat_condition_number_of_repeats (int | Unset): The workflow will stop repeating if the number of repeats - exceeds the value set in this field - continuously_repeat (bool | Unset): When continuously repeat is true, repeat workflows aren't automatically - stopped when conditions aren't met. This setting won't override your conditions set by + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The title of the workflow + description (Union[None, Unset, str]): The description of the workflow + command (Union[None, Unset, str]): Workflow command + command_feedback_enabled (Union[None, Unset, bool]): This will notify you back when the workflow is starting + wait (Union[None, Unset, str]): Wait this duration before executing + repeat_every_duration (Union[None, Unset, str]): Repeat workflow every duration + repeat_condition_duration_since_first_run (Union[None, Unset, str]): The workflow will stop repeating if its + runtime since it's first workflow run exceeds the duration set in this field + repeat_condition_number_of_repeats (Union[Unset, int]): The workflow will stop repeating if the number of + repeats exceeds the value set in this field + continuously_repeat (Union[Unset, bool]): When continuously repeat is true, repeat workflows aren't + automatically stopped when conditions aren't met. This setting won't override your conditions set by repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - enabled (bool | Unset): - locked (bool | Unset): Restricts workflow edits to admins when turned on. Only admins can set this field. - position (int | Unset): The order which the workflow should run with other workflows. - workflow_group_id (None | str | Unset): The group this workflow belongs to. - trigger_params (ActionItemTriggerParams | AlertTriggerParams | IncidentTriggerParams | PulseTriggerParams | - SimpleTriggerParams | Unset): - environment_ids (list[str] | Unset): - severity_ids (list[str] | Unset): - incident_type_ids (list[str] | Unset): - incident_role_ids (list[str] | Unset): - service_ids (list[str] | Unset): - functionality_ids (list[str] | Unset): - group_ids (list[str] | Unset): - cause_ids (list[str] | Unset): - sub_status_ids (list[str] | Unset): + enabled (Union[Unset, bool]): + locked (Union[Unset, bool]): Restricts workflow edits to admins when turned on. Only admins can set this field. + position (Union[Unset, int]): The order which the workflow should run with other workflows. + workflow_group_id (Union[None, Unset, str]): The group this workflow belongs to. + trigger_params (Union['ActionItemTriggerParams', 'AlertTriggerParams', 'IncidentTriggerParams', + 'PulseTriggerParams', 'SimpleTriggerParams', Unset]): + environment_ids (Union[Unset, list[str]]): + severity_ids (Union[Unset, list[str]]): + incident_type_ids (Union[Unset, list[str]]): + incident_role_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): + functionality_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): + cause_ids (Union[Unset, list[str]]): + sub_status_ids (Union[Unset, list[str]]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - command: None | str | Unset = UNSET - command_feedback_enabled: bool | None | Unset = UNSET - wait: None | str | Unset = UNSET - repeat_every_duration: None | str | Unset = UNSET - repeat_condition_duration_since_first_run: None | str | Unset = UNSET - repeat_condition_number_of_repeats: int | Unset = UNSET - continuously_repeat: bool | Unset = UNSET - enabled: bool | Unset = UNSET - locked: bool | Unset = UNSET - position: int | Unset = UNSET - workflow_group_id: None | str | Unset = UNSET - trigger_params: ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ) = UNSET - environment_ids: list[str] | Unset = UNSET - severity_ids: list[str] | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - incident_role_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - cause_ids: list[str] | Unset = UNSET - sub_status_ids: list[str] | Unset = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + command: None | Unset | str = UNSET + command_feedback_enabled: None | Unset | bool = UNSET + wait: None | Unset | str = UNSET + repeat_every_duration: None | Unset | str = UNSET + repeat_condition_duration_since_first_run: None | Unset | str = UNSET + repeat_condition_number_of_repeats: Unset | int = UNSET + continuously_repeat: Unset | bool = UNSET + enabled: Unset | bool = UNSET + locked: Unset | bool = UNSET + position: Unset | int = UNSET + workflow_group_id: None | Unset | str = UNSET + trigger_params: Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ] = UNSET + environment_ids: Unset | list[str] = UNSET + severity_ids: Unset | list[str] = UNSET + incident_type_ids: Unset | list[str] = UNSET + incident_role_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + cause_ids: Unset | list[str] = UNSET + sub_status_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -89,39 +90,45 @@ def to_dict(self) -> dict[str, Any]: from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | str | Unset + command: None | Unset | str if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: bool | None | Unset + command_feedback_enabled: None | Unset | bool if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | str | Unset + wait: None | Unset | str if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: None | str | Unset + repeat_every_duration: None | Unset | str if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: None | str | Unset + repeat_condition_duration_since_first_run: None | Unset | str if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -137,13 +144,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | str | Unset + workflow_group_id: None | Unset | str if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: dict[str, Any] | Unset + trigger_params: Unset | dict[str, Any] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -157,45 +164,47 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: list[str] | Unset = UNSET + severity_ids: Unset | list[str] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: list[str] | Unset = UNSET + incident_role_ids: Unset | list[str] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: list[str] | Unset = UNSET + cause_ids: Unset | list[str] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: list[str] | Unset = UNSET + sub_status_ids: Unset | list[str] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -254,59 +263,69 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.simple_trigger_params import SimpleTriggerParams d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | str | Unset: + def _parse_command(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: + def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | str | Unset: + def _parse_wait(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> None | str | Unset: + def _parse_repeat_every_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -322,25 +341,25 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | str | Unset: + def _parse_workflow_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ): + ) -> Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -349,7 +368,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -357,7 +376,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -365,7 +384,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -373,7 +392,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -402,6 +421,7 @@ def _parse_trigger_params( sub_status_ids = cast(list[str], d.pop("sub_status_ids", UNSET)) update_workflow_data_attributes = cls( + slug=slug, name=name, description=description, command=command, diff --git a/rootly_sdk/models/update_workflow_form_field_condition.py b/rootly_sdk/models/update_workflow_form_field_condition.py index 93eb741d..5dcc8f4a 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition.py +++ b/rootly_sdk/models/update_workflow_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowFormFieldCondition: data (UpdateWorkflowFormFieldConditionData): """ - data: UpdateWorkflowFormFieldConditionData + data: "UpdateWorkflowFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data.py b/rootly_sdk/models/update_workflow_form_field_condition_data.py index e83fbb57..de2ac575 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateWorkflowFormFieldConditionData: """ type_: UpdateWorkflowFormFieldConditionDataType - attributes: UpdateWorkflowFormFieldConditionDataAttributes + attributes: "UpdateWorkflowFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py index 212d2286..01865d0b 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,74 +16,74 @@ class UpdateWorkflowFormFieldConditionDataAttributes: """ Attributes: - incident_condition (UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset): The trigger + incident_condition (Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition]): The trigger condition Default: 'ANY'. - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ - incident_condition: UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset = "ANY" - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + incident_condition: Unset | UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition = "ANY" + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: str | Unset = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -121,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset + incident_condition: Unset | UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_group.py b/rootly_sdk/models/update_workflow_group.py index 0f3e5d4f..14a490be 100644 --- a/rootly_sdk/models/update_workflow_group.py +++ b/rootly_sdk/models/update_workflow_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowGroup: data (UpdateWorkflowGroupData): """ - data: UpdateWorkflowGroupData + data: "UpdateWorkflowGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_group_data.py b/rootly_sdk/models/update_workflow_group_data.py index e5eda1a8..dca07ffb 100644 --- a/rootly_sdk/models/update_workflow_group_data.py +++ b/rootly_sdk/models/update_workflow_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateWorkflowGroupData: """ type_: UpdateWorkflowGroupDataType - attributes: UpdateWorkflowGroupDataAttributes + attributes: "UpdateWorkflowGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_group_data_attributes.py b/rootly_sdk/models/update_workflow_group_data_attributes.py index b61fd078..4050895d 100644 --- a/rootly_sdk/models/update_workflow_group_data_attributes.py +++ b/rootly_sdk/models/update_workflow_group_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,30 +17,39 @@ class UpdateWorkflowGroupDataAttributes: """ Attributes: - kind (UpdateWorkflowGroupDataAttributesKind | Unset): The kind of the workflow group - name (str | Unset): The name of the workflow group. - description (None | str | Unset): A description of the workflow group. - icon (str | Unset): An emoji icon displayed next to the workflow group. - expanded (bool | Unset): Whether the group is expanded or collapsed. - position (int | Unset): The position of the workflow group + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name` and `kind`; any submitted value is + ignored. This property will be removed from the request schema in a future version. + kind (Union[Unset, UpdateWorkflowGroupDataAttributesKind]): The kind of the workflow group + name (Union[Unset, str]): The name of the workflow group. + description (Union[None, Unset, str]): A description of the workflow group. + icon (Union[Unset, str]): An emoji icon displayed next to the workflow group. + expanded (Union[Unset, bool]): Whether the group is expanded or collapsed. + position (Union[Unset, int]): The position of the workflow group """ - kind: UpdateWorkflowGroupDataAttributesKind | Unset = UNSET - name: str | Unset = UNSET - description: None | str | Unset = UNSET - icon: str | Unset = UNSET - expanded: bool | Unset = UNSET - position: int | Unset = UNSET + slug: None | Unset | str = UNSET + kind: Unset | UpdateWorkflowGroupDataAttributesKind = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | str = UNSET + expanded: Unset | bool = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str | Unset = UNSET + slug: None | Unset | str + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind name = self.name - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -57,6 +64,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if kind is not UNSET: field_dict["kind"] = kind if name is not UNSET: @@ -75,8 +84,18 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _kind = d.pop("kind", UNSET) - kind: UpdateWorkflowGroupDataAttributesKind | Unset + kind: Unset | UpdateWorkflowGroupDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -84,12 +103,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -100,6 +119,7 @@ def _parse_description(data: object) -> None | str | Unset: position = d.pop("position", UNSET) update_workflow_group_data_attributes = cls( + slug=slug, kind=kind, name=name, description=description, diff --git a/rootly_sdk/models/update_workflow_task.py b/rootly_sdk/models/update_workflow_task.py index 93fe2216..e1af76eb 100644 --- a/rootly_sdk/models/update_workflow_task.py +++ b/rootly_sdk/models/update_workflow_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowTask: data (UpdateWorkflowTaskData): """ - data: UpdateWorkflowTaskData + data: "UpdateWorkflowTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_task_data.py b/rootly_sdk/models/update_workflow_task_data.py index d2f7760b..e84af22e 100644 --- a/rootly_sdk/models/update_workflow_task_data.py +++ b/rootly_sdk/models/update_workflow_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateWorkflowTaskData: """ type_: UpdateWorkflowTaskDataType - attributes: UpdateWorkflowTaskDataAttributes + attributes: "UpdateWorkflowTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_task_data_attributes.py b/rootly_sdk/models/update_workflow_task_data_attributes.py index c7a0cbe9..0dc74eb8 100644 --- a/rootly_sdk/models/update_workflow_task_data_attributes.py +++ b/rootly_sdk/models/update_workflow_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -21,11 +19,18 @@ from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -188,237 +193,248 @@ class UpdateWorkflowTaskDataAttributes: """ Attributes: - name (str | Unset): Name of the workflow task - position (int | Unset): The position of the workflow task - skip_on_failure (bool | Unset): Skip workflow task if any failures - enabled (bool | Unset): Enable/disable workflow task Default: True. - task_params (AddActionItemTaskParams | AddMicrosoftTeamsChatTabTaskParams | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 | AddRoleTaskParams | AddSlackBookmarkTaskParamsType0 | - AddSlackBookmarkTaskParamsType1 | AddTeamTaskParams | AddToTimelineTaskParams | - ArchiveGoogleChatSpacesTaskParams | ArchiveMicrosoftTeamsChannelsTaskParams | ArchiveSlackChannelsTaskParams | - AttachDatadogDashboardsTaskParams | AttachRetrospectivePdfToJiraIssueTaskParams | - AutoAssignRoleOpsgenieTaskParams | AutoAssignRolePagerdutyTaskParamsType0 | - AutoAssignRolePagerdutyTaskParamsType1 | AutoAssignRoleRootlyTaskParams | AutoAssignRoleVictorOpsTaskParams | - CallPeopleTaskParams | ChangeGoogleChatSpacePrivacyTaskParams | ChangeSlackChannelPrivacyTaskParams | - CreateAirtableTableRecordTaskParams | CreateAnthropicChatCompletionTaskParams | CreateAsanaSubtaskTaskParams | - CreateAsanaTaskTaskParams | CreateClickupTaskTaskParams | CreateCodaPageTaskParams | - CreateConfluencePageTaskParams | CreateDatadogNotebookTaskParams | CreateDropboxPaperPageTaskParams | - CreateGithubIssueTaskParams | CreateGitlabIssueTaskParams | CreateGoogleCalendarEventTaskParams | - CreateGoogleChatSpaceTaskParams | CreateGoogleDocsPageTaskParams | CreateGoogleDocsPermissionsTaskParams | - CreateGoogleGeminiChatCompletionTaskParams | CreateGoogleMeetingTaskParams | CreateGoToMeetingTaskParams | - CreateIncidentPostmortemTaskParams | CreateIncidentTaskParams | CreateJiraIssueTaskParams | - CreateJiraSubtaskTaskParams | CreateJsmopsAlertTaskParams | CreateLinearIssueCommentTaskParams | - CreateLinearIssueTaskParams | CreateLinearSubtaskIssueTaskParams | CreateMicrosoftTeamsChannelTaskParams | - CreateMicrosoftTeamsChatTaskParams | CreateMicrosoftTeamsMeetingTaskParams | - CreateMistralChatCompletionTaskParams | CreateMotionTaskTaskParams | CreateNotionPageTaskParams | - CreateOpenaiChatCompletionTaskParams | CreateOpsgenieAlertTaskParams | CreateOutlookEventTaskParams | - CreatePagerdutyStatusUpdateTaskParams | CreatePagertreeAlertTaskParams | CreateQuipPageTaskParams | - CreateServiceNowIncidentTaskParams | CreateSharepointPageTaskParams | CreateShortcutStoryTaskParamsType0 | - CreateShortcutStoryTaskParamsType1 | CreateShortcutTaskTaskParams | CreateSlackChannelTaskParams | - CreateSubIncidentTaskParams | CreateTrelloCardTaskParams | CreateWatsonxChatCompletionTaskParams | - CreateWebexMeetingTaskParams | CreateZendeskJiraLinkTaskParams | CreateZendeskTicketTaskParams | - CreateZoomMeetingTaskParams | GetAlertsTaskParams | GetGithubCommitsTaskParamsType0 | - GetGithubCommitsTaskParamsType1 | GetGitlabCommitsTaskParamsType0 | GetGitlabCommitsTaskParamsType1 | - GetPulsesTaskParams | HttpClientTaskParams | InviteToGoogleChatSpaceTaskParams | - InviteToMicrosoftTeamsChannelRootlyTaskParams | InviteToMicrosoftTeamsChannelTaskParams | - InviteToSlackChannelOpsgenieTaskParams | InviteToSlackChannelPagerdutyTaskParamsType0 | - InviteToSlackChannelPagerdutyTaskParamsType1 | InviteToSlackChannelRootlyTaskParams | - InviteToSlackChannelTaskParamsType0 | InviteToSlackChannelTaskParamsType1 | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams | PageJsmopsOnCallRespondersTaskParams | - PageOpsgenieOnCallRespondersTaskParams | PagePagerdutyOnCallRespondersTaskParams | - PageRootlyOnCallRespondersTaskParams | PageVictorOpsOnCallRespondersTaskParamsType0 | - PageVictorOpsOnCallRespondersTaskParamsType1 | PrintTaskParams | PublishIncidentTaskParams | - RedisClientTaskParams | RemoveGoogleDocsPermissionsTaskParams | RenameGoogleChatSpaceTaskParams | - RenameMicrosoftTeamsChannelTaskParams | RenameSlackChannelTaskParams | RunCommandHerokuTaskParams | - SendDashboardReportTaskParams | SendEmailTaskParams | SendGoogleChatAttachmentsTaskParams | - SendGoogleChatMessageTaskParams | SendMicrosoftTeamsBlocksTaskParamsType0 | - SendMicrosoftTeamsChatMessageTaskParams | SendMicrosoftTeamsMessageTaskParamsType0 | - SendSlackBlocksTaskParamsType0 | SendSlackBlocksTaskParamsType1 | SendSlackBlocksTaskParamsType2 | - SendSlackMessageTaskParamsType0 | SendSlackMessageTaskParamsType1 | SendSlackMessageTaskParamsType2 | - SendSmsTaskParams | SendWhatsappMessageTaskParams | SnapshotDatadogGraphTaskParams | - SnapshotGrafanaDashboardTaskParams | SnapshotLookerLookTaskParams | SnapshotNewRelicGraphTaskParams | - TriggerWorkflowTaskParams | TweetTwitterMessageTaskParams | Unset | UpdateActionItemTaskParams | - UpdateAirtableTableRecordTaskParams | UpdateAsanaTaskTaskParams | UpdateAttachedAlertsTaskParams | - UpdateClickupTaskTaskParams | UpdateCodaPageTaskParams | UpdateConfluencePageTaskParams | - UpdateDatadogNotebookTaskParams | UpdateDropboxPaperPageTaskParams | UpdateGithubIssueTaskParams | - UpdateGitlabIssueTaskParams | UpdateGoogleCalendarEventTaskParams | UpdateGoogleChatSpaceDescriptionTaskParams | - UpdateGoogleDocsPageTaskParams | UpdateIncidentPostmortemTaskParams | UpdateIncidentStatusTimestampTaskParams | - UpdateIncidentTaskParams | UpdateJiraIssueTaskParams | UpdateLinearIssueTaskParams | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams | UpdateOpsgenieAlertTaskParams | UpdateOpsgenieIncidentTaskParams | - UpdatePagerdutyIncidentTaskParams | UpdatePagertreeAlertTaskParams | UpdateQuipPageTaskParams | - UpdateServiceNowIncidentTaskParams | UpdateSharepointPageTaskParams | UpdateShortcutStoryTaskParams | - UpdateShortcutTaskTaskParams | UpdateSlackChannelTopicTaskParams | UpdateStatusTaskParams | - UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | UpdateZendeskTicketTaskParams): + name (Union[Unset, str]): Name of the workflow task + position (Union[Unset, int]): The position of the workflow task + skip_on_failure (Union[Unset, bool]): Skip workflow task if any failures + enabled (Union[Unset, bool]): Enable/disable workflow task Default: True. + task_params (Union['AddActionItemTaskParams', 'AddMicrosoftTeamsChatTabTaskParams', + 'AddMicrosoftTeamsTabTaskParamsType0', 'AddMicrosoftTeamsTabTaskParamsType1', 'AddRoleTaskParams', + 'AddSlackBookmarkTaskParamsType0', 'AddSlackBookmarkTaskParamsType1', 'AddTeamTaskParams', + 'AddToTimelineTaskParams', 'ArchiveGoogleChatSpacesTaskParams', 'ArchiveMicrosoftTeamsChannelsTaskParams', + 'ArchiveSlackChannelsTaskParams', 'AttachDatadogDashboardsTaskParams', + 'AttachRetrospectivePdfToFreshserviceTicketTaskParams', 'AttachRetrospectivePdfToJiraIssueTaskParams', + 'AutoAssignRoleOpsgenieTaskParams', 'AutoAssignRolePagerdutyTaskParamsType0', + 'AutoAssignRolePagerdutyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType0', + 'AutoAssignRoleRootlyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType2', + 'AutoAssignRoleRootlyTaskParamsType3', 'AutoAssignRoleRootlyTaskParamsType4', + 'AutoAssignRoleVictorOpsTaskParams', 'CallPeopleTaskParams', 'ChangeGoogleChatSpacePrivacyTaskParams', + 'ChangeSlackChannelPrivacyTaskParams', 'CreateAirtableTableRecordTaskParams', + 'CreateAnthropicChatCompletionTaskParams', 'CreateAsanaSubtaskTaskParams', 'CreateAsanaTaskTaskParams', + 'CreateClickupTaskTaskParams', 'CreateCodaPageTaskParams', 'CreateConfluencePageTaskParams', + 'CreateDatadogNotebookTaskParams', 'CreateDropboxPaperPageTaskParams', 'CreateGithubIssueTaskParams', + 'CreateGitlabIssueTaskParams', 'CreateGoToMeetingTaskParams', 'CreateGoogleCalendarEventTaskParams', + 'CreateGoogleChatSpaceTaskParams', 'CreateGoogleDocsPageTaskParams', 'CreateGoogleDocsPermissionsTaskParams', + 'CreateGoogleGeminiChatCompletionTaskParams', 'CreateGoogleMeetingTaskParams', + 'CreateIncidentPostmortemTaskParams', 'CreateIncidentTaskParams', 'CreateJiraIssueTaskParams', + 'CreateJiraSubtaskTaskParams', 'CreateJsmopsAlertTaskParams', 'CreateLinearIssueCommentTaskParams', + 'CreateLinearIssueTaskParams', 'CreateLinearSubtaskIssueTaskParams', 'CreateMicrosoftTeamsChannelTaskParams', + 'CreateMicrosoftTeamsChatTaskParams', 'CreateMicrosoftTeamsMeetingTaskParams', + 'CreateMistralChatCompletionTaskParams', 'CreateMotionTaskTaskParams', 'CreateNotionPageTaskParams', + 'CreateOpenaiChatCompletionTaskParams', 'CreateOpsgenieAlertTaskParams', 'CreateOutlookEventTaskParams', + 'CreatePagerdutyStatusUpdateTaskParams', 'CreatePagertreeAlertTaskParams', 'CreateQuipPageTaskParams', + 'CreateServiceNowIncidentTaskParams', 'CreateSharepointPageTaskParams', 'CreateShortcutStoryTaskParamsType0', + 'CreateShortcutStoryTaskParamsType1', 'CreateShortcutTaskTaskParams', 'CreateSlackChannelTaskParams', + 'CreateSubIncidentTaskParams', 'CreateTrelloCardTaskParams', 'CreateWatsonxChatCompletionTaskParams', + 'CreateWebexMeetingTaskParams', 'CreateZendeskJiraLinkTaskParams', 'CreateZendeskTicketTaskParams', + 'CreateZoomMeetingTaskParams', 'GetAlertsTaskParams', 'GetGithubCommitsTaskParamsType0', + 'GetGithubCommitsTaskParamsType1', 'GetGitlabCommitsTaskParamsType0', 'GetGitlabCommitsTaskParamsType1', + 'GetPulsesTaskParams', 'HttpClientTaskParams', 'InviteToGoogleChatSpaceTaskParams', + 'InviteToMicrosoftTeamsChannelRootlyTaskParams', 'InviteToMicrosoftTeamsChannelTaskParams', + 'InviteToSlackChannelOpsgenieTaskParams', 'InviteToSlackChannelPagerdutyTaskParamsType0', + 'InviteToSlackChannelPagerdutyTaskParamsType1', 'InviteToSlackChannelRootlyTaskParams', + 'InviteToSlackChannelTaskParamsType0', 'InviteToSlackChannelTaskParamsType1', + 'InviteToSlackChannelTaskParamsType2', 'InviteToSlackChannelVictorOpsTaskParams', + 'PageJsmopsOnCallRespondersTaskParams', 'PageOpsgenieOnCallRespondersTaskParams', + 'PagePagerdutyOnCallRespondersTaskParams', 'PageRootlyOnCallRespondersTaskParams', + 'PageVictorOpsOnCallRespondersTaskParamsType0', 'PageVictorOpsOnCallRespondersTaskParamsType1', + 'PrintTaskParams', 'PublishIncidentTaskParams', 'RedisClientTaskParams', + 'RemoveGoogleDocsPermissionsTaskParams', 'RenameGoogleChatSpaceTaskParams', + 'RenameMicrosoftTeamsChannelTaskParams', 'RenameSlackChannelTaskParams', 'RunCommandHerokuTaskParams', + 'SendDashboardReportTaskParams', 'SendEmailTaskParams', 'SendGoogleChatAttachmentsTaskParams', + 'SendGoogleChatMessageTaskParams', 'SendMicrosoftTeamsBlocksTaskParamsType0', + 'SendMicrosoftTeamsChatMessageTaskParams', 'SendMicrosoftTeamsMessageTaskParamsType0', + 'SendSlackBlocksTaskParamsType0', 'SendSlackBlocksTaskParamsType1', 'SendSlackBlocksTaskParamsType2', + 'SendSlackMessageTaskParamsType0', 'SendSlackMessageTaskParamsType1', 'SendSlackMessageTaskParamsType2', + 'SendSmsTaskParams', 'SendWhatsappMessageTaskParams', 'SnapshotDatadogGraphTaskParams', + 'SnapshotGrafanaDashboardTaskParams', 'SnapshotLookerLookTaskParams', 'SnapshotNewRelicGraphTaskParams', + 'TriggerWorkflowTaskParams', 'TweetTwitterMessageTaskParams', 'UpdateActionItemTaskParams', + 'UpdateAirtableTableRecordTaskParams', 'UpdateAsanaTaskTaskParams', 'UpdateAttachedAlertsTaskParams', + 'UpdateClickupTaskTaskParams', 'UpdateCodaPageTaskParams', 'UpdateConfluencePageTaskParams', + 'UpdateDatadogNotebookTaskParams', 'UpdateDropboxPaperPageTaskParams', 'UpdateGithubIssueTaskParams', + 'UpdateGitlabIssueTaskParams', 'UpdateGoogleCalendarEventTaskParams', + 'UpdateGoogleChatSpaceDescriptionTaskParams', 'UpdateGoogleDocsPageTaskParams', + 'UpdateIncidentPostmortemTaskParams', 'UpdateIncidentStatusTimestampTaskParams', 'UpdateIncidentTaskParams', + 'UpdateJiraIssueTaskParams', 'UpdateLinearIssueTaskParams', 'UpdateMotionTaskTaskParams', + 'UpdateNotionPageTaskParams', 'UpdateOpsgenieAlertTaskParams', 'UpdateOpsgenieIncidentTaskParams', + 'UpdatePagerdutyIncidentTaskParams', 'UpdatePagertreeAlertTaskParams', 'UpdateQuipPageTaskParams', + 'UpdateServiceNowIncidentTaskParams', 'UpdateSharepointPageTaskParams', 'UpdateShortcutStoryTaskParams', + 'UpdateShortcutTaskTaskParams', 'UpdateSlackChannelTopicTaskParams', 'UpdateStatusTaskParams', + 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams', Unset]): """ - name: str | Unset = UNSET - position: int | Unset = UNSET - skip_on_failure: bool | Unset = UNSET - enabled: bool | Unset = True - task_params: ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | Unset - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ) = UNSET + name: Unset | str = UNSET + position: Unset | int = UNSET + skip_on_failure: Unset | bool = UNSET + enabled: Unset | bool = True + task_params: Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams @@ -434,13 +450,20 @@ def to_dict(self) -> dict[str, Any]: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -602,7 +625,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - task_params: dict[str, Any] | Unset + task_params: Unset | dict[str, Any] if isinstance(self.task_params, Unset): task_params = UNSET elif isinstance(self.task_params, AddActionItemTaskParams): @@ -625,7 +648,15 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRoleOpsgenieTaskParams): task_params = self.task_params.to_dict() - elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParams): + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType0): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType1): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType2): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType3): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType4): task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRolePagerdutyTaskParamsType0): task_params = self.task_params.to_dict() @@ -697,6 +728,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AttachRetrospectivePdfToJiraIssueTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AttachRetrospectivePdfToFreshserviceTicketTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearIssueTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearSubtaskIssueTaskParams): @@ -959,13 +992,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -1131,170 +1171,175 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | Unset - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ): + ) -> Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -1303,7 +1348,7 @@ def _parse_task_params( task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1311,7 +1356,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1319,7 +1364,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1327,7 +1372,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_0 = AddSlackBookmarkTaskParamsType0.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1335,7 +1380,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_1 = AddSlackBookmarkTaskParamsType1.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1343,7 +1388,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1351,7 +1396,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1359,7 +1404,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1367,7 +1412,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1375,15 +1420,57 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_0 = ( + AutoAssignRoleRootlyTaskParamsType0.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_1 = ( + AutoAssignRoleRootlyTaskParamsType1.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_2 = ( + AutoAssignRoleRootlyTaskParamsType2.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_3 = ( + AutoAssignRoleRootlyTaskParamsType3.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_3 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_9 = AutoAssignRoleRootlyTaskParams.from_dict(data) + componentsschemasauto_assign_role_rootly_task_params_type_4 = ( + AutoAssignRoleRootlyTaskParamsType4.from_dict(data) + ) - return task_params_type_9 - except (TypeError, ValueError, AttributeError, KeyError): + return componentsschemasauto_assign_role_rootly_task_params_type_4 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1393,7 +1480,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1403,7 +1490,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1411,7 +1498,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1419,7 +1506,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1427,7 +1514,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1435,7 +1522,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1443,7 +1530,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1451,7 +1538,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1459,7 +1546,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1467,7 +1554,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1475,7 +1562,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1483,7 +1570,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1491,7 +1578,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1499,7 +1586,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1507,7 +1594,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1515,7 +1602,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1523,7 +1610,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1531,7 +1618,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1539,7 +1626,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1547,7 +1634,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1555,7 +1642,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1563,7 +1650,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1571,7 +1658,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1579,7 +1666,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1587,7 +1674,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1595,7 +1682,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1603,7 +1690,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1611,7 +1698,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1619,7 +1706,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1627,7 +1714,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1635,7 +1722,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1643,7 +1730,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1651,7 +1738,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1659,7 +1746,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1667,55 +1754,63 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_44 = CreateLinearIssueTaskParams.from_dict(data) + task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_45 = CreateLinearSubtaskIssueTaskParams.from_dict(data) + task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_46 = CreateLinearIssueCommentTaskParams.from_dict(data) + task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_47 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) + task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_48 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_49 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + + return task_params_type_50 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1725,7 +1820,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1735,111 +1830,111 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_51 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) - - return task_params_type_51 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_52 = CreateGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_53 = SendGoogleChatMessageTaskParams.from_dict(data) + task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_54 = SendGoogleChatAttachmentsTaskParams.from_dict(data) + task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_55 = InviteToGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_56 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) + task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_57 = RenameGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_58 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) + task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_59 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) + task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_60 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) + task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_61 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_62 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_63 = CreateNotionPageTaskParams.from_dict(data) + task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) + + return task_params_type_64 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1849,15 +1944,15 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_65 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) + task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) - return task_params_type_65 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_66 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1867,63 +1962,63 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_67 = UpdateNotionPageTaskParams.from_dict(data) - - return task_params_type_67 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_68 = UpdateQuipPageTaskParams.from_dict(data) + task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_69 = UpdateConfluencePageTaskParams.from_dict(data) + task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_70 = UpdateSharepointPageTaskParams.from_dict(data) + task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_71 = UpdateDropboxPaperPageTaskParams.from_dict(data) + task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_72 = UpdateDatadogNotebookTaskParams.from_dict(data) + task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_73 = CreateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) + + return task_params_type_74 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1933,7 +2028,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1943,71 +2038,71 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_75 = CreateShortcutTaskTaskParams.from_dict(data) - - return task_params_type_75 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_76 = CreateTrelloCardTaskParams.from_dict(data) + task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_77 = CreateWebexMeetingTaskParams.from_dict(data) + task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_78 = CreateZendeskTicketTaskParams.from_dict(data) + task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_79 = CreateZendeskJiraLinkTaskParams.from_dict(data) + task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_80 = CreateClickupTaskTaskParams.from_dict(data) + task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_81 = CreateMotionTaskTaskParams.from_dict(data) + task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_82 = CreateZoomMeetingTaskParams.from_dict(data) + task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) + + return task_params_type_83 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2015,7 +2110,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_0 = GetGithubCommitsTaskParamsType0.from_dict(data) return componentsschemasget_github_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2023,7 +2118,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_1 = GetGithubCommitsTaskParamsType1.from_dict(data) return componentsschemasget_github_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2031,7 +2126,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_0 = GetGitlabCommitsTaskParamsType0.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2039,55 +2134,55 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_85 = GetPulsesTaskParams.from_dict(data) - - return task_params_type_85 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_86 = GetAlertsTaskParams.from_dict(data) + task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_87 = HttpClientTaskParams.from_dict(data) + task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_88 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) + task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_89 = InviteToSlackChannelRootlyTaskParams.from_dict(data) + task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_90 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + + return task_params_type_91 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2097,7 +2192,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2107,7 +2202,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2117,7 +2212,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2127,7 +2222,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2137,79 +2232,79 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_93 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) - - return task_params_type_93 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_94 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) + task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_95 = CreateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_96 = CreateJsmopsAlertTaskParams.from_dict(data) + task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_97 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) + task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_98 = UpdateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_99 = UpdateOpsgenieIncidentTaskParams.from_dict(data) + task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_100 = PageRootlyOnCallRespondersTaskParams.from_dict(data) + task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_101 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + + return task_params_type_102 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2219,7 +2314,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2229,87 +2324,87 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_103 = UpdateVictorOpsIncidentTaskParams.from_dict(data) - - return task_params_type_103 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_104 = PrintTaskParams.from_dict(data) + task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_105 = PublishIncidentTaskParams.from_dict(data) + task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_106 = RedisClientTaskParams.from_dict(data) + task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_107 = RenameSlackChannelTaskParams.from_dict(data) + task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_108 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_109 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = SendEmailTaskParams.from_dict(data) + task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_110 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_111 = SendEmailTaskParams.from_dict(data) return task_params_type_111 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_112 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + + return task_params_type_113 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2317,7 +2412,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) return componentsschemassend_slack_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2325,7 +2420,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) return componentsschemassend_slack_message_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2333,223 +2428,223 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) return componentsschemassend_slack_message_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_114 = SendSmsTaskParams.from_dict(data) - - return task_params_type_114 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_115 = SendWhatsappMessageTaskParams.from_dict(data) + task_params_type_115 = SendSmsTaskParams.from_dict(data) return task_params_type_115 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_116 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_117 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_117 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_117 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_118 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_119 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_120 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_121 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_122 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_123 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_124 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_125 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_126 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_127 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_128 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_129 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_130 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_131 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_132 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateStatusTaskParams.from_dict(data) + task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_133 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_134 = UpdateStatusTaskParams.from_dict(data) return task_params_type_134 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_135 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_136 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_137 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_138 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) return task_params_type_139 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) return task_params_type_140 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_141 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2557,7 +2652,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_0 = SendSlackBlocksTaskParamsType0.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2565,7 +2660,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_1 = SendSlackBlocksTaskParamsType1.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2573,45 +2668,45 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_2 = SendSlackBlocksTaskParamsType2.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_142 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_142 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_143 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_144 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_145 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_146 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_146 + return task_params_type_147 task_params = _parse_task_params(d.pop("task_params", UNSET)) diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params.py b/rootly_sdk/models/update_zendesk_ticket_task_params.py index 1791e774..17aeb783 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,32 +23,31 @@ class UpdateZendeskTicketTaskParams: """ Attributes: ticket_id (str): The ticket id - task_type (UpdateZendeskTicketTaskParamsTaskType | Unset): - subject (str | Unset): The ticket subject - tags (str | Unset): The ticket tags - priority (UpdateZendeskTicketTaskParamsPriority | Unset): The priority id and display name - completion (UpdateZendeskTicketTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateZendeskTicketTaskParamsTaskType]): + subject (Union[Unset, str]): The ticket subject + tags (Union[Unset, str]): The ticket tags + priority (Union[Unset, UpdateZendeskTicketTaskParamsPriority]): The priority id and display name + completion (Union[Unset, UpdateZendeskTicketTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - ticket_payload (None | str | Unset): Additional Zendesk ticket attributes. Will be merged into whatever was + ticket_payload (Union[None, Unset, str]): Additional Zendesk ticket attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ ticket_id: str - task_type: UpdateZendeskTicketTaskParamsTaskType | Unset = UNSET - subject: str | Unset = UNSET - tags: str | Unset = UNSET - priority: UpdateZendeskTicketTaskParamsPriority | Unset = UNSET - completion: UpdateZendeskTicketTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - ticket_payload: None | str | Unset = UNSET + task_type: Unset | UpdateZendeskTicketTaskParamsTaskType = UNSET + subject: Unset | str = UNSET + tags: Unset | str = UNSET + priority: Union[Unset, "UpdateZendeskTicketTaskParamsPriority"] = UNSET + completion: Union[Unset, "UpdateZendeskTicketTaskParamsCompletion"] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + ticket_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - ticket_id = self.ticket_id - task_type: str | Unset = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,21 +55,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: None | str | Unset + ticket_payload: None | Unset | str if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -111,7 +108,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ticket_id = d.pop("ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateZendeskTicketTaskParamsTaskType | Unset + task_type: Unset | UpdateZendeskTicketTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -122,34 +119,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateZendeskTicketTaskParamsPriority | Unset + priority: Unset | UpdateZendeskTicketTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: UpdateZendeskTicketTaskParamsCompletion | Unset + completion: Unset | UpdateZendeskTicketTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> None | str | Unset: + def _parse_ticket_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) ticket_payload = _parse_ticket_payload(d.pop("ticket_payload", UNSET)) diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py index 5e531f48..728efbab 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateZendeskTicketTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py index e87ec4f3..1545b485 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,12 +14,12 @@ class UpdateZendeskTicketTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/uptime_chart_response.py b/rootly_sdk/models/uptime_chart_response.py index 0662c7d6..314e0a8b 100644 --- a/rootly_sdk/models/uptime_chart_response.py +++ b/rootly_sdk/models/uptime_chart_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UptimeChartResponse: data (UptimeChartResponseData): """ - data: UptimeChartResponseData + data: "UptimeChartResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/uptime_chart_response_data.py b/rootly_sdk/models/uptime_chart_response_data.py index 72ef2ae1..489012f1 100644 --- a/rootly_sdk/models/uptime_chart_response_data.py +++ b/rootly_sdk/models/uptime_chart_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UptimeChartResponseData: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/user.py b/rootly_sdk/models/user.py index 3604e323..0d31891e 100644 --- a/rootly_sdk/models/user.py +++ b/rootly_sdk/models/user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,21 +16,21 @@ class User: email (str): The email of the user created_at (str): Date of creation updated_at (str): Date of last update - first_name (None | str | Unset): First name of the user - last_name (None | str | Unset): Last name of the user - full_name (None | str | Unset): The full name of the user - full_name_with_team (None | str | Unset): The full name with team of the user - time_zone (None | str | Unset): Configured time zone + first_name (Union[None, Unset, str]): First name of the user + last_name (Union[None, Unset, str]): Last name of the user + full_name (Union[None, Unset, str]): The full name of the user + full_name_with_team (Union[None, Unset, str]): The full name with team of the user + time_zone (Union[None, Unset, str]): Configured time zone """ email: str created_at: str updated_at: str - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - full_name: None | str | Unset = UNSET - full_name_with_team: None | str | Unset = UNSET - time_zone: None | str | Unset = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + full_name: None | Unset | str = UNSET + full_name_with_team: None | Unset | str = UNSET + time_zone: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,31 +40,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: None | str | Unset + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - full_name: None | str | Unset + full_name: None | Unset | str if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: None | str | Unset + full_name_with_team: None | Unset | str if isinstance(self.full_name_with_team, Unset): full_name_with_team = UNSET else: full_name_with_team = self.full_name_with_team - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -103,48 +101,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_full_name(data: object) -> None | str | Unset: + def _parse_full_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> None | str | Unset: + def _parse_full_name_with_team(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/user_email_address.py b/rootly_sdk/models/user_email_address.py index 2f901d3e..ada7931e 100644 --- a/rootly_sdk/models/user_email_address.py +++ b/rootly_sdk/models/user_email_address.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -15,18 +13,18 @@ class UserEmailAddress: """ Attributes: - user_id (int | Unset): - email (str | Unset): Email address - primary (bool | Unset): Whether this is the primary email address - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + user_id (Union[Unset, int]): + email (Union[Unset, str]): Email address + primary (Union[Unset, bool]): Whether this is the primary email address + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - user_id: int | Unset = UNSET - email: str | Unset = UNSET - primary: bool | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + user_id: Unset | int = UNSET + email: Unset | str = UNSET + primary: Unset | bool = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/user_email_address_list.py b/rootly_sdk/models/user_email_address_list.py index c66109e3..c79daafa 100644 --- a/rootly_sdk/models/user_email_address_list.py +++ b/rootly_sdk/models/user_email_address_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class UserEmailAddressList: """ Attributes: - data (list[UserEmailAddressListDataItem]): + data (list['UserEmailAddressListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserEmailAddressListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserEmailAddressListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_email_address_list = cls( data=data, diff --git a/rootly_sdk/models/user_email_address_list_data_item.py b/rootly_sdk/models/user_email_address_list_data_item.py index 2e958798..86906a72 100644 --- a/rootly_sdk/models/user_email_address_list_data_item.py +++ b/rootly_sdk/models/user_email_address_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserEmailAddressListDataItem: id: str type_: UserEmailAddressListDataItemType - attributes: UserEmailAddress + attributes: "UserEmailAddress" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_email_address_response.py b/rootly_sdk/models/user_email_address_response.py index 78fed502..a85c64e3 100644 --- a/rootly_sdk/models/user_email_address_response.py +++ b/rootly_sdk/models/user_email_address_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class UserEmailAddressResponse: """ Attributes: data (UserEmailAddressResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserEmailAddressResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserEmailAddressResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserEmailAddressResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_email_address_response = cls( data=data, diff --git a/rootly_sdk/models/user_email_address_response_data.py b/rootly_sdk/models/user_email_address_response_data.py index 8d79cd83..05b0715b 100644 --- a/rootly_sdk/models/user_email_address_response_data.py +++ b/rootly_sdk/models/user_email_address_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserEmailAddressResponseData: id: str type_: UserEmailAddressResponseDataType - attributes: UserEmailAddress + attributes: "UserEmailAddress" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_flat_response.py b/rootly_sdk/models/user_flat_response.py index ed5c61d3..dced1e40 100644 --- a/rootly_sdk/models/user_flat_response.py +++ b/rootly_sdk/models/user_flat_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,32 +18,32 @@ class UserFlatResponse: email (str): Email address created_at (str): Date of creation updated_at (str): Date of last update - name (str | Unset): Display name - phone (None | str | Unset): Primary phone number - phone_2 (None | str | Unset): Secondary phone number - first_name (None | str | Unset): First name - last_name (None | str | Unset): Last name - preferred_name (None | str | Unset): Preferred name - full_name (None | str | Unset): Full name - full_name_with_team (None | str | Unset): Full name with team context - slack_id (None | str | Unset): Slack user ID - time_zone (None | str | Unset): IANA time zone + name (Union[Unset, str]): Display name + phone (Union[None, Unset, str]): Primary phone number + phone_2 (Union[None, Unset, str]): Secondary phone number + first_name (Union[None, Unset, str]): First name + last_name (Union[None, Unset, str]): Last name + preferred_name (Union[None, Unset, str]): Preferred name + full_name (Union[None, Unset, str]): Full name + full_name_with_team (Union[None, Unset, str]): Full name with team context + slack_id (Union[None, Unset, str]): Slack user ID + time_zone (Union[None, Unset, str]): IANA time zone """ id: int email: str created_at: str updated_at: str - name: str | Unset = UNSET - phone: None | str | Unset = UNSET - phone_2: None | str | Unset = UNSET - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - preferred_name: None | str | Unset = UNSET - full_name: None | str | Unset = UNSET - full_name_with_team: None | str | Unset = UNSET - slack_id: None | str | Unset = UNSET - time_zone: None | str | Unset = UNSET + name: Unset | str = UNSET + phone: None | Unset | str = UNSET + phone_2: None | Unset | str = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + preferred_name: None | Unset | str = UNSET + full_name: None | Unset | str = UNSET + full_name_with_team: None | Unset | str = UNSET + slack_id: None | Unset | str = UNSET + time_zone: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -59,55 +57,55 @@ def to_dict(self) -> dict[str, Any]: name = self.name - phone: None | str | Unset + phone: None | Unset | str if isinstance(self.phone, Unset): phone = UNSET else: phone = self.phone - phone_2: None | str | Unset + phone_2: None | Unset | str if isinstance(self.phone_2, Unset): phone_2 = UNSET else: phone_2 = self.phone_2 - first_name: None | str | Unset + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: None | str | Unset + preferred_name: None | Unset | str if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: None | str | Unset + full_name: None | Unset | str if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: None | str | Unset + full_name_with_team: None | Unset | str if isinstance(self.full_name_with_team, Unset): full_name_with_team = UNSET else: full_name_with_team = self.full_name_with_team - slack_id: None | str | Unset + slack_id: None | Unset | str if isinstance(self.slack_id, Unset): slack_id = UNSET else: slack_id = self.slack_id - time_zone: None | str | Unset + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -159,84 +157,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_phone(data: object) -> None | str | Unset: + def _parse_phone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) phone = _parse_phone(d.pop("phone", UNSET)) - def _parse_phone_2(data: object) -> None | str | Unset: + def _parse_phone_2(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) phone_2 = _parse_phone_2(d.pop("phone_2", UNSET)) - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> None | str | Unset: + def _parse_preferred_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> None | str | Unset: + def _parse_full_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> None | str | Unset: + def _parse_full_name_with_team(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_slack_id(data: object) -> None | str | Unset: + def _parse_slack_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) slack_id = _parse_slack_id(d.pop("slack_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/user_list.py b/rootly_sdk/models/user_list.py index 45656060..237ac482 100644 --- a/rootly_sdk/models/user_list.py +++ b/rootly_sdk/models/user_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class UserList: """ Attributes: - data (list[UserListDataItem]): + data (list['UserListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_list = cls( data=data, diff --git a/rootly_sdk/models/user_list_data_item.py b/rootly_sdk/models/user_list_data_item.py index 96f8c048..4abc12ea 100644 --- a/rootly_sdk/models/user_list_data_item.py +++ b/rootly_sdk/models/user_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class UserListDataItem: id (str): Unique ID of the user type_ (UserListDataItemType): attributes (User): - relationships (UserRelationships | Unset): + relationships (Union[Unset, UserRelationships]): """ id: str type_: UserListDataItemType - attributes: User - relationships: UserRelationships | Unset = UNSET + attributes: "User" + relationships: Union[Unset, "UserRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = User.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: UserRelationships | Unset + relationships: Unset | UserRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/user_notification_rule.py b/rootly_sdk/models/user_notification_rule.py index a1ece08a..d271fc44 100644 --- a/rootly_sdk/models/user_notification_rule.py +++ b/rootly_sdk/models/user_notification_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,81 +21,81 @@ class UserNotificationRule: """ Attributes: - user_id (int | Unset): - delay (int | None | Unset): Delay after which rule gets triggered - position (int | None | Unset): Position of the rule - user_email_address_id (None | str | Unset): User email address to which notification to be sent - user_call_number_id (None | str | Unset): User phone number to which notification to be sent - user_sms_number_id (None | str | Unset): User sms number to which notification to be sent - user_device_id (None | str | Unset): User device to which notification to be sent - enabled_contact_types (list[UserNotificationRuleEnabledContactTypesItem] | Unset): Contact types for which + user_id (Union[Unset, int]): + delay (Union[None, Unset, int]): Delay after which rule gets triggered + position (Union[None, Unset, int]): Position of the rule + user_email_address_id (Union[None, Unset, str]): User email address to which notification to be sent + user_call_number_id (Union[None, Unset, str]): User phone number to which notification to be sent + user_sms_number_id (Union[None, Unset, str]): User sms number to which notification to be sent + user_device_id (Union[None, Unset, str]): User device to which notification to be sent + enabled_contact_types (Union[Unset, list[UserNotificationRuleEnabledContactTypesItem]]): Contact types for which notification needs to be enabled - notification_type (UserNotificationRuleNotificationType | Unset): Type of notification rule (audible or quiet). - Audible notifications use sound/vibration to alert users, while quiet notifications are silent. - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + notification_type (Union[Unset, UserNotificationRuleNotificationType]): Type of notification rule (audible or + quiet). Audible notifications use sound/vibration to alert users, while quiet notifications are silent. + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - user_id: int | Unset = UNSET - delay: int | None | Unset = UNSET - position: int | None | Unset = UNSET - user_email_address_id: None | str | Unset = UNSET - user_call_number_id: None | str | Unset = UNSET - user_sms_number_id: None | str | Unset = UNSET - user_device_id: None | str | Unset = UNSET - enabled_contact_types: list[UserNotificationRuleEnabledContactTypesItem] | Unset = UNSET - notification_type: UserNotificationRuleNotificationType | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + user_id: Unset | int = UNSET + delay: None | Unset | int = UNSET + position: None | Unset | int = UNSET + user_email_address_id: None | Unset | str = UNSET + user_call_number_id: None | Unset | str = UNSET + user_sms_number_id: None | Unset | str = UNSET + user_device_id: None | Unset | str = UNSET + enabled_contact_types: Unset | list[UserNotificationRuleEnabledContactTypesItem] = UNSET + notification_type: Unset | UserNotificationRuleNotificationType = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: user_id = self.user_id - delay: int | None | Unset + delay: None | Unset | int if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: int | None | Unset + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | str | Unset + user_email_address_id: None | Unset | str if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: None | str | Unset + user_call_number_id: None | Unset | str if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: None | str | Unset + user_sms_number_id: None | Unset | str if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: None | str | Unset + user_device_id: None | Unset | str if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: list[str] | Unset = UNSET + enabled_contact_types: Unset | list[str] = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: enabled_contact_types_item: str = enabled_contact_types_item_data enabled_contact_types.append(enabled_contact_types_item) - notification_type: str | Unset = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type @@ -138,73 +136,71 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) user_id = d.pop("user_id", UNSET) - def _parse_delay(data: object) -> int | None | Unset: + def _parse_delay(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | str | Unset: + def _parse_user_email_address_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> None | str | Unset: + def _parse_user_call_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> None | str | Unset: + def _parse_user_sms_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> None | str | Unset: + def _parse_user_device_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) + enabled_contact_types = [] _enabled_contact_types = d.pop("enabled_contact_types", UNSET) - enabled_contact_types: list[UserNotificationRuleEnabledContactTypesItem] | Unset = UNSET - if _enabled_contact_types is not UNSET: - enabled_contact_types = [] - for enabled_contact_types_item_data in _enabled_contact_types: - enabled_contact_types_item = check_user_notification_rule_enabled_contact_types_item( - enabled_contact_types_item_data - ) + for enabled_contact_types_item_data in _enabled_contact_types or []: + enabled_contact_types_item = check_user_notification_rule_enabled_contact_types_item( + enabled_contact_types_item_data + ) - enabled_contact_types.append(enabled_contact_types_item) + enabled_contact_types.append(enabled_contact_types_item) _notification_type = d.pop("notification_type", UNSET) - notification_type: UserNotificationRuleNotificationType | Unset + notification_type: Unset | UserNotificationRuleNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: diff --git a/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py b/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py index 4858502c..0b4a4f5a 100644 --- a/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py +++ b/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py @@ -1,7 +1,7 @@ from typing import Literal, cast UserNotificationRuleEnabledContactTypesItem = Literal[ - "call", "device", "email", "google_chat", "non_critical_device", "slack", "sms" + "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" ] USER_NOTIFICATION_RULE_ENABLED_CONTACT_TYPES_ITEM_VALUES: set[UserNotificationRuleEnabledContactTypesItem] = { @@ -9,6 +9,7 @@ "device", "email", "google_chat", + "microsoft_teams", "non_critical_device", "slack", "sms", diff --git a/rootly_sdk/models/user_notification_rule_list.py b/rootly_sdk/models/user_notification_rule_list.py index 5d45a1b1..eed922a2 100644 --- a/rootly_sdk/models/user_notification_rule_list.py +++ b/rootly_sdk/models/user_notification_rule_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class UserNotificationRuleList: """ Attributes: - data (list[UserNotificationRuleListDataItem]): + data (list['UserNotificationRuleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserNotificationRuleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserNotificationRuleListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_notification_rule_list = cls( data=data, diff --git a/rootly_sdk/models/user_notification_rule_list_data_item.py b/rootly_sdk/models/user_notification_rule_list_data_item.py index a31d183a..cf65d0b1 100644 --- a/rootly_sdk/models/user_notification_rule_list_data_item.py +++ b/rootly_sdk/models/user_notification_rule_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserNotificationRuleListDataItem: id: str type_: UserNotificationRuleListDataItemType - attributes: UserNotificationRule + attributes: "UserNotificationRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_notification_rule_response.py b/rootly_sdk/models/user_notification_rule_response.py index d84b742e..e3b158dd 100644 --- a/rootly_sdk/models/user_notification_rule_response.py +++ b/rootly_sdk/models/user_notification_rule_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class UserNotificationRuleResponse: """ Attributes: data (UserNotificationRuleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserNotificationRuleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserNotificationRuleResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserNotificationRuleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_notification_rule_response = cls( data=data, diff --git a/rootly_sdk/models/user_notification_rule_response_data.py b/rootly_sdk/models/user_notification_rule_response_data.py index 76739bf0..962221fd 100644 --- a/rootly_sdk/models/user_notification_rule_response_data.py +++ b/rootly_sdk/models/user_notification_rule_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserNotificationRuleResponseData: id: str type_: UserNotificationRuleResponseDataType - attributes: UserNotificationRule + attributes: "UserNotificationRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_phone_number.py b/rootly_sdk/models/user_phone_number.py index 56225020..a458ba06 100644 --- a/rootly_sdk/models/user_phone_number.py +++ b/rootly_sdk/models/user_phone_number.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,22 +15,22 @@ class UserPhoneNumber: """ Attributes: - user_id (int | Unset): - phone (str | Unset): Phone number in international format - primary (bool | Unset): Whether this is the primary phone number - verified_at (datetime.datetime | None | Unset): Date when phone number was verified - verification_attempts_today (int | Unset): Number of verification attempts made today - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + user_id (Union[Unset, int]): + phone (Union[Unset, str]): Phone number in international format + primary (Union[Unset, bool]): Whether this is the primary phone number + verified_at (Union[None, Unset, datetime.datetime]): Date when phone number was verified + verification_attempts_today (Union[Unset, int]): Number of verification attempts made today + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - user_id: int | Unset = UNSET - phone: str | Unset = UNSET - primary: bool | Unset = UNSET - verified_at: datetime.datetime | None | Unset = UNSET - verification_attempts_today: int | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + user_id: Unset | int = UNSET + phone: Unset | str = UNSET + primary: Unset | bool = UNSET + verified_at: None | Unset | datetime.datetime = UNSET + verification_attempts_today: Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: primary = self.primary - verified_at: None | str | Unset + verified_at: None | Unset | str if isinstance(self.verified_at, Unset): verified_at = UNSET elif isinstance(self.verified_at, datetime.datetime): @@ -85,7 +83,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: primary = d.pop("primary", UNSET) - def _parse_verified_at(data: object) -> datetime.datetime | None | Unset: + def _parse_verified_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -96,9 +94,9 @@ def _parse_verified_at(data: object) -> datetime.datetime | None | Unset: verified_at_type_0 = isoparse(data) return verified_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(None | Unset | datetime.datetime, data) verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) diff --git a/rootly_sdk/models/user_phone_number_list.py b/rootly_sdk/models/user_phone_number_list.py index 862069a5..e4eb2ca2 100644 --- a/rootly_sdk/models/user_phone_number_list.py +++ b/rootly_sdk/models/user_phone_number_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class UserPhoneNumberList: """ Attributes: - data (list[UserPhoneNumberListDataItem]): + data (list['UserPhoneNumberListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserPhoneNumberListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserPhoneNumberListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_phone_number_list = cls( data=data, diff --git a/rootly_sdk/models/user_phone_number_list_data_item.py b/rootly_sdk/models/user_phone_number_list_data_item.py index 5fec150d..d8e9ce4c 100644 --- a/rootly_sdk/models/user_phone_number_list_data_item.py +++ b/rootly_sdk/models/user_phone_number_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserPhoneNumberListDataItem: id: str type_: UserPhoneNumberListDataItemType - attributes: UserPhoneNumber + attributes: "UserPhoneNumber" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_phone_number_response.py b/rootly_sdk/models/user_phone_number_response.py index e4451cf2..763bfc8b 100644 --- a/rootly_sdk/models/user_phone_number_response.py +++ b/rootly_sdk/models/user_phone_number_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class UserPhoneNumberResponse: """ Attributes: data (UserPhoneNumberResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserPhoneNumberResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserPhoneNumberResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserPhoneNumberResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_phone_number_response = cls( data=data, diff --git a/rootly_sdk/models/user_phone_number_response_data.py b/rootly_sdk/models/user_phone_number_response_data.py index e8a248ba..4fcbf23a 100644 --- a/rootly_sdk/models/user_phone_number_response_data.py +++ b/rootly_sdk/models/user_phone_number_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserPhoneNumberResponseData: id: str type_: UserPhoneNumberResponseDataType - attributes: UserPhoneNumber + attributes: "UserPhoneNumber" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_relationships.py b/rootly_sdk/models/user_relationships.py index 1b6cfd67..01891445 100644 --- a/rootly_sdk/models/user_relationships.py +++ b/rootly_sdk/models/user_relationships.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class UserRelationships: """ Attributes: - role (RoleRelationship | Unset): - on_call_role (OnCallRoleRelationship | Unset): + role (Union[Unset, RoleRelationship]): + on_call_role (Union[Unset, OnCallRoleRelationship]): """ - role: RoleRelationship | Unset = UNSET - on_call_role: OnCallRoleRelationship | Unset = UNSET + role: Union[Unset, "RoleRelationship"] = UNSET + on_call_role: Union[Unset, "OnCallRoleRelationship"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - role: dict[str, Any] | Unset = UNSET + role: Unset | dict[str, Any] = UNSET if not isinstance(self.role, Unset): role = self.role.to_dict() - on_call_role: dict[str, Any] | Unset = UNSET + on_call_role: Unset | dict[str, Any] = UNSET if not isinstance(self.on_call_role, Unset): on_call_role = self.on_call_role.to_dict() @@ -55,14 +52,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _role = d.pop("role", UNSET) - role: RoleRelationship | Unset + role: Unset | RoleRelationship if isinstance(_role, Unset): role = UNSET else: role = RoleRelationship.from_dict(_role) _on_call_role = d.pop("on_call_role", UNSET) - on_call_role: OnCallRoleRelationship | Unset + on_call_role: Unset | OnCallRoleRelationship if isinstance(_on_call_role, Unset): on_call_role = UNSET else: diff --git a/rootly_sdk/models/user_response.py b/rootly_sdk/models/user_response.py index e0c5a147..34ff082f 100644 --- a/rootly_sdk/models/user_response.py +++ b/rootly_sdk/models/user_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class UserResponse: """ Attributes: data (UserResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_response = cls( data=data, diff --git a/rootly_sdk/models/user_response_data.py b/rootly_sdk/models/user_response_data.py index 483c1d26..48e292f5 100644 --- a/rootly_sdk/models/user_response_data.py +++ b/rootly_sdk/models/user_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class UserResponseData: id (str): Unique ID of the user type_ (UserResponseDataType): attributes (User): - relationships (UserRelationships | Unset): + relationships (Union[Unset, UserRelationships]): """ id: str type_: UserResponseDataType - attributes: User - relationships: UserRelationships | Unset = UNSET + attributes: "User" + relationships: Union[Unset, "UserRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = User.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: UserRelationships | Unset + relationships: Unset | UserRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/verified_domain.py b/rootly_sdk/models/verified_domain.py new file mode 100644 index 00000000..6fc9bf7f --- /dev/null +++ b/rootly_sdk/models/verified_domain.py @@ -0,0 +1,199 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.verified_domain_source import VerifiedDomainSource, check_verified_domain_source +from ..models.verified_domain_verification_status import ( + VerifiedDomainVerificationStatus, + check_verified_domain_verification_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="VerifiedDomain") + + +@_attrs_define +class VerifiedDomain: + """ + Attributes: + domain (str): The domain name + verification_status (VerifiedDomainVerificationStatus): Verification status + verification_token (str): The verification token + txt_host (str): The TXT record hostname to add + txt_value (str): The TXT record value to add + created_at (str): Date of creation + updated_at (str): Date of last update + verified_at (Union[None, Unset, str]): When the domain was first verified + last_checked_at (Union[None, Unset, str]): When the domain was last checked + last_check_passed_at (Union[None, Unset, str]): When the TXT record was last found + check_failures_count (Union[Unset, int]): Number of consecutive check failures + source (Union[Unset, VerifiedDomainSource]): How the domain was added + """ + + domain: str + verification_status: VerifiedDomainVerificationStatus + verification_token: str + txt_host: str + txt_value: str + created_at: str + updated_at: str + verified_at: None | Unset | str = UNSET + last_checked_at: None | Unset | str = UNSET + last_check_passed_at: None | Unset | str = UNSET + check_failures_count: Unset | int = UNSET + source: Unset | VerifiedDomainSource = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + verification_status: str = self.verification_status + + verification_token = self.verification_token + + txt_host = self.txt_host + + txt_value = self.txt_value + + created_at = self.created_at + + updated_at = self.updated_at + + verified_at: None | Unset | str + if isinstance(self.verified_at, Unset): + verified_at = UNSET + else: + verified_at = self.verified_at + + last_checked_at: None | Unset | str + if isinstance(self.last_checked_at, Unset): + last_checked_at = UNSET + else: + last_checked_at = self.last_checked_at + + last_check_passed_at: None | Unset | str + if isinstance(self.last_check_passed_at, Unset): + last_check_passed_at = UNSET + else: + last_check_passed_at = self.last_check_passed_at + + check_failures_count = self.check_failures_count + + source: Unset | str = UNSET + if not isinstance(self.source, Unset): + source = self.source + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain": domain, + "verification_status": verification_status, + "verification_token": verification_token, + "txt_host": txt_host, + "txt_value": txt_value, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if verified_at is not UNSET: + field_dict["verified_at"] = verified_at + if last_checked_at is not UNSET: + field_dict["last_checked_at"] = last_checked_at + if last_check_passed_at is not UNSET: + field_dict["last_check_passed_at"] = last_check_passed_at + if check_failures_count is not UNSET: + field_dict["check_failures_count"] = check_failures_count + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain") + + verification_status = check_verified_domain_verification_status(d.pop("verification_status")) + + verification_token = d.pop("verification_token") + + txt_host = d.pop("txt_host") + + txt_value = d.pop("txt_value") + + created_at = d.pop("created_at") + + updated_at = d.pop("updated_at") + + def _parse_verified_at(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) + + def _parse_last_checked_at(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + last_checked_at = _parse_last_checked_at(d.pop("last_checked_at", UNSET)) + + def _parse_last_check_passed_at(data: object) -> None | Unset | str: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | Unset | str, data) + + last_check_passed_at = _parse_last_check_passed_at(d.pop("last_check_passed_at", UNSET)) + + check_failures_count = d.pop("check_failures_count", UNSET) + + _source = d.pop("source", UNSET) + source: Unset | VerifiedDomainSource + if isinstance(_source, Unset): + source = UNSET + else: + source = check_verified_domain_source(_source) + + verified_domain = cls( + domain=domain, + verification_status=verification_status, + verification_token=verification_token, + txt_host=txt_host, + txt_value=txt_value, + created_at=created_at, + updated_at=updated_at, + verified_at=verified_at, + last_checked_at=last_checked_at, + last_check_passed_at=last_check_passed_at, + check_failures_count=check_failures_count, + source=source, + ) + + verified_domain.additional_properties = d + return verified_domain + + @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/rootly_sdk/models/verified_domain_list.py b/rootly_sdk/models/verified_domain_list.py new file mode 100644 index 00000000..1b552bab --- /dev/null +++ b/rootly_sdk/models/verified_domain_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.verified_domain_list_data_item import VerifiedDomainListDataItem + + +T = TypeVar("T", bound="VerifiedDomainList") + + +@_attrs_define +class VerifiedDomainList: + """ + Attributes: + data (list['VerifiedDomainListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["VerifiedDomainListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.verified_domain_list_data_item import VerifiedDomainListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = VerifiedDomainListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + verified_domain_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + verified_domain_list.additional_properties = d + return verified_domain_list + + @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/rootly_sdk/models/verified_domain_list_data_item.py b/rootly_sdk/models/verified_domain_list_data_item.py new file mode 100644 index 00000000..49509fa3 --- /dev/null +++ b/rootly_sdk/models/verified_domain_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.verified_domain_list_data_item_type import ( + VerifiedDomainListDataItemType, + check_verified_domain_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.verified_domain import VerifiedDomain + + +T = TypeVar("T", bound="VerifiedDomainListDataItem") + + +@_attrs_define +class VerifiedDomainListDataItem: + """ + Attributes: + id (str): Unique ID of the verified domain + type_ (VerifiedDomainListDataItemType): + attributes (VerifiedDomain): + """ + + id: str + type_: VerifiedDomainListDataItemType + attributes: "VerifiedDomain" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.verified_domain import VerifiedDomain + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_verified_domain_list_data_item_type(d.pop("type")) + + attributes = VerifiedDomain.from_dict(d.pop("attributes")) + + verified_domain_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + verified_domain_list_data_item.additional_properties = d + return verified_domain_list_data_item + + @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/rootly_sdk/models/verified_domain_list_data_item_type.py b/rootly_sdk/models/verified_domain_list_data_item_type.py new file mode 100644 index 00000000..b2f2b033 --- /dev/null +++ b/rootly_sdk/models/verified_domain_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +VerifiedDomainListDataItemType = Literal["verified_domains"] + +VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES: set[VerifiedDomainListDataItemType] = { + "verified_domains", +} + + +def check_verified_domain_list_data_item_type(value: str | None) -> VerifiedDomainListDataItemType | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES: + return cast(VerifiedDomainListDataItemType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain_response.py b/rootly_sdk/models/verified_domain_response.py new file mode 100644 index 00000000..8ab2b86b --- /dev/null +++ b/rootly_sdk/models/verified_domain_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.verified_domain_response_data import VerifiedDomainResponseData + + +T = TypeVar("T", bound="VerifiedDomainResponse") + + +@_attrs_define +class VerifiedDomainResponse: + """ + Attributes: + data (VerifiedDomainResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "VerifiedDomainResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.verified_domain_response_data import VerifiedDomainResponseData + + d = dict(src_dict) + data = VerifiedDomainResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + verified_domain_response = cls( + data=data, + included=included, + ) + + verified_domain_response.additional_properties = d + return verified_domain_response + + @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/rootly_sdk/models/verified_domain_response_data.py b/rootly_sdk/models/verified_domain_response_data.py new file mode 100644 index 00000000..b5d30fa3 --- /dev/null +++ b/rootly_sdk/models/verified_domain_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.verified_domain_response_data_type import ( + VerifiedDomainResponseDataType, + check_verified_domain_response_data_type, +) + +if TYPE_CHECKING: + from ..models.verified_domain import VerifiedDomain + + +T = TypeVar("T", bound="VerifiedDomainResponseData") + + +@_attrs_define +class VerifiedDomainResponseData: + """ + Attributes: + id (str): Unique ID of the verified domain + type_ (VerifiedDomainResponseDataType): + attributes (VerifiedDomain): + """ + + id: str + type_: VerifiedDomainResponseDataType + attributes: "VerifiedDomain" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.verified_domain import VerifiedDomain + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_verified_domain_response_data_type(d.pop("type")) + + attributes = VerifiedDomain.from_dict(d.pop("attributes")) + + verified_domain_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + verified_domain_response_data.additional_properties = d + return verified_domain_response_data + + @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/rootly_sdk/models/verified_domain_response_data_type.py b/rootly_sdk/models/verified_domain_response_data_type.py new file mode 100644 index 00000000..a7b6e33d --- /dev/null +++ b/rootly_sdk/models/verified_domain_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +VerifiedDomainResponseDataType = Literal["verified_domains"] + +VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES: set[VerifiedDomainResponseDataType] = { + "verified_domains", +} + + +def check_verified_domain_response_data_type(value: str | None) -> VerifiedDomainResponseDataType | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES: + return cast(VerifiedDomainResponseDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain_source.py b/rootly_sdk/models/verified_domain_source.py new file mode 100644 index 00000000..6f4b9879 --- /dev/null +++ b/rootly_sdk/models/verified_domain_source.py @@ -0,0 +1,17 @@ +from typing import Literal, cast + +VerifiedDomainSource = Literal["manual", "migration", "oauth_auto"] + +VERIFIED_DOMAIN_SOURCE_VALUES: set[VerifiedDomainSource] = { + "manual", + "migration", + "oauth_auto", +} + + +def check_verified_domain_source(value: str | None) -> VerifiedDomainSource | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_SOURCE_VALUES: + return cast(VerifiedDomainSource, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_SOURCE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain_verification_status.py b/rootly_sdk/models/verified_domain_verification_status.py new file mode 100644 index 00000000..ea62937b --- /dev/null +++ b/rootly_sdk/models/verified_domain_verification_status.py @@ -0,0 +1,18 @@ +from typing import Literal, cast + +VerifiedDomainVerificationStatus = Literal["expired", "failing", "pending", "verified"] + +VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES: set[VerifiedDomainVerificationStatus] = { + "expired", + "failing", + "pending", + "verified", +} + + +def check_verified_domain_verification_status(value: str | None) -> VerifiedDomainVerificationStatus | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES: + return cast(VerifiedDomainVerificationStatus, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/verify_phone_number_request.py b/rootly_sdk/models/verify_phone_number_request.py index 0a2aa912..af4fd0ef 100644 --- a/rootly_sdk/models/verify_phone_number_request.py +++ b/rootly_sdk/models/verify_phone_number_request.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/webhooks_delivery.py b/rootly_sdk/models/webhooks_delivery.py index 82c25bb5..9afad961 100644 --- a/rootly_sdk/models/webhooks_delivery.py +++ b/rootly_sdk/models/webhooks_delivery.py @@ -1,11 +1,11 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.webhooks_delivery_status import WebhooksDeliveryStatus, check_webhooks_delivery_status + T = TypeVar("T", bound="WebhooksDelivery") @@ -15,13 +15,19 @@ class WebhooksDelivery: Attributes: endpoint_id (str): payload (str): - delivered_at (None | str): + status (WebhooksDeliveryStatus): Delivery status + response_status (Union[None, int]): HTTP status code recorded for the delivery attempt. It is null before the + first attempt. For SSRF and transport failures, Rootly generates this code because no destination response was + received. + delivered_at (Union[None, str]): created_at (str): Date of creation updated_at (str): Date of last update """ endpoint_id: str payload: str + status: WebhooksDeliveryStatus + response_status: None | int delivered_at: None | str created_at: str updated_at: str @@ -32,6 +38,11 @@ def to_dict(self) -> dict[str, Any]: payload = self.payload + status: str = self.status + + response_status: None | int + response_status = self.response_status + delivered_at: None | str delivered_at = self.delivered_at @@ -45,6 +56,8 @@ def to_dict(self) -> dict[str, Any]: { "endpoint_id": endpoint_id, "payload": payload, + "status": status, + "response_status": response_status, "delivered_at": delivered_at, "created_at": created_at, "updated_at": updated_at, @@ -60,6 +73,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: payload = d.pop("payload") + status = check_webhooks_delivery_status(d.pop("status")) + + def _parse_response_status(data: object) -> None | int: + if data is None: + return data + return cast(None | int, data) + + response_status = _parse_response_status(d.pop("response_status")) + def _parse_delivered_at(data: object) -> None | str: if data is None: return data @@ -74,6 +96,8 @@ def _parse_delivered_at(data: object) -> None | str: webhooks_delivery = cls( endpoint_id=endpoint_id, payload=payload, + status=status, + response_status=response_status, delivered_at=delivered_at, created_at=created_at, updated_at=updated_at, diff --git a/rootly_sdk/models/webhooks_delivery_list.py b/rootly_sdk/models/webhooks_delivery_list.py index a059491e..a03f917e 100644 --- a/rootly_sdk/models/webhooks_delivery_list.py +++ b/rootly_sdk/models/webhooks_delivery_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class WebhooksDeliveryList: """ Attributes: - data (list[WebhooksDeliveryListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['WebhooksDeliveryListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WebhooksDeliveryListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WebhooksDeliveryListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_delivery_list = cls( data=data, diff --git a/rootly_sdk/models/webhooks_delivery_list_data_item.py b/rootly_sdk/models/webhooks_delivery_list_data_item.py index 0cbb26a3..28e9bcf7 100644 --- a/rootly_sdk/models/webhooks_delivery_list_data_item.py +++ b/rootly_sdk/models/webhooks_delivery_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksDeliveryListDataItem: id: str type_: WebhooksDeliveryListDataItemType - attributes: WebhooksDelivery + attributes: "WebhooksDelivery" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/webhooks_delivery_response.py b/rootly_sdk/models/webhooks_delivery_response.py index f75bc185..d75b8899 100644 --- a/rootly_sdk/models/webhooks_delivery_response.py +++ b/rootly_sdk/models/webhooks_delivery_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WebhooksDeliveryResponse: """ Attributes: data (WebhooksDeliveryResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WebhooksDeliveryResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WebhooksDeliveryResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WebhooksDeliveryResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_delivery_response = cls( data=data, diff --git a/rootly_sdk/models/webhooks_delivery_response_data.py b/rootly_sdk/models/webhooks_delivery_response_data.py index d4c4ca28..e08e14af 100644 --- a/rootly_sdk/models/webhooks_delivery_response_data.py +++ b/rootly_sdk/models/webhooks_delivery_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksDeliveryResponseData: id: str type_: WebhooksDeliveryResponseDataType - attributes: WebhooksDelivery + attributes: "WebhooksDelivery" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/webhooks_delivery_status.py b/rootly_sdk/models/webhooks_delivery_status.py new file mode 100644 index 00000000..577e3d3a --- /dev/null +++ b/rootly_sdk/models/webhooks_delivery_status.py @@ -0,0 +1,17 @@ +from typing import Literal, cast + +WebhooksDeliveryStatus = Literal["failed", "pending", "success"] + +WEBHOOKS_DELIVERY_STATUS_VALUES: set[WebhooksDeliveryStatus] = { + "failed", + "pending", + "success", +} + + +def check_webhooks_delivery_status(value: str | None) -> WebhooksDeliveryStatus | None: + if value is None: + return None + if value in WEBHOOKS_DELIVERY_STATUS_VALUES: + return cast(WebhooksDeliveryStatus, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_DELIVERY_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/webhooks_endpoint.py b/rootly_sdk/models/webhooks_endpoint.py index 54589ce4..2cd304b4 100644 --- a/rootly_sdk/models/webhooks_endpoint.py +++ b/rootly_sdk/models/webhooks_endpoint.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,9 +28,9 @@ class WebhooksEndpoint: enabled (bool): created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the endpoint - custom_headers (list[WebhooksEndpointCustomHeadersItem] | Unset): Custom HTTP headers sent with each delivery. - Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. + slug (Union[Unset, str]): The slug of the endpoint + custom_headers (Union[Unset, list['WebhooksEndpointCustomHeadersItem']]): Custom HTTP headers sent with each + delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. """ name: str @@ -42,12 +40,11 @@ class WebhooksEndpoint: enabled: bool created_at: str updated_at: str - slug: str | Unset = UNSET - custom_headers: list[WebhooksEndpointCustomHeadersItem] | Unset = UNSET + slug: Unset | str = UNSET + custom_headers: Unset | list["WebhooksEndpointCustomHeadersItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name url = self.url @@ -67,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - custom_headers: list[dict[str, Any]] | Unset = UNSET + custom_headers: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -120,14 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) + custom_headers = [] _custom_headers = d.pop("custom_headers", UNSET) - custom_headers: list[WebhooksEndpointCustomHeadersItem] | Unset = UNSET - if _custom_headers is not UNSET: - custom_headers = [] - for custom_headers_item_data in _custom_headers: - custom_headers_item = WebhooksEndpointCustomHeadersItem.from_dict(custom_headers_item_data) + for custom_headers_item_data in _custom_headers or []: + custom_headers_item = WebhooksEndpointCustomHeadersItem.from_dict(custom_headers_item_data) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) webhooks_endpoint = cls( name=name, diff --git a/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py b/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py index 4dc7a532..40958b3c 100644 --- a/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py +++ b/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/webhooks_endpoint_event_types_item.py b/rootly_sdk/models/webhooks_endpoint_event_types_item.py index 8c8f32c8..f4256cf0 100644 --- a/rootly_sdk/models/webhooks_endpoint_event_types_item.py +++ b/rootly_sdk/models/webhooks_endpoint_event_types_item.py @@ -2,6 +2,7 @@ WebhooksEndpointEventTypesItem = Literal[ "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", @@ -36,6 +37,7 @@ WEBHOOKS_ENDPOINT_EVENT_TYPES_ITEM_VALUES: set[WebhooksEndpointEventTypesItem] = { "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", diff --git a/rootly_sdk/models/webhooks_endpoint_list.py b/rootly_sdk/models/webhooks_endpoint_list.py index 7948809d..a4fd1daf 100644 --- a/rootly_sdk/models/webhooks_endpoint_list.py +++ b/rootly_sdk/models/webhooks_endpoint_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class WebhooksEndpointList: """ Attributes: - data (list[WebhooksEndpointListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['WebhooksEndpointListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WebhooksEndpointListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WebhooksEndpointListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_endpoint_list = cls( data=data, diff --git a/rootly_sdk/models/webhooks_endpoint_list_data_item.py b/rootly_sdk/models/webhooks_endpoint_list_data_item.py index c3c181eb..cc5bce1c 100644 --- a/rootly_sdk/models/webhooks_endpoint_list_data_item.py +++ b/rootly_sdk/models/webhooks_endpoint_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksEndpointListDataItem: id: str type_: WebhooksEndpointListDataItemType - attributes: WebhooksEndpoint + attributes: "WebhooksEndpoint" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/webhooks_endpoint_response.py b/rootly_sdk/models/webhooks_endpoint_response.py index 0b880393..be935fca 100644 --- a/rootly_sdk/models/webhooks_endpoint_response.py +++ b/rootly_sdk/models/webhooks_endpoint_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WebhooksEndpointResponse: """ Attributes: data (WebhooksEndpointResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WebhooksEndpointResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WebhooksEndpointResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WebhooksEndpointResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_endpoint_response = cls( data=data, diff --git a/rootly_sdk/models/webhooks_endpoint_response_data.py b/rootly_sdk/models/webhooks_endpoint_response_data.py index d3e2828f..d86d8e51 100644 --- a/rootly_sdk/models/webhooks_endpoint_response_data.py +++ b/rootly_sdk/models/webhooks_endpoint_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksEndpointResponseData: id: str type_: WebhooksEndpointResponseDataType - attributes: WebhooksEndpoint + attributes: "WebhooksEndpoint" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow.py b/rootly_sdk/models/workflow.py index ee3acbe6..255a05be 100644 --- a/rootly_sdk/models/workflow.py +++ b/rootly_sdk/models/workflow.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,71 +25,71 @@ class Workflow: name (str): The title of the workflow created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the workflow - description (None | str | Unset): The description of the workflow - command (None | str | Unset): Workflow command - command_feedback_enabled (bool | None | Unset): This will notify you back when the workflow is starting - wait (None | str | Unset): Wait this duration before executing - repeat_every_duration (None | str | Unset): Repeat workflow every duration - repeat_condition_duration_since_first_run (None | str | Unset): The workflow will stop repeating if its runtime - since it's first workflow run exceeds the duration set in this field - repeat_condition_number_of_repeats (int | Unset): The workflow will stop repeating if the number of repeats - exceeds the value set in this field - continuously_repeat (bool | Unset): When continuously repeat is true, repeat workflows aren't automatically - stopped when conditions aren't met. This setting won't override your conditions set by + slug (Union[Unset, str]): The slug of the workflow + description (Union[None, Unset, str]): The description of the workflow + command (Union[None, Unset, str]): Workflow command + command_feedback_enabled (Union[None, Unset, bool]): This will notify you back when the workflow is starting + wait (Union[None, Unset, str]): Wait this duration before executing + repeat_every_duration (Union[None, Unset, str]): Repeat workflow every duration + repeat_condition_duration_since_first_run (Union[None, Unset, str]): The workflow will stop repeating if its + runtime since it's first workflow run exceeds the duration set in this field + repeat_condition_number_of_repeats (Union[Unset, int]): The workflow will stop repeating if the number of + repeats exceeds the value set in this field + continuously_repeat (Union[Unset, bool]): When continuously repeat is true, repeat workflows aren't + automatically stopped when conditions aren't met. This setting won't override your conditions set by repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - repeat_on (list[WorkflowRepeatOnType0Item] | None | Unset): - enabled (bool | Unset): - locked (bool | Unset): Restricts workflow edits to admins when turned on. Only admins can set this field. - position (int | Unset): The order which the workflow should run with other workflows. - workflow_group_id (None | str | Unset): The group this workflow belongs to. - trigger_params (ActionItemTriggerParams | AlertTriggerParams | IncidentTriggerParams | PulseTriggerParams | - SimpleTriggerParams | Unset): - environment_ids (list[str] | Unset): - severity_ids (list[str] | Unset): - incident_type_ids (list[str] | Unset): - incident_role_ids (list[str] | Unset): - service_ids (list[str] | Unset): - functionality_ids (list[str] | Unset): - group_ids (list[str] | Unset): - cause_ids (list[str] | Unset): - sub_status_ids (list[str] | Unset): + repeat_on (Union[None, Unset, list[WorkflowRepeatOnType0Item]]): + enabled (Union[Unset, bool]): + locked (Union[Unset, bool]): Restricts workflow edits to admins when turned on. Only admins can set this field. + position (Union[Unset, int]): The order which the workflow should run with other workflows. + workflow_group_id (Union[None, Unset, str]): The group this workflow belongs to. + trigger_params (Union['ActionItemTriggerParams', 'AlertTriggerParams', 'IncidentTriggerParams', + 'PulseTriggerParams', 'SimpleTriggerParams', Unset]): + environment_ids (Union[Unset, list[str]]): + severity_ids (Union[Unset, list[str]]): + incident_type_ids (Union[Unset, list[str]]): + incident_role_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): + functionality_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): + cause_ids (Union[Unset, list[str]]): + sub_status_ids (Union[Unset, list[str]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - command: None | str | Unset = UNSET - command_feedback_enabled: bool | None | Unset = UNSET - wait: None | str | Unset = UNSET - repeat_every_duration: None | str | Unset = UNSET - repeat_condition_duration_since_first_run: None | str | Unset = UNSET - repeat_condition_number_of_repeats: int | Unset = UNSET - continuously_repeat: bool | Unset = UNSET - repeat_on: list[WorkflowRepeatOnType0Item] | None | Unset = UNSET - enabled: bool | Unset = UNSET - locked: bool | Unset = UNSET - position: int | Unset = UNSET - workflow_group_id: None | str | Unset = UNSET - trigger_params: ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ) = UNSET - environment_ids: list[str] | Unset = UNSET - severity_ids: list[str] | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - incident_role_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - cause_ids: list[str] | Unset = UNSET - sub_status_ids: list[str] | Unset = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + command: None | Unset | str = UNSET + command_feedback_enabled: None | Unset | bool = UNSET + wait: None | Unset | str = UNSET + repeat_every_duration: None | Unset | str = UNSET + repeat_condition_duration_since_first_run: None | Unset | str = UNSET + repeat_condition_number_of_repeats: Unset | int = UNSET + continuously_repeat: Unset | bool = UNSET + repeat_on: None | Unset | list[WorkflowRepeatOnType0Item] = UNSET + enabled: Unset | bool = UNSET + locked: Unset | bool = UNSET + position: Unset | int = UNSET + workflow_group_id: None | Unset | str = UNSET + trigger_params: Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ] = UNSET + environment_ids: Unset | list[str] = UNSET + severity_ids: Unset | list[str] = UNSET + incident_type_ids: Unset | list[str] = UNSET + incident_role_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + cause_ids: Unset | list[str] = UNSET + sub_status_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -108,37 +106,37 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | str | Unset + command: None | Unset | str if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: bool | None | Unset + command_feedback_enabled: None | Unset | bool if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | str | Unset + wait: None | Unset | str if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: None | str | Unset + repeat_every_duration: None | Unset | str if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: None | str | Unset + repeat_condition_duration_since_first_run: None | Unset | str if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -148,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: list[str] | None | Unset + repeat_on: None | Unset | list[str] if isinstance(self.repeat_on, Unset): repeat_on = UNSET elif isinstance(self.repeat_on, list): @@ -166,13 +164,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | str | Unset + workflow_group_id: None | Unset | str if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: dict[str, Any] | Unset + trigger_params: Unset | dict[str, Any] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -186,39 +184,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: list[str] | Unset = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: list[str] | Unset = UNSET + severity_ids: Unset | list[str] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: list[str] | Unset = UNSET + incident_role_ids: Unset | list[str] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: list[str] | Unset = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: list[str] | Unset = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: list[str] | Unset = UNSET + cause_ids: Unset | list[str] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: list[str] | Unset = UNSET + sub_status_ids: Unset | list[str] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -299,57 +297,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | str | Unset: + def _parse_command(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: + def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | Unset | bool, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | str | Unset: + def _parse_wait(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> None | str | Unset: + def _parse_repeat_every_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -359,7 +357,7 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str continuously_repeat = d.pop("continuously_repeat", UNSET) - def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | Unset: + def _parse_repeat_on(data: object) -> None | Unset | list[WorkflowRepeatOnType0Item]: if data is None: return data if isinstance(data, Unset): @@ -375,9 +373,9 @@ def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | U repeat_on_type_0.append(repeat_on_type_0_item) return repeat_on_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[WorkflowRepeatOnType0Item] | None | Unset, data) + return cast(None | Unset | list[WorkflowRepeatOnType0Item], data) repeat_on = _parse_repeat_on(d.pop("repeat_on", UNSET)) @@ -387,25 +385,25 @@ def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | U position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | str | Unset: + def _parse_workflow_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ): + ) -> Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -414,7 +412,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -422,7 +420,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -430,7 +428,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -438,7 +436,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition.py b/rootly_sdk/models/workflow_action_item_form_field_condition.py index 511e7fa5..e483d466 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,13 +24,13 @@ class WorkflowActionItemFormFieldCondition: selected_catalog_entity_ids (list[str]): selected_option_ids (list[str]): selected_user_ids (list[int]): - values (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ workflow_id: str @@ -41,13 +39,13 @@ class WorkflowActionItemFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] action_item_condition: WorkflowActionItemFormFieldConditionActionItemCondition = "ANY" - values: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,31 +61,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_list.py b/rootly_sdk/models/workflow_action_item_form_field_condition_list.py index b855ca58..cac4c8f0 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,20 +22,19 @@ class WorkflowActionItemFormFieldConditionList: """ Attributes: - data (list[WorkflowActionItemFormFieldConditionListDataItem]): + data (list['WorkflowActionItemFormFieldConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowActionItemFormFieldConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowActionItemFormFieldConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -89,14 +86,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_action_item_form_field_condition_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py b/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py index 0196c392..274ccb1a 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowActionItemFormFieldConditionListDataItem: id: str type_: WorkflowActionItemFormFieldConditionListDataItemType - attributes: WorkflowActionItemFormFieldCondition + attributes: "WorkflowActionItemFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_response.py b/rootly_sdk/models/workflow_action_item_form_field_condition_response.py index d5a6bc3c..10f0545c 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,18 +21,17 @@ class WorkflowActionItemFormFieldConditionResponse: """ Attributes: data (WorkflowActionItemFormFieldConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowActionItemFormFieldConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowActionItemFormFieldConditionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -63,14 +60,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowActionItemFormFieldConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_action_item_form_field_condition_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py b/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py index ba8b9202..52a2c586 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowActionItemFormFieldConditionResponseData: id: str type_: WorkflowActionItemFormFieldConditionResponseDataType - attributes: WorkflowActionItemFormFieldCondition + attributes: "WorkflowActionItemFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_custom_field_selection.py b/rootly_sdk/models/workflow_custom_field_selection.py index aa0bec5c..b236ae05 100644 --- a/rootly_sdk/models/workflow_custom_field_selection.py +++ b/rootly_sdk/models/workflow_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,14 +21,14 @@ class WorkflowCustomFieldSelection: custom_field_id (int): The custom field for this selection incident_condition (WorkflowCustomFieldSelectionIncidentCondition): The trigger condition Default: 'ANY'. selected_option_ids (list[int]): - values (list[str] | Unset): + values (Union[Unset, list[str]]): """ workflow_id: str custom_field_id: int selected_option_ids: list[int] incident_condition: WorkflowCustomFieldSelectionIncidentCondition = "ANY" - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: selected_option_ids = self.selected_option_ids - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/workflow_custom_field_selection_list.py b/rootly_sdk/models/workflow_custom_field_selection_list.py index c4c1b992..88ea8c43 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class WorkflowCustomFieldSelectionList: """ Attributes: - data (list[WorkflowCustomFieldSelectionListDataItem]): + data (list['WorkflowCustomFieldSelectionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowCustomFieldSelectionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowCustomFieldSelectionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_custom_field_selection_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py b/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py index 3c0c25c7..5dee7a75 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowCustomFieldSelectionListDataItem: id: str type_: WorkflowCustomFieldSelectionListDataItemType - attributes: WorkflowCustomFieldSelection + attributes: "WorkflowCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_custom_field_selection_response.py b/rootly_sdk/models/workflow_custom_field_selection_response.py index 359a6902..dddd95eb 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WorkflowCustomFieldSelectionResponse: """ Attributes: data (WorkflowCustomFieldSelectionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowCustomFieldSelectionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowCustomFieldSelectionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowCustomFieldSelectionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_custom_field_selection_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_custom_field_selection_response_data.py b/rootly_sdk/models/workflow_custom_field_selection_response_data.py index a6358569..0ae87605 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response_data.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowCustomFieldSelectionResponseData: id: str type_: WorkflowCustomFieldSelectionResponseDataType - attributes: WorkflowCustomFieldSelection + attributes: "WorkflowCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_form_field_condition.py b/rootly_sdk/models/workflow_form_field_condition.py index f3d3ed95..b937c662 100644 --- a/rootly_sdk/models/workflow_form_field_condition.py +++ b/rootly_sdk/models/workflow_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -25,13 +23,13 @@ class WorkflowFormFieldCondition: selected_catalog_entity_ids (list[str]): selected_option_ids (list[str]): selected_user_ids (list[int]): - values (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ workflow_id: str @@ -40,13 +38,13 @@ class WorkflowFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] incident_condition: WorkflowFormFieldConditionIncidentCondition = "ANY" - values: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,31 +60,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: list[str] | Unset = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/workflow_form_field_condition_list.py b/rootly_sdk/models/workflow_form_field_condition_list.py index dfbfcc0d..f3b99e98 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_form_field_condition_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class WorkflowFormFieldConditionList: """ Attributes: - data (list[WorkflowFormFieldConditionListDataItem]): + data (list['WorkflowFormFieldConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowFormFieldConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowFormFieldConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_form_field_condition_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_form_field_condition_list_data_item.py b/rootly_sdk/models/workflow_form_field_condition_list_data_item.py index 3faa4ee9..3597e8e1 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list_data_item.py +++ b/rootly_sdk/models/workflow_form_field_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowFormFieldConditionListDataItem: id: str type_: WorkflowFormFieldConditionListDataItemType - attributes: WorkflowFormFieldCondition + attributes: "WorkflowFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_form_field_condition_response.py b/rootly_sdk/models/workflow_form_field_condition_response.py index a9ea7141..671954a0 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_form_field_condition_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WorkflowFormFieldConditionResponse: """ Attributes: data (WorkflowFormFieldConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowFormFieldConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowFormFieldConditionResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowFormFieldConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_form_field_condition_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_form_field_condition_response_data.py b/rootly_sdk/models/workflow_form_field_condition_response_data.py index e38e325b..c7a81d78 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response_data.py +++ b/rootly_sdk/models/workflow_form_field_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowFormFieldConditionResponseData: id: str type_: WorkflowFormFieldConditionResponseDataType - attributes: WorkflowFormFieldCondition + attributes: "WorkflowFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_group.py b/rootly_sdk/models/workflow_group.py index 1563246a..bc80f73e 100644 --- a/rootly_sdk/models/workflow_group.py +++ b/rootly_sdk/models/workflow_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,20 +16,20 @@ class WorkflowGroup: Attributes: name (str): The name of the workflow group. position (int): The position of the workflow group - kind (WorkflowGroupKind | Unset): The kind of the workflow group - slug (str | Unset): The slug of the workflow group. - description (None | str | Unset): A description of the workflow group. - icon (str | Unset): An emoji icon displayed next to the workflow group. - expanded (bool | Unset): Whether the group is expanded or collapsed. + kind (Union[Unset, WorkflowGroupKind]): The kind of the workflow group + slug (Union[Unset, str]): The slug of the workflow group. + description (Union[None, Unset, str]): A description of the workflow group. + icon (Union[Unset, str]): An emoji icon displayed next to the workflow group. + expanded (Union[Unset, bool]): Whether the group is expanded or collapsed. """ name: str position: int - kind: WorkflowGroupKind | Unset = UNSET - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - icon: str | Unset = UNSET - expanded: bool | Unset = UNSET + kind: Unset | WorkflowGroupKind = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | str = UNSET + expanded: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,13 +37,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - kind: str | Unset = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind slug = self.slug - description: None | str | Unset + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -84,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _kind = d.pop("kind", UNSET) - kind: WorkflowGroupKind | Unset + kind: Unset | WorkflowGroupKind if isinstance(_kind, Unset): kind = UNSET else: @@ -92,12 +90,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/workflow_group_list.py b/rootly_sdk/models/workflow_group_list.py index 31743ee5..9a38d9db 100644 --- a/rootly_sdk/models/workflow_group_list.py +++ b/rootly_sdk/models/workflow_group_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class WorkflowGroupList: """ Attributes: - data (list[WorkflowGroupListDataItem]): + data (list['WorkflowGroupListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowGroupListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowGroupListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_group_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_group_list_data_item.py b/rootly_sdk/models/workflow_group_list_data_item.py index 039a54f5..adf2c51c 100644 --- a/rootly_sdk/models/workflow_group_list_data_item.py +++ b/rootly_sdk/models/workflow_group_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowGroupListDataItem: id: str type_: WorkflowGroupListDataItemType - attributes: WorkflowGroup + attributes: "WorkflowGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_group_response.py b/rootly_sdk/models/workflow_group_response.py index d2bd3bec..3dd3f4e3 100644 --- a/rootly_sdk/models/workflow_group_response.py +++ b/rootly_sdk/models/workflow_group_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WorkflowGroupResponse: """ Attributes: data (WorkflowGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowGroupResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_group_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_group_response_data.py b/rootly_sdk/models/workflow_group_response_data.py index f637b6cd..6fcd902e 100644 --- a/rootly_sdk/models/workflow_group_response_data.py +++ b/rootly_sdk/models/workflow_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowGroupResponseData: id: str type_: WorkflowGroupResponseDataType - attributes: WorkflowGroup + attributes: "WorkflowGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_list.py b/rootly_sdk/models/workflow_list.py index b74bb15d..b6b1a4f9 100644 --- a/rootly_sdk/models/workflow_list.py +++ b/rootly_sdk/models/workflow_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class WorkflowList: """ Attributes: - data (list[WorkflowListDataItem]): + data (list['WorkflowListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_list_data_item.py b/rootly_sdk/models/workflow_list_data_item.py index 713a974e..b751de36 100644 --- a/rootly_sdk/models/workflow_list_data_item.py +++ b/rootly_sdk/models/workflow_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class WorkflowListDataItem: id: str type_: WorkflowListDataItemType - attributes: Workflow + attributes: "Workflow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_response.py b/rootly_sdk/models/workflow_response.py index 48ad6d5a..1166b999 100644 --- a/rootly_sdk/models/workflow_response.py +++ b/rootly_sdk/models/workflow_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WorkflowResponse: """ Attributes: data (WorkflowResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_response_data.py b/rootly_sdk/models/workflow_response_data.py index 708d02d4..eeced5e7 100644 --- a/rootly_sdk/models/workflow_response_data.py +++ b/rootly_sdk/models/workflow_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class WorkflowResponseData: id: str type_: WorkflowResponseDataType - attributes: Workflow + attributes: "Workflow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_run.py b/rootly_sdk/models/workflow_run.py index 1953ec09..53b52940 100644 --- a/rootly_sdk/models/workflow_run.py +++ b/rootly_sdk/models/workflow_run.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,104 +22,103 @@ class WorkflowRun: workflow_id (str): status (WorkflowRunStatus): triggered_by (WorkflowRunTriggeredBy): - status_message (None | str | Unset): - started_at (None | str | Unset): - completed_at (None | str | Unset): - failed_at (None | str | Unset): - canceled_at (None | str | Unset): - incident_id (None | str | Unset): - post_mortem_id (None | str | Unset): - action_item_id (None | str | Unset): - alert_id (None | str | Unset): - pulse_id (None | str | Unset): - context (WorkflowRunContext | Unset): + status_message (Union[None, Unset, str]): + started_at (Union[None, Unset, str]): + completed_at (Union[None, Unset, str]): + failed_at (Union[None, Unset, str]): + canceled_at (Union[None, Unset, str]): + incident_id (Union[None, Unset, str]): + post_mortem_id (Union[None, Unset, str]): + action_item_id (Union[None, Unset, str]): + alert_id (Union[None, Unset, str]): + pulse_id (Union[None, Unset, str]): + context (Union[Unset, WorkflowRunContext]): """ workflow_id: str status: WorkflowRunStatus triggered_by: WorkflowRunTriggeredBy - status_message: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - completed_at: None | str | Unset = UNSET - failed_at: None | str | Unset = UNSET - canceled_at: None | str | Unset = UNSET - incident_id: None | str | Unset = UNSET - post_mortem_id: None | str | Unset = UNSET - action_item_id: None | str | Unset = UNSET - alert_id: None | str | Unset = UNSET - pulse_id: None | str | Unset = UNSET - context: WorkflowRunContext | Unset = UNSET + status_message: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + completed_at: None | Unset | str = UNSET + failed_at: None | Unset | str = UNSET + canceled_at: None | Unset | str = UNSET + incident_id: None | Unset | str = UNSET + post_mortem_id: None | Unset | str = UNSET + action_item_id: None | Unset | str = UNSET + alert_id: None | Unset | str = UNSET + pulse_id: None | Unset | str = UNSET + context: Union[Unset, "WorkflowRunContext"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workflow_id = self.workflow_id status: str = self.status triggered_by: str = self.triggered_by - status_message: None | str | Unset + status_message: None | Unset | str if isinstance(self.status_message, Unset): status_message = UNSET else: status_message = self.status_message - started_at: None | str | Unset + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: None | str | Unset + completed_at: None | Unset | str if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - failed_at: None | str | Unset + failed_at: None | Unset | str if isinstance(self.failed_at, Unset): failed_at = UNSET else: failed_at = self.failed_at - canceled_at: None | str | Unset + canceled_at: None | Unset | str if isinstance(self.canceled_at, Unset): canceled_at = UNSET else: canceled_at = self.canceled_at - incident_id: None | str | Unset + incident_id: None | Unset | str if isinstance(self.incident_id, Unset): incident_id = UNSET else: incident_id = self.incident_id - post_mortem_id: None | str | Unset + post_mortem_id: None | Unset | str if isinstance(self.post_mortem_id, Unset): post_mortem_id = UNSET else: post_mortem_id = self.post_mortem_id - action_item_id: None | str | Unset + action_item_id: None | Unset | str if isinstance(self.action_item_id, Unset): action_item_id = UNSET else: action_item_id = self.action_item_id - alert_id: None | str | Unset + alert_id: None | Unset | str if isinstance(self.alert_id, Unset): alert_id = UNSET else: alert_id = self.alert_id - pulse_id: None | str | Unset + pulse_id: None | Unset | str if isinstance(self.pulse_id, Unset): pulse_id = UNSET else: pulse_id = self.pulse_id - context: dict[str, Any] | Unset = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -170,98 +167,98 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: triggered_by = check_workflow_run_triggered_by(d.pop("triggered_by")) - def _parse_status_message(data: object) -> None | str | Unset: + def _parse_status_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) status_message = _parse_status_message(d.pop("status_message", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> None | str | Unset: + def _parse_completed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_failed_at(data: object) -> None | str | Unset: + def _parse_failed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) failed_at = _parse_failed_at(d.pop("failed_at", UNSET)) - def _parse_canceled_at(data: object) -> None | str | Unset: + def _parse_canceled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) canceled_at = _parse_canceled_at(d.pop("canceled_at", UNSET)) - def _parse_incident_id(data: object) -> None | str | Unset: + def _parse_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) incident_id = _parse_incident_id(d.pop("incident_id", UNSET)) - def _parse_post_mortem_id(data: object) -> None | str | Unset: + def _parse_post_mortem_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) post_mortem_id = _parse_post_mortem_id(d.pop("post_mortem_id", UNSET)) - def _parse_action_item_id(data: object) -> None | str | Unset: + def _parse_action_item_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) action_item_id = _parse_action_item_id(d.pop("action_item_id", UNSET)) - def _parse_alert_id(data: object) -> None | str | Unset: + def _parse_alert_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) alert_id = _parse_alert_id(d.pop("alert_id", UNSET)) - def _parse_pulse_id(data: object) -> None | str | Unset: + def _parse_pulse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(None | Unset | str, data) pulse_id = _parse_pulse_id(d.pop("pulse_id", UNSET)) _context = d.pop("context", UNSET) - context: WorkflowRunContext | Unset + context: Unset | WorkflowRunContext if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/workflow_run_context.py b/rootly_sdk/models/workflow_run_context.py index ecd3107f..28bff04f 100644 --- a/rootly_sdk/models/workflow_run_context.py +++ b/rootly_sdk/models/workflow_run_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class WorkflowRunContext: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/workflow_run_response.py b/rootly_sdk/models/workflow_run_response.py index 54aa6066..50819314 100644 --- a/rootly_sdk/models/workflow_run_response.py +++ b/rootly_sdk/models/workflow_run_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WorkflowRunResponse: """ Attributes: data (WorkflowRunResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowRunResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowRunResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowRunResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_run_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_run_response_data.py b/rootly_sdk/models/workflow_run_response_data.py index a40ae7da..73ec5e96 100644 --- a/rootly_sdk/models/workflow_run_response_data.py +++ b/rootly_sdk/models/workflow_run_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class WorkflowRunResponseData: id: str type_: WorkflowRunResponseDataType - attributes: WorkflowRun + attributes: "WorkflowRun" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_runs_list.py b/rootly_sdk/models/workflow_runs_list.py index 578c499e..f4f48a91 100644 --- a/rootly_sdk/models/workflow_runs_list.py +++ b/rootly_sdk/models/workflow_runs_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class WorkflowRunsList: """ Attributes: - data (list[WorkflowRunsListDataItem]): + data (list['WorkflowRunsListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowRunsListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowRunsListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_runs_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_runs_list_data_item.py b/rootly_sdk/models/workflow_runs_list_data_item.py index 503f7ea4..970d0bec 100644 --- a/rootly_sdk/models/workflow_runs_list_data_item.py +++ b/rootly_sdk/models/workflow_runs_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowRunsListDataItem: id: str type_: WorkflowRunsListDataItemType - attributes: WorkflowRun + attributes: "WorkflowRun" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_task.py b/rootly_sdk/models/workflow_task.py index 09603629..0804153f 100644 --- a/rootly_sdk/models/workflow_task.py +++ b/rootly_sdk/models/workflow_task.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,11 +20,18 @@ from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -190,241 +195,252 @@ class WorkflowTask: """ Attributes: workflow_id (str): The ID of the parent workflow - task_params (AddActionItemTaskParams | AddMicrosoftTeamsChatTabTaskParams | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 | AddRoleTaskParams | AddSlackBookmarkTaskParamsType0 | - AddSlackBookmarkTaskParamsType1 | AddTeamTaskParams | AddToTimelineTaskParams | - ArchiveGoogleChatSpacesTaskParams | ArchiveMicrosoftTeamsChannelsTaskParams | ArchiveSlackChannelsTaskParams | - AttachDatadogDashboardsTaskParams | AttachRetrospectivePdfToJiraIssueTaskParams | - AutoAssignRoleOpsgenieTaskParams | AutoAssignRolePagerdutyTaskParamsType0 | - AutoAssignRolePagerdutyTaskParamsType1 | AutoAssignRoleRootlyTaskParams | AutoAssignRoleVictorOpsTaskParams | - CallPeopleTaskParams | ChangeGoogleChatSpacePrivacyTaskParams | ChangeSlackChannelPrivacyTaskParams | - CreateAirtableTableRecordTaskParams | CreateAnthropicChatCompletionTaskParams | CreateAsanaSubtaskTaskParams | - CreateAsanaTaskTaskParams | CreateClickupTaskTaskParams | CreateCodaPageTaskParams | - CreateConfluencePageTaskParams | CreateDatadogNotebookTaskParams | CreateDropboxPaperPageTaskParams | - CreateGithubIssueTaskParams | CreateGitlabIssueTaskParams | CreateGoogleCalendarEventTaskParams | - CreateGoogleChatSpaceTaskParams | CreateGoogleDocsPageTaskParams | CreateGoogleDocsPermissionsTaskParams | - CreateGoogleGeminiChatCompletionTaskParams | CreateGoogleMeetingTaskParams | CreateGoToMeetingTaskParams | - CreateIncidentPostmortemTaskParams | CreateIncidentTaskParams | CreateJiraIssueTaskParams | - CreateJiraSubtaskTaskParams | CreateJsmopsAlertTaskParams | CreateLinearIssueCommentTaskParams | - CreateLinearIssueTaskParams | CreateLinearSubtaskIssueTaskParams | CreateMicrosoftTeamsChannelTaskParams | - CreateMicrosoftTeamsChatTaskParams | CreateMicrosoftTeamsMeetingTaskParams | - CreateMistralChatCompletionTaskParams | CreateMotionTaskTaskParams | CreateNotionPageTaskParams | - CreateOpenaiChatCompletionTaskParams | CreateOpsgenieAlertTaskParams | CreateOutlookEventTaskParams | - CreatePagerdutyStatusUpdateTaskParams | CreatePagertreeAlertTaskParams | CreateQuipPageTaskParams | - CreateServiceNowIncidentTaskParams | CreateSharepointPageTaskParams | CreateShortcutStoryTaskParamsType0 | - CreateShortcutStoryTaskParamsType1 | CreateShortcutTaskTaskParams | CreateSlackChannelTaskParams | - CreateSubIncidentTaskParams | CreateTrelloCardTaskParams | CreateWatsonxChatCompletionTaskParams | - CreateWebexMeetingTaskParams | CreateZendeskJiraLinkTaskParams | CreateZendeskTicketTaskParams | - CreateZoomMeetingTaskParams | GetAlertsTaskParams | GetGithubCommitsTaskParamsType0 | - GetGithubCommitsTaskParamsType1 | GetGitlabCommitsTaskParamsType0 | GetGitlabCommitsTaskParamsType1 | - GetPulsesTaskParams | HttpClientTaskParams | InviteToGoogleChatSpaceTaskParams | - InviteToMicrosoftTeamsChannelRootlyTaskParams | InviteToMicrosoftTeamsChannelTaskParams | - InviteToSlackChannelOpsgenieTaskParams | InviteToSlackChannelPagerdutyTaskParamsType0 | - InviteToSlackChannelPagerdutyTaskParamsType1 | InviteToSlackChannelRootlyTaskParams | - InviteToSlackChannelTaskParamsType0 | InviteToSlackChannelTaskParamsType1 | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams | PageJsmopsOnCallRespondersTaskParams | - PageOpsgenieOnCallRespondersTaskParams | PagePagerdutyOnCallRespondersTaskParams | - PageRootlyOnCallRespondersTaskParams | PageVictorOpsOnCallRespondersTaskParamsType0 | - PageVictorOpsOnCallRespondersTaskParamsType1 | PrintTaskParams | PublishIncidentTaskParams | - RedisClientTaskParams | RemoveGoogleDocsPermissionsTaskParams | RenameGoogleChatSpaceTaskParams | - RenameMicrosoftTeamsChannelTaskParams | RenameSlackChannelTaskParams | RunCommandHerokuTaskParams | - SendDashboardReportTaskParams | SendEmailTaskParams | SendGoogleChatAttachmentsTaskParams | - SendGoogleChatMessageTaskParams | SendMicrosoftTeamsBlocksTaskParamsType0 | - SendMicrosoftTeamsChatMessageTaskParams | SendMicrosoftTeamsMessageTaskParamsType0 | - SendSlackBlocksTaskParamsType0 | SendSlackBlocksTaskParamsType1 | SendSlackBlocksTaskParamsType2 | - SendSlackMessageTaskParamsType0 | SendSlackMessageTaskParamsType1 | SendSlackMessageTaskParamsType2 | - SendSmsTaskParams | SendWhatsappMessageTaskParams | SnapshotDatadogGraphTaskParams | - SnapshotGrafanaDashboardTaskParams | SnapshotLookerLookTaskParams | SnapshotNewRelicGraphTaskParams | - TriggerWorkflowTaskParams | TweetTwitterMessageTaskParams | UpdateActionItemTaskParams | - UpdateAirtableTableRecordTaskParams | UpdateAsanaTaskTaskParams | UpdateAttachedAlertsTaskParams | - UpdateClickupTaskTaskParams | UpdateCodaPageTaskParams | UpdateConfluencePageTaskParams | - UpdateDatadogNotebookTaskParams | UpdateDropboxPaperPageTaskParams | UpdateGithubIssueTaskParams | - UpdateGitlabIssueTaskParams | UpdateGoogleCalendarEventTaskParams | UpdateGoogleChatSpaceDescriptionTaskParams | - UpdateGoogleDocsPageTaskParams | UpdateIncidentPostmortemTaskParams | UpdateIncidentStatusTimestampTaskParams | - UpdateIncidentTaskParams | UpdateJiraIssueTaskParams | UpdateLinearIssueTaskParams | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams | UpdateOpsgenieAlertTaskParams | UpdateOpsgenieIncidentTaskParams | - UpdatePagerdutyIncidentTaskParams | UpdatePagertreeAlertTaskParams | UpdateQuipPageTaskParams | - UpdateServiceNowIncidentTaskParams | UpdateSharepointPageTaskParams | UpdateShortcutStoryTaskParams | - UpdateShortcutTaskTaskParams | UpdateSlackChannelTopicTaskParams | UpdateStatusTaskParams | - UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | UpdateZendeskTicketTaskParams): + task_params (Union['AddActionItemTaskParams', 'AddMicrosoftTeamsChatTabTaskParams', + 'AddMicrosoftTeamsTabTaskParamsType0', 'AddMicrosoftTeamsTabTaskParamsType1', 'AddRoleTaskParams', + 'AddSlackBookmarkTaskParamsType0', 'AddSlackBookmarkTaskParamsType1', 'AddTeamTaskParams', + 'AddToTimelineTaskParams', 'ArchiveGoogleChatSpacesTaskParams', 'ArchiveMicrosoftTeamsChannelsTaskParams', + 'ArchiveSlackChannelsTaskParams', 'AttachDatadogDashboardsTaskParams', + 'AttachRetrospectivePdfToFreshserviceTicketTaskParams', 'AttachRetrospectivePdfToJiraIssueTaskParams', + 'AutoAssignRoleOpsgenieTaskParams', 'AutoAssignRolePagerdutyTaskParamsType0', + 'AutoAssignRolePagerdutyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType0', + 'AutoAssignRoleRootlyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType2', + 'AutoAssignRoleRootlyTaskParamsType3', 'AutoAssignRoleRootlyTaskParamsType4', + 'AutoAssignRoleVictorOpsTaskParams', 'CallPeopleTaskParams', 'ChangeGoogleChatSpacePrivacyTaskParams', + 'ChangeSlackChannelPrivacyTaskParams', 'CreateAirtableTableRecordTaskParams', + 'CreateAnthropicChatCompletionTaskParams', 'CreateAsanaSubtaskTaskParams', 'CreateAsanaTaskTaskParams', + 'CreateClickupTaskTaskParams', 'CreateCodaPageTaskParams', 'CreateConfluencePageTaskParams', + 'CreateDatadogNotebookTaskParams', 'CreateDropboxPaperPageTaskParams', 'CreateGithubIssueTaskParams', + 'CreateGitlabIssueTaskParams', 'CreateGoToMeetingTaskParams', 'CreateGoogleCalendarEventTaskParams', + 'CreateGoogleChatSpaceTaskParams', 'CreateGoogleDocsPageTaskParams', 'CreateGoogleDocsPermissionsTaskParams', + 'CreateGoogleGeminiChatCompletionTaskParams', 'CreateGoogleMeetingTaskParams', + 'CreateIncidentPostmortemTaskParams', 'CreateIncidentTaskParams', 'CreateJiraIssueTaskParams', + 'CreateJiraSubtaskTaskParams', 'CreateJsmopsAlertTaskParams', 'CreateLinearIssueCommentTaskParams', + 'CreateLinearIssueTaskParams', 'CreateLinearSubtaskIssueTaskParams', 'CreateMicrosoftTeamsChannelTaskParams', + 'CreateMicrosoftTeamsChatTaskParams', 'CreateMicrosoftTeamsMeetingTaskParams', + 'CreateMistralChatCompletionTaskParams', 'CreateMotionTaskTaskParams', 'CreateNotionPageTaskParams', + 'CreateOpenaiChatCompletionTaskParams', 'CreateOpsgenieAlertTaskParams', 'CreateOutlookEventTaskParams', + 'CreatePagerdutyStatusUpdateTaskParams', 'CreatePagertreeAlertTaskParams', 'CreateQuipPageTaskParams', + 'CreateServiceNowIncidentTaskParams', 'CreateSharepointPageTaskParams', 'CreateShortcutStoryTaskParamsType0', + 'CreateShortcutStoryTaskParamsType1', 'CreateShortcutTaskTaskParams', 'CreateSlackChannelTaskParams', + 'CreateSubIncidentTaskParams', 'CreateTrelloCardTaskParams', 'CreateWatsonxChatCompletionTaskParams', + 'CreateWebexMeetingTaskParams', 'CreateZendeskJiraLinkTaskParams', 'CreateZendeskTicketTaskParams', + 'CreateZoomMeetingTaskParams', 'GetAlertsTaskParams', 'GetGithubCommitsTaskParamsType0', + 'GetGithubCommitsTaskParamsType1', 'GetGitlabCommitsTaskParamsType0', 'GetGitlabCommitsTaskParamsType1', + 'GetPulsesTaskParams', 'HttpClientTaskParams', 'InviteToGoogleChatSpaceTaskParams', + 'InviteToMicrosoftTeamsChannelRootlyTaskParams', 'InviteToMicrosoftTeamsChannelTaskParams', + 'InviteToSlackChannelOpsgenieTaskParams', 'InviteToSlackChannelPagerdutyTaskParamsType0', + 'InviteToSlackChannelPagerdutyTaskParamsType1', 'InviteToSlackChannelRootlyTaskParams', + 'InviteToSlackChannelTaskParamsType0', 'InviteToSlackChannelTaskParamsType1', + 'InviteToSlackChannelTaskParamsType2', 'InviteToSlackChannelVictorOpsTaskParams', + 'PageJsmopsOnCallRespondersTaskParams', 'PageOpsgenieOnCallRespondersTaskParams', + 'PagePagerdutyOnCallRespondersTaskParams', 'PageRootlyOnCallRespondersTaskParams', + 'PageVictorOpsOnCallRespondersTaskParamsType0', 'PageVictorOpsOnCallRespondersTaskParamsType1', + 'PrintTaskParams', 'PublishIncidentTaskParams', 'RedisClientTaskParams', + 'RemoveGoogleDocsPermissionsTaskParams', 'RenameGoogleChatSpaceTaskParams', + 'RenameMicrosoftTeamsChannelTaskParams', 'RenameSlackChannelTaskParams', 'RunCommandHerokuTaskParams', + 'SendDashboardReportTaskParams', 'SendEmailTaskParams', 'SendGoogleChatAttachmentsTaskParams', + 'SendGoogleChatMessageTaskParams', 'SendMicrosoftTeamsBlocksTaskParamsType0', + 'SendMicrosoftTeamsChatMessageTaskParams', 'SendMicrosoftTeamsMessageTaskParamsType0', + 'SendSlackBlocksTaskParamsType0', 'SendSlackBlocksTaskParamsType1', 'SendSlackBlocksTaskParamsType2', + 'SendSlackMessageTaskParamsType0', 'SendSlackMessageTaskParamsType1', 'SendSlackMessageTaskParamsType2', + 'SendSmsTaskParams', 'SendWhatsappMessageTaskParams', 'SnapshotDatadogGraphTaskParams', + 'SnapshotGrafanaDashboardTaskParams', 'SnapshotLookerLookTaskParams', 'SnapshotNewRelicGraphTaskParams', + 'TriggerWorkflowTaskParams', 'TweetTwitterMessageTaskParams', 'UpdateActionItemTaskParams', + 'UpdateAirtableTableRecordTaskParams', 'UpdateAsanaTaskTaskParams', 'UpdateAttachedAlertsTaskParams', + 'UpdateClickupTaskTaskParams', 'UpdateCodaPageTaskParams', 'UpdateConfluencePageTaskParams', + 'UpdateDatadogNotebookTaskParams', 'UpdateDropboxPaperPageTaskParams', 'UpdateGithubIssueTaskParams', + 'UpdateGitlabIssueTaskParams', 'UpdateGoogleCalendarEventTaskParams', + 'UpdateGoogleChatSpaceDescriptionTaskParams', 'UpdateGoogleDocsPageTaskParams', + 'UpdateIncidentPostmortemTaskParams', 'UpdateIncidentStatusTimestampTaskParams', 'UpdateIncidentTaskParams', + 'UpdateJiraIssueTaskParams', 'UpdateLinearIssueTaskParams', 'UpdateMotionTaskTaskParams', + 'UpdateNotionPageTaskParams', 'UpdateOpsgenieAlertTaskParams', 'UpdateOpsgenieIncidentTaskParams', + 'UpdatePagerdutyIncidentTaskParams', 'UpdatePagertreeAlertTaskParams', 'UpdateQuipPageTaskParams', + 'UpdateServiceNowIncidentTaskParams', 'UpdateSharepointPageTaskParams', 'UpdateShortcutStoryTaskParams', + 'UpdateShortcutTaskTaskParams', 'UpdateSlackChannelTopicTaskParams', 'UpdateStatusTaskParams', + 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams']): position (int): The position of the workflow task skip_on_failure (bool): Skip workflow task if any failures enabled (bool): Enable/disable workflow task Default: True. created_at (str): Date of creation updated_at (str): Date of last update - name (str | Unset): Name of the workflow task + name (Union[Unset, str]): Name of the workflow task """ workflow_id: str - task_params: ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ) + task_params: Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ] position: int skip_on_failure: bool created_at: str updated_at: str enabled: bool = True - name: str | Unset = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -441,13 +457,20 @@ def to_dict(self) -> dict[str, Any]: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -624,7 +647,15 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRoleOpsgenieTaskParams): task_params = self.task_params.to_dict() - elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParams): + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType0): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType1): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType2): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType3): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType4): task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRolePagerdutyTaskParamsType0): task_params = self.task_params.to_dict() @@ -696,6 +727,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AttachRetrospectivePdfToJiraIssueTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AttachRetrospectivePdfToFreshserviceTicketTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearIssueTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearSubtaskIssueTaskParams): @@ -972,13 +1005,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -1138,176 +1178,181 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ): + ) -> Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ]: try: if not isinstance(data, dict): raise TypeError() task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1315,7 +1360,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1323,7 +1368,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1331,7 +1376,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_0 = AddSlackBookmarkTaskParamsType0.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1339,7 +1384,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_1 = AddSlackBookmarkTaskParamsType1.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1347,7 +1392,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1355,7 +1400,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1363,7 +1408,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1371,7 +1416,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1379,15 +1424,57 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_0 = ( + AutoAssignRoleRootlyTaskParamsType0.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_1 = ( + AutoAssignRoleRootlyTaskParamsType1.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_2 = ( + AutoAssignRoleRootlyTaskParamsType2.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_3 = ( + AutoAssignRoleRootlyTaskParamsType3.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_3 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_9 = AutoAssignRoleRootlyTaskParams.from_dict(data) + componentsschemasauto_assign_role_rootly_task_params_type_4 = ( + AutoAssignRoleRootlyTaskParamsType4.from_dict(data) + ) - return task_params_type_9 - except (TypeError, ValueError, AttributeError, KeyError): + return componentsschemasauto_assign_role_rootly_task_params_type_4 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1397,7 +1484,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1407,7 +1494,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1415,7 +1502,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1423,7 +1510,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1431,7 +1518,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1439,7 +1526,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1447,7 +1534,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1455,7 +1542,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1463,7 +1550,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1471,7 +1558,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1479,7 +1566,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1487,7 +1574,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1495,7 +1582,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1503,7 +1590,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1511,7 +1598,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1519,7 +1606,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1527,7 +1614,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1535,7 +1622,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1543,7 +1630,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1551,7 +1638,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1559,7 +1646,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1567,7 +1654,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1575,7 +1662,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1583,7 +1670,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1591,7 +1678,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1599,7 +1686,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1607,7 +1694,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1615,7 +1702,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1623,7 +1710,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1631,7 +1718,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1639,7 +1726,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1647,7 +1734,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1655,7 +1742,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1663,7 +1750,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1671,55 +1758,63 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_44 = CreateLinearIssueTaskParams.from_dict(data) + task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_45 = CreateLinearSubtaskIssueTaskParams.from_dict(data) + task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_46 = CreateLinearIssueCommentTaskParams.from_dict(data) + task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_47 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) + task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_48 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_49 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + + return task_params_type_50 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1729,7 +1824,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1739,111 +1834,111 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_51 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) - - return task_params_type_51 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_52 = CreateGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_53 = SendGoogleChatMessageTaskParams.from_dict(data) + task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_54 = SendGoogleChatAttachmentsTaskParams.from_dict(data) + task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_55 = InviteToGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_56 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) + task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_57 = RenameGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_58 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) + task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_59 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) + task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_60 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) + task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_61 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_62 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_63 = CreateNotionPageTaskParams.from_dict(data) + task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) + + return task_params_type_64 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1853,15 +1948,15 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_65 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) + task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) - return task_params_type_65 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_66 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1871,63 +1966,63 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_67 = UpdateNotionPageTaskParams.from_dict(data) - - return task_params_type_67 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_68 = UpdateQuipPageTaskParams.from_dict(data) + task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_69 = UpdateConfluencePageTaskParams.from_dict(data) + task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_70 = UpdateSharepointPageTaskParams.from_dict(data) + task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_71 = UpdateDropboxPaperPageTaskParams.from_dict(data) + task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_72 = UpdateDatadogNotebookTaskParams.from_dict(data) + task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_73 = CreateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) + + return task_params_type_74 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1937,7 +2032,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1947,71 +2042,71 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_75 = CreateShortcutTaskTaskParams.from_dict(data) - - return task_params_type_75 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_76 = CreateTrelloCardTaskParams.from_dict(data) + task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_77 = CreateWebexMeetingTaskParams.from_dict(data) + task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_78 = CreateZendeskTicketTaskParams.from_dict(data) + task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_79 = CreateZendeskJiraLinkTaskParams.from_dict(data) + task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_80 = CreateClickupTaskTaskParams.from_dict(data) + task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_81 = CreateMotionTaskTaskParams.from_dict(data) + task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_82 = CreateZoomMeetingTaskParams.from_dict(data) + task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) + + return task_params_type_83 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2019,7 +2114,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_0 = GetGithubCommitsTaskParamsType0.from_dict(data) return componentsschemasget_github_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2027,7 +2122,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_1 = GetGithubCommitsTaskParamsType1.from_dict(data) return componentsschemasget_github_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2035,7 +2130,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_0 = GetGitlabCommitsTaskParamsType0.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2043,55 +2138,55 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_85 = GetPulsesTaskParams.from_dict(data) - - return task_params_type_85 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_86 = GetAlertsTaskParams.from_dict(data) + task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_87 = HttpClientTaskParams.from_dict(data) + task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_88 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) + task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_89 = InviteToSlackChannelRootlyTaskParams.from_dict(data) + task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_90 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + + return task_params_type_91 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2101,7 +2196,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2111,7 +2206,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2121,7 +2216,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2131,7 +2226,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2141,79 +2236,79 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_93 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) - - return task_params_type_93 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_94 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) + task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_95 = CreateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_96 = CreateJsmopsAlertTaskParams.from_dict(data) + task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_97 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) + task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_98 = UpdateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_99 = UpdateOpsgenieIncidentTaskParams.from_dict(data) + task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_100 = PageRootlyOnCallRespondersTaskParams.from_dict(data) + task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_101 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + + return task_params_type_102 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2223,7 +2318,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2233,87 +2328,87 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_103 = UpdateVictorOpsIncidentTaskParams.from_dict(data) - - return task_params_type_103 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_104 = PrintTaskParams.from_dict(data) + task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_105 = PublishIncidentTaskParams.from_dict(data) + task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_106 = RedisClientTaskParams.from_dict(data) + task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_107 = RenameSlackChannelTaskParams.from_dict(data) + task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_108 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_109 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = SendEmailTaskParams.from_dict(data) + task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_110 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_111 = SendEmailTaskParams.from_dict(data) return task_params_type_111 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_112 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + + return task_params_type_113 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2321,7 +2416,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) return componentsschemassend_slack_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2329,7 +2424,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) return componentsschemassend_slack_message_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2337,223 +2432,223 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) return componentsschemassend_slack_message_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_114 = SendSmsTaskParams.from_dict(data) - - return task_params_type_114 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_115 = SendWhatsappMessageTaskParams.from_dict(data) + task_params_type_115 = SendSmsTaskParams.from_dict(data) return task_params_type_115 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_116 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_117 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_117 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_117 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_118 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_119 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_120 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_121 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_122 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_123 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_124 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_125 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_126 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_127 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_128 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_129 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_130 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_131 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_132 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateStatusTaskParams.from_dict(data) + task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_133 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_134 = UpdateStatusTaskParams.from_dict(data) return task_params_type_134 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_135 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_136 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_137 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_138 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) return task_params_type_139 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) return task_params_type_140 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_141 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2561,7 +2656,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_0 = SendSlackBlocksTaskParamsType0.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2569,7 +2664,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_1 = SendSlackBlocksTaskParamsType1.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2577,45 +2672,45 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_2 = SendSlackBlocksTaskParamsType2.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_142 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_142 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_143 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_144 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_145 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_146 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_146 + return task_params_type_147 task_params = _parse_task_params(d.pop("task_params")) diff --git a/rootly_sdk/models/workflow_task_list.py b/rootly_sdk/models/workflow_task_list.py index 147ac020..9fbe3d7b 100644 --- a/rootly_sdk/models/workflow_task_list.py +++ b/rootly_sdk/models/workflow_task_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,20 +20,19 @@ class WorkflowTaskList: """ Attributes: - data (list[WorkflowTaskListDataItem]): + data (list['WorkflowTaskListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowTaskListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowTaskListDataItem"] + links: "Links" + meta: "Meta" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_task_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_task_list_data_item.py b/rootly_sdk/models/workflow_task_list_data_item.py index 9e144806..43d4b2c7 100644 --- a/rootly_sdk/models/workflow_task_list_data_item.py +++ b/rootly_sdk/models/workflow_task_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowTaskListDataItem: id: str type_: WorkflowTaskListDataItemType - attributes: WorkflowTask + attributes: "WorkflowTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_task_response.py b/rootly_sdk/models/workflow_task_response.py index 26b15a77..a50417be 100644 --- a/rootly_sdk/models/workflow_task_response.py +++ b/rootly_sdk/models/workflow_task_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,18 +19,17 @@ class WorkflowTaskResponse: """ Attributes: data (WorkflowTaskResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowTaskResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowTaskResponseData" + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowTaskResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_task_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_task_response_data.py b/rootly_sdk/models/workflow_task_response_data.py index eb7f6834..73762081 100644 --- a/rootly_sdk/models/workflow_task_response_data.py +++ b/rootly_sdk/models/workflow_task_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowTaskResponseData: id: str type_: WorkflowTaskResponseDataType - attributes: WorkflowTask + attributes: "WorkflowTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/types.py b/rootly_sdk/types.py index b64af095..7b033942 100644 --- a/rootly_sdk/types.py +++ b/rootly_sdk/types.py @@ -19,8 +19,9 @@ def __bool__(self) -> Literal[False]: 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]] + tuple[str | None, FileContent, str | None, Mapping[str, str]] ) RequestFiles = list[tuple[str, FileTypes]]